Skip to content

Commit

Permalink
Use buildAlertDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
p1gp1g authored and mar-v-in committed Sep 28, 2024
1 parent 6e82590 commit 9e9bec2
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.navigation.NavController;
Expand All @@ -20,6 +19,7 @@
import org.microg.gms.common.Constants;
import org.microg.gms.ui.settings.SettingsProvider;

import static org.microg.gms.ui.UtilsKt.buildAlertDialog;
import static org.microg.gms.ui.settings.SettingsProviderKt.getAllSettingsProviders;

public class MainSettingsActivity extends AppCompatActivity {
Expand All @@ -36,15 +36,14 @@ private void showDialogIfNeeded() {
SharedPreferences prefs = getSharedPreferences(FIRST_RUN_MASTER, MODE_PRIVATE);
if (BuildConfig.APPLICATION_ID == Constants.USER_MICROG_PACKAGE_NAME &&
prefs.getBoolean(FIRST_RUN_PREF, true)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);

builder.setMessage(R.string.limited_services_dialog_information)
buildAlertDialog(this)
.setMessage(R.string.limited_services_dialog_information)
.setTitle(R.string.limited_services_app_name)
.setPositiveButton(R.string.limited_services_dialog_information_ack, (dialog, id) -> {
prefs.edit().putBoolean(FIRST_RUN_PREF, false).apply();
});

builder.create().show();
})
.create()
.show();
}
}

Expand Down

0 comments on commit 9e9bec2

Please sign in to comment.