mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-05-11 09:33:04 -04:00
Refactor to allow updating a loyalty card from a bundle (#2051)
This allows us to send any (partial) loyalty card into the edit activity, granting us greater flexibility in what kind of scan result we can parse
This commit is contained in:
@@ -332,7 +332,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
Set<String> files = new HashSet<>();
|
||||
Cursor cardCursor = getLoyaltyCardCursor(database);
|
||||
while (cardCursor.moveToNext()) {
|
||||
LoyaltyCard card = LoyaltyCard.toLoyaltyCard(cardCursor);
|
||||
LoyaltyCard card = LoyaltyCard.fromCursor(cardCursor);
|
||||
for (ImageLocationType imageLocationType : ImageLocationType.values()) {
|
||||
String name = Utils.getCardImageFileName(card.id, imageLocationType);
|
||||
if (Utils.retrieveCardImageAsFile(context, name).exists()) {
|
||||
@@ -542,7 +542,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
|
||||
if (data.getCount() == 1) {
|
||||
data.moveToFirst();
|
||||
card = LoyaltyCard.toLoyaltyCard(data);
|
||||
card = LoyaltyCard.fromCursor(data);
|
||||
}
|
||||
|
||||
data.close();
|
||||
|
||||
Reference in New Issue
Block a user