Simplification

This commit is contained in:
M66B 2019-09-10 09:05:21 +02:00
parent 3369ef9431
commit 541de9e257
7 changed files with 13 additions and 13 deletions

View File

@ -102,7 +102,7 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
getSupportFragmentManager().addOnBackStackChangedListener(this);
}
if (Helper.isPlayStoreInstall(this)) {
if (Helper.isPlayStoreInstall()) {
Log.i("IAB start");
billingClient = BillingClient.newBuilder(this)
.enablePendingPurchases()
@ -219,7 +219,7 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
};
private void onPurchase(Intent intent) {
if (Helper.isPlayStoreInstall(this)) {
if (Helper.isPlayStoreInstall()) {
BillingFlowParams.Builder flowParams = BillingFlowParams.newBuilder();
if (skuDetails.containsKey(getSkuPro())) {
Log.i("IAB purchase SKU=" + skuDetails.get(getSkuPro()));

View File

@ -39,7 +39,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
protected void onCreate(Bundle savedInstanceState) {
getSupportFragmentManager().addOnBackStackChangedListener(this);
if (!Log.isSupportedDevice() && Helper.isPlayStoreInstall(this)) {
if (!Log.isSupportedDevice() && Helper.isPlayStoreInstall()) {
setTheme(R.style.AppThemeLight);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_unsupported);

View File

@ -336,7 +336,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}, new Runnable() {
@Override
public void run() {
if (!Helper.isPlayStoreInstall(ActivityView.this)) {
if (!Helper.isPlayStoreInstall()) {
drawerLayout.closeDrawer(drawerContainer);
checkUpdate(true);
}
@ -360,7 +360,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}
}).setExternal(true));
if ((Helper.isPlayStoreInstall(this) || BuildConfig.DEBUG) &&
if ((Helper.isPlayStoreInstall() || BuildConfig.DEBUG) &&
getIntentRate(this).resolveActivity(pm) != null)
extra.add(new NavMenuItem(R.drawable.baseline_star_24, R.string.menu_rate, new Runnable() {
@Override
@ -687,7 +687,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}
private void checkUpdate(boolean always) {
if (Helper.isPlayStoreInstall(this) || !Helper.hasValidFingerprint(this))
if (Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(this))
return;
long now = new Date().getTime();
@ -813,7 +813,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
private Intent getIntentOtherApps() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(Helper.isPlayStoreInstall(this)
intent.setData(Uri.parse(Helper.isPlayStoreInstall()
? Helper.PLAY_APPS_URI : Helper.XDA_APPS_URI));
return intent;
}

View File

@ -61,7 +61,7 @@ public class ApplicationEx extends Application {
Log.e(ex);
if (BuildConfig.BETA_RELEASE ||
!Helper.isPlayStoreInstall(ApplicationEx.this))
!Helper.isPlayStoreInstall())
Log.writeCrashLog(ApplicationEx.this, ex);
if (prev != null)
@ -190,7 +190,7 @@ public class ApplicationEx extends Application {
nm.createNotificationChannel(notification);
// Update
if (!Helper.isPlayStoreInstall(this)) {
if (!Helper.isPlayStoreInstall()) {
NotificationChannel update = new NotificationChannel(
"update", getString(R.string.channel_update),
NotificationManager.IMPORTANCE_HIGH);

View File

@ -303,7 +303,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
swUpdates.setChecked(prefs.getBoolean("updates", true));
swUpdates.setVisibility(
Helper.isPlayStoreInstall(getContext()) || !Helper.hasValidFingerprint(getContext())
Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(getContext())
? View.GONE : View.VISIBLE);
swExperiments.setChecked(prefs.getBoolean("experiments", false));
swCrashReports.setChecked(prefs.getBoolean("crash_reports", false));

View File

@ -101,7 +101,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
btnPurchase.setEnabled(false);
tvPrice.setText(null);
btnCheck.setEnabled(false);
btnCheck.setVisibility(Helper.isPlayStoreInstall(getContext()) && debug ? View.VISIBLE : View.GONE);
btnCheck.setVisibility(Helper.isPlayStoreInstall() && debug ? View.VISIBLE : View.GONE);
return view;
}
@ -182,7 +182,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
boolean pro = prefs.getBoolean(key, false);
tvActivated.setVisibility(pro ? View.VISIBLE : View.GONE);
if (!Helper.isPlayStoreInstall(getContext()))
if (!Helper.isPlayStoreInstall())
btnPurchase.setEnabled(!pro || BuildConfig.DEBUG);
}
}

View File

@ -813,7 +813,7 @@ public class Helper {
return sb.toString();
}
static boolean isPlayStoreInstall(Context context) {
static boolean isPlayStoreInstall() {
return BuildConfig.PLAY_STORE_RELEASE;
}