diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java index 74f0872d..bed03b42 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java @@ -17,6 +17,7 @@ import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; +import com.google.android.material.appbar.MaterialToolbar; import com.websitebeaver.documentscanner.DocumentScanner; import java.util.ArrayList; @@ -76,6 +77,9 @@ public class ScannerManagerActivity extends AppCompatActivity { return insets; }); + MaterialToolbar toolbar = findViewById(R.id.top_toolbar); + setSupportActionBar(toolbar); + documentScanner.startScan(); // Init @@ -83,6 +87,25 @@ public class ScannerManagerActivity extends AppCompatActivity { } + @Override + public boolean onCreateOptionsMenu(android.view.Menu menu) { + getMenuInflater().inflate(R.menu.scanner_result_toolbar, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(android.view.MenuItem item) { + if (item.getItemId() == R.id.action_close) { + finish(); + return true; + } else if (item.getItemId() == R.id.action_save) { + // TODO-rca: 保存処理 + Toast.makeText(this, "保存処理", Toast.LENGTH_SHORT).show(); + return true; + } + return super.onOptionsItemSelected(item); + } + private void processResult(ArrayList resultImages) { logger.debug(TAG, "processResult"); diff --git a/component/scanner/src/main/res/layout/activity_scanner_manager.xml b/component/scanner/src/main/res/layout/activity_scanner_manager.xml index 27b1fa64..9e14218c 100644 --- a/component/scanner/src/main/res/layout/activity_scanner_manager.xml +++ b/component/scanner/src/main/res/layout/activity_scanner_manager.xml @@ -2,9 +2,23 @@ + + + app:layout_constraintTop_toBottomOf="@id/top_toolbar" /> + + + + \ No newline at end of file