This commit is contained in:
ろむねこ 2024-01-17 18:01:48 +09:00
parent f65331da84
commit 3538c61582
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
3 changed files with 58 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -5,6 +5,29 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".QrControlActivity">
tools:context=".GeneratedQrFragment" >
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/qr_control_toolbar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/white"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:title="Preview"/>
<ImageView
android:id="@+id/result_bitmap_image_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/close_fill0_wght400_grad0_opsz24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/print_qr"
android:icon="@drawable/ic_home_black_24dp"
android:title="Print"/>
</menu>