From 3538c6158291ff8d3fec8bb93f8ca36935089221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Wed, 17 Jan 2024 18:01:48 +0900 Subject: [PATCH] WIP --- .../example/childguard/QrControlActivity.java | 26 +++++++++++++++++++ .../main/res/layout/activity_qr_control.xml | 25 +++++++++++++++++- app/src/main/res/menu/qr_preview_manu.xml | 8 ++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/menu/qr_preview_manu.xml diff --git a/app/src/main/java/com/example/childguard/QrControlActivity.java b/app/src/main/java/com/example/childguard/QrControlActivity.java index 227a80c..4dcdc44 100644 --- a/app/src/main/java/com/example/childguard/QrControlActivity.java +++ b/app/src/main/java/com/example/childguard/QrControlActivity.java @@ -8,8 +8,14 @@ import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; +import com.google.android.material.appbar.MaterialToolbar; + +import java.util.Objects; + public class QrControlActivity extends AppCompatActivity { + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -20,5 +26,25 @@ public class QrControlActivity extends AppCompatActivity { v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); return insets; }); + + MaterialToolbar toolbar = findViewById(R.id.qr_control_toolbar); + setSupportActionBar(toolbar); + Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true); + + + } + + @Override + public boolean onCreateOptionsMenu(android.view.Menu menu) { + getMenuInflater().inflate(R.menu.qr_preview_manu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(android.view.MenuItem item) { + if (item.getItemId() == R.id.print_qr) { + + } + return super.onOptionsItemSelected(item); } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_qr_control.xml b/app/src/main/res/layout/activity_qr_control.xml index 3aa44dd..3c68328 100644 --- a/app/src/main/res/layout/activity_qr_control.xml +++ b/app/src/main/res/layout/activity_qr_control.xml @@ -5,6 +5,29 @@ android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".QrControlActivity"> + tools:context=".GeneratedQrFragment" > + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/qr_preview_manu.xml b/app/src/main/res/menu/qr_preview_manu.xml new file mode 100644 index 0000000..1b80506 --- /dev/null +++ b/app/src/main/res/menu/qr_preview_manu.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file