Refactoring

This commit is contained in:
M66B 2023-09-30 07:14:31 +02:00
parent 5f89592126
commit 035196e7cc
1 changed files with 14 additions and 12 deletions

View File

@ -528,19 +528,21 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
super.onResume();
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R && Util.isPlayStoreInstall(this)) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (!prefs.getBoolean("qap", false)) {
new AlertDialog.Builder(this)
.setMessage(R.string.app_qap)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
prefs.edit().putBoolean("qap", true).apply();
}
})
.show();
}
if (!prefs.getBoolean("qap", false))
if (Util.isPlayStoreInstall(this)) {
new AlertDialog.Builder(this)
.setMessage(R.string.app_qap)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
prefs.edit().putBoolean("qap", true).apply();
}
})
.show();
} else
prefs.edit().putBoolean("qap", true).apply();
}
}