Skip to content

Commit 13975e1

Browse files
committed
add back button
1 parent 04c9314 commit 13975e1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

app/src/main/java/app/attestation/auditor/InspectAuditeeActivity.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
import android.widget.TableRow;
77
import android.widget.TextView;
88

9+
import androidx.appcompat.app.ActionBar;
910
import androidx.appcompat.app.AppCompatActivity;
1011

12+
import com.google.android.material.appbar.MaterialToolbar;
13+
1114
import java.util.Date;
1215

1316
public class InspectAuditeeActivity extends AppCompatActivity {
@@ -31,6 +34,18 @@ protected void onCreate(Bundle savedInstanceState) {
3134
super.onCreate(savedInstanceState);
3235
setContentView(R.layout.activity_inspectauditee);
3336

37+
// set up back button
38+
final MaterialToolbar toolbar = findViewById(R.id.inspect_auditee_toolbar);
39+
setSupportActionBar(toolbar);
40+
final ActionBar supportActionBar = getSupportActionBar();
41+
if (supportActionBar != null) {
42+
supportActionBar.setDisplayHomeAsUpEnabled(true);
43+
}
44+
toolbar.setNavigationOnClickListener(v -> {
45+
finish();
46+
});
47+
48+
// load auditee information
3449
final String fingerprint_hex = getIntent().getStringExtra(INTENT_KEY_FINGERPRINT);
3550
if (fingerprint_hex == null || fingerprint_hex.isBlank()) {
3651
Log.e(TAG, "auditee fingerprint not provided");

app/src/main/res/layout/activity_inspectauditee.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
android:fitsSystemWindows="true">
1212

1313
<com.google.android.material.appbar.MaterialToolbar
14-
android:id="@+id/toolbar"
14+
android:id="@+id/inspect_auditee_toolbar"
1515
android:layout_width="match_parent"
1616
android:layout_height="?attr/actionBarSize" />
1717

0 commit comments

Comments
 (0)