mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-05 08:03:47 -04:00
Pre-populate card id in Barcode Selector
If a user is attempting to update a card id of an existing card, before when the Enter Card button was selected the barcode selector view would be empty. To be more useful, the view will now be pre-populated with the existing card id.
This commit is contained in:
@@ -124,6 +124,14 @@ public class BarcodeSelectorActivity extends AppCompatActivity
|
||||
// Noting to do
|
||||
}
|
||||
});
|
||||
|
||||
final Bundle b = getIntent().getExtras();
|
||||
final String initialCardId = b != null ? b.getString("initialCardId") : null;
|
||||
|
||||
if(initialCardId != null)
|
||||
{
|
||||
cardId.setText(initialCardId);
|
||||
}
|
||||
}
|
||||
|
||||
private void createBarcodeOption(final ImageView image, final String formatType, final String cardId)
|
||||
|
||||
@@ -222,6 +222,15 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent i = new Intent(getApplicationContext(), BarcodeSelectorActivity.class);
|
||||
|
||||
String cardId = cardIdFieldEdit.getText().toString();
|
||||
if(cardId.length() > 0)
|
||||
{
|
||||
final Bundle b = new Bundle();
|
||||
b.putString("initialCardId", cardId);
|
||||
i.putExtras(b);
|
||||
}
|
||||
|
||||
startActivityForResult(i, SELECT_BARCODE_REQUEST);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user