A preious donation entitles to all pro features

This commit is contained in:
M66B 2015-12-30 18:57:00 +01:00
parent d05743b96b
commit 0e53973839
2 changed files with 11 additions and 13 deletions

View File

@ -172,18 +172,16 @@ public class ActivityPro extends AppCompatActivity {
TextView tvSpeed = (TextView) findViewById(R.id.tvSpeed);
TextView tvBackup = (TextView) findViewById(R.id.tvBackup);
boolean donated = (IAB.isPurchased(SKU_DONATION, this) || Util.isDebuggable(this));
btnSelect.setVisibility(IAB.isPurchased(SKU_SELECT, this) ? View.GONE : View.VISIBLE);
btnDefaults.setVisibility(IAB.isPurchased(SKU_DEFAULTS, this) ? View.GONE : View.VISIBLE);
btnTheme.setVisibility(IAB.isPurchased(SKU_THEME, this) ? View.GONE : View.VISIBLE);
btnSpeed.setVisibility(IAB.isPurchased(SKU_SPEED, this) ? View.GONE : View.VISIBLE);
btnBackup.setVisibility(IAB.isPurchased(SKU_BACKUP, this) ? View.GONE : View.VISIBLE);
btnSelect.setVisibility(donated || IAB.isPurchased(SKU_SELECT, this) ? View.GONE : View.VISIBLE);
btnDefaults.setVisibility(donated || IAB.isPurchased(SKU_DEFAULTS, this) ? View.GONE : View.VISIBLE);
btnTheme.setVisibility(donated || IAB.isPurchased(SKU_THEME, this) ? View.GONE : View.VISIBLE);
btnSpeed.setVisibility(donated || IAB.isPurchased(SKU_SPEED, this) ? View.GONE : View.VISIBLE);
btnBackup.setVisibility(donated || IAB.isPurchased(SKU_BACKUP, this) ? View.GONE : View.VISIBLE);
tvSelect.setVisibility(donated || IAB.isPurchased(SKU_SELECT, this) ? View.VISIBLE : View.GONE);
tvDefaults.setVisibility(donated || IAB.isPurchased(SKU_DEFAULTS, this) ? View.VISIBLE : View.GONE);
tvTheme.setVisibility(donated || IAB.isPurchased(SKU_THEME, this) ? View.VISIBLE : View.GONE);
tvSpeed.setVisibility(donated || IAB.isPurchased(SKU_SPEED, this) ? View.VISIBLE : View.GONE);
tvBackup.setVisibility(donated || IAB.isPurchased(SKU_BACKUP, this) ? View.VISIBLE : View.GONE);
tvSelect.setVisibility(IAB.isPurchased(SKU_SELECT, this) ? View.VISIBLE : View.GONE);
tvDefaults.setVisibility(IAB.isPurchased(SKU_DEFAULTS, this) ? View.VISIBLE : View.GONE);
tvTheme.setVisibility(IAB.isPurchased(SKU_THEME, this) ? View.VISIBLE : View.GONE);
tvSpeed.setVisibility(IAB.isPurchased(SKU_SPEED, this) ? View.VISIBLE : View.GONE);
tvBackup.setVisibility(IAB.isPurchased(SKU_BACKUP, this) ? View.VISIBLE : View.GONE);
}
}

View File

@ -160,7 +160,7 @@ public class IAB implements ServiceConnection {
public static boolean isPurchased(String sku, Context context) {
SharedPreferences prefs = context.getSharedPreferences("IAB", Context.MODE_PRIVATE);
return prefs.getBoolean(sku, false);
return (prefs.getBoolean(sku, false) || prefs.getBoolean(ActivityPro.SKU_DONATION, false) || Util.isDebuggable(context));
}
public static String getResult(int responseCode) {