Compare commits

...

8 Commits

Author SHA1 Message Date
Sylvia van Os
8e452ed6bd Merge branch 'master' of github.com:TheLastProject/loyalty-card-locker 2022-02-11 20:04:50 +01:00
Sylvia van Os
a9e574a9b4 Release Catima 2.15.2 2022-02-11 20:04:38 +01:00
Sylvia van Os
f24d11403c Merge pull request #810 from CatimaLoyalty/create-pull-request/patch-1644601552
Update Fastlane changelogs
2022-02-11 19:46:45 +01:00
TheLastProject
e1c658ac2a Update Fastlane changelogs 2022-02-11 17:45:52 +00:00
Sylvia van Os
a5901700b4 Fix crash in edit activity on locale without region 2022-02-11 18:45:28 +01:00
Sylvia van Os
bf4cd7a961 Merge pull request #807 from CatimaLoyalty/create-pull-request/patch-1644529031
Update Fastlane changelogs
2022-02-10 22:37:35 +01:00
TheLastProject
79ca5196d0 Update Fastlane changelogs 2022-02-10 21:37:10 +00:00
Sylvia van Os
b24d641aa6 Fix manual language selection not applying anywhere 2022-02-10 22:36:51 +01:00
7 changed files with 43 additions and 12 deletions

View File

@@ -1,5 +1,10 @@
# Changelog
## v2.15.2 - 103 (2022-02-11)
- Fix manual language selection not applying everywhere
- Fix crash in edit view on regionless locale
## v2.15.1 - 102 (2022-02-10)
- Various minor fixes

View File

@@ -18,8 +18,8 @@ android {
applicationId "me.hackerchick.catima"
minSdkVersion 21
targetSdkVersion 31
versionCode 102
versionName "2.15.1"
versionCode 103
versionName "2.15.2"
vectorDrawables.useSupportLibrary true
multiDexEnabled true

View File

@@ -15,7 +15,7 @@ import protect.card_locker.preferences.Settings;
public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.GroupListItemViewHolder> {
Settings mSettings;
private final Context mContext;
public final Context mContext;
private final GroupAdapterListener mListener;
SQLiteDatabase mDatabase;
@@ -23,7 +23,7 @@ public class GroupCursorAdapter extends BaseCursorAdapter<GroupCursorAdapter.Gro
super(inputCursor, DBHelper.LoyaltyCardDbGroups.ORDER);
setHasStableIds(true);
mSettings = new Settings(inputContext);
mContext = inputContext.getApplicationContext();
mContext = inputContext;
mListener = inputListener;
mDatabase = new DBHelper(inputContext).getReadableDatabase();

View File

@@ -35,7 +35,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
private int mCurrentSelectedIndex = -1;
Settings mSettings;
boolean mDarkModeEnabled;
private final Context mContext;
public final Context mContext;
private final CardAdapterListener mListener;
protected SparseBooleanArray mSelectedItems;
protected SparseBooleanArray mAnimationItemsIndex;
@@ -46,7 +46,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
super(inputCursor, DBHelper.LoyaltyCardDbIds.ID);
setHasStableIds(true);
mSettings = new Settings(inputContext);
mContext = inputContext.getApplicationContext();
mContext = inputContext;
mListener = inputListener;
mSelectedItems = new SparseBooleanArray();
mAnimationItemsIndex = new SparseBooleanArray();

View File

@@ -448,14 +448,10 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
for (int i = locales.size() - 1; i >= 0; i--) {
Locale locale = locales.get(i);
String currencySymbol = Currency.getInstance(locale).getSymbol();
currencyList.remove(currencySymbol);
currencyList.add(0, currencySymbol);
currencyPrioritizeLocaleSymbols(currencyList, locale);
}
} else {
String currencySymbol = Currency.getInstance(mSystemLocale).getSymbol();
currencyList.remove(currencySymbol);
currencyList.add(0, currencySymbol);
currencyPrioritizeLocaleSymbols(currencyList, mSystemLocale);
}
currencyList.add(0, getString(R.string.points));
@@ -1513,4 +1509,14 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
throw new UnsupportedOperationException();
}
}
private void currencyPrioritizeLocaleSymbols(ArrayList<String> currencyList, Locale locale) {
try {
String currencySymbol = Currency.getInstance(locale).getSymbol();
currencyList.remove(currencySymbol);
currencyList.add(0, currencySymbol);
} catch (IllegalArgumentException e) {
Log.d(TAG, "Could not get currency data for locale info: " + e);
}
}
}

View File

@@ -313,6 +313,24 @@ public class LoyaltyCardViewActivityTest {
}
}
@Test
@Config(qualifiers="de")
public void noCrashOnRegionlessLocale() {
ActivityController activityController = Robolectric.buildActivity(LoyaltyCardEditActivity.class).create();
LoyaltyCardEditActivity activity = (LoyaltyCardEditActivity) activityController.get();
final Context context = activity.getApplicationContext();
activityController.start();
activityController.visible();
activityController.resume();
shadowOf(getMainLooper()).idle();
// Check default settings
checkAllFields(activity, ViewMode.ADD_CARD, "", "", context.getString(R.string.never), "0", context.getString(R.string.points), "", context.getString(R.string.sameAsCardId), context.getString(R.string.noBarcode), null, null);
}
@Test
public void noDataLossOnResumeOrRotate() {
registerMediaStoreIntentHandler();

View File

@@ -0,0 +1,2 @@
- Fix manual language selection not applying everywhere
- Fix crash in edit view on regionless locale