mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-01-21 05:18:10 -05:00
Start using flavours
Currently, this just allows us to remove the donation button on Google Play without using the deprecated installer APIs. In the future, this should allow us to also release multiple versions of Catima (for example: WearOS is a commonly requested feature, but this needs non-free dependencies, which may not be okay to all users).
This commit is contained in:
@@ -1032,21 +1032,6 @@ public class Utils {
|
||||
return headerColor;
|
||||
}
|
||||
|
||||
public static boolean installedFromGooglePlay(Context context) {
|
||||
try {
|
||||
String packageName = context.getPackageName();
|
||||
String installer;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
installer = context.getPackageManager().getInstallSourceInfo(packageName).getInstallingPackageName();
|
||||
} else {
|
||||
installer = context.getPackageManager().getInstallerPackageName(packageName);
|
||||
}
|
||||
return installer.equals("com.android.vending");
|
||||
} catch (Throwable ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getHeaderColor(Context context, LoyaltyCard loyaltyCard) {
|
||||
return loyaltyCard.headerColor != null ? loyaltyCard.headerColor : LetterBitmap.getDefaultColor(context, loyaltyCard.store);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user