Skip to content

Commit

Permalink
Improve "Add claim" UI
Browse files Browse the repository at this point in the history
  • Loading branch information
bmonjoie committed Jun 29, 2023
1 parent 53a20b1 commit d3412c2
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 118 deletions.
Expand Up @@ -145,6 +145,8 @@ protected void onCreate(Bundle savedInstanceState) {
return false;
});

findViewById(R.id.ivAddItem).setOnClickListener(v -> addItem());
findViewById(R.id.ivAddService).setOnClickListener(v -> addService());

btnScan.setOnClickListener(v -> {
Intent scanIntent = new Intent(this, com.google.zxing.client.android.CaptureActivity.class);
Expand Down Expand Up @@ -270,21 +272,29 @@ public boolean onCreateOptionsMenu(Menu menu) {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.mnuAddItems:
Intent addItemsIntent = new Intent(ClaimActivity.this, AddItems.class);
addItemsIntent.putExtra(EXTRA_READONLY, isIntentReadonly());
ClaimActivity.this.startActivity(addItemsIntent);
addItem();
return true;
case R.id.mnuAddServices:
Intent addServicesIntent = new Intent(ClaimActivity.this, AddServices.class);
addServicesIntent.putExtra(EXTRA_READONLY, isIntentReadonly());
ClaimActivity.this.startActivity(addServicesIntent);
addService();
return true;
default:
onBackPressed();
return true;
}
}

private void addItem() {
Intent addItemsIntent = new Intent(ClaimActivity.this, AddItems.class);
addItemsIntent.putExtra(EXTRA_READONLY, isIntentReadonly());
ClaimActivity.this.startActivity(addItemsIntent);
}

private void addService() {
Intent addServicesIntent = new Intent(this, AddServices.class);
addServicesIntent.putExtra(EXTRA_READONLY, isIntentReadonly());
ClaimActivity.this.startActivity(addServicesIntent);
}

@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
Expand Down
5 changes: 5 additions & 0 deletions claimManagement/src/main/res/drawable/ic_add.xml
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

0 comments on commit d3412c2

Please sign in to comment.