Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 147c2890 authored by Haijie Hong's avatar Haijie Hong
Browse files

Apply expressive theme to bluetooth dialogs

Bug: 409886048
Test: local tested
Flag: com.android.settings.flags.enable_bluetooth_settings_expressive_design
Change-Id: I3bb3fc9ff65f2f59e2ea066ee306f76d03cbcc6a
parent d419986d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
            android:layout_gravity="center"
            android:importantForAccessibility="no"
            android:src="@drawable/ic_warning_24dp"
            android:tint="@color/settingslib_materialColorOutline" />
            android:tint="@color/settingslib_materialColorPrimary" />

        <TextView
            android:id="@+id/bluetooth_key_missing_title"
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;

import com.android.settingslib.widget.SettingsThemeHelper;
import com.android.settingslib.widget.theme.R;

/** A dialog to ask the user to forget a bluetooth device when the key is missing. */
public class BluetoothKeyMissingDialog extends FragmentActivity {
    public static final String FRAGMENT_TAG = "BtKeyMissingFrg";
@@ -32,6 +35,9 @@ public class BluetoothKeyMissingDialog extends FragmentActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (SettingsThemeHelper.isExpressiveTheme(this)) {
            setTheme(R.style.Theme_AlertDialog_SettingsLib_Expressive);
        }

        getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
        Intent intent = getIntent();
+6 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.fragment.app.FragmentActivity;

import com.android.settingslib.widget.SettingsThemeHelper;
import com.android.settingslib.widget.theme.R;

/**
 * BluetoothPairingDialog asks the user to enter a PIN / Passkey / simple confirmation
 * for pairing with a remote Bluetooth device. It is an activity that appears as a dialog.
@@ -66,6 +69,9 @@ public class BluetoothPairingDialog extends FragmentActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (SettingsThemeHelper.isExpressiveTheme(this)) {
            setTheme(R.style.Theme_AlertDialog_SettingsLib_Expressive);
        }

        getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
        Intent intent = getIntent();
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import androidx.appcompat.app.AlertDialog;

import com.android.settings.R;
import com.android.settingslib.bluetooth.BluetoothDiscoverableTimeoutReceiver;
import com.android.settingslib.widget.SettingsThemeHelper;

import kotlin.Unit;

@@ -81,6 +82,11 @@ public class RequestPermissionActivity extends Activity implements
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (SettingsThemeHelper.isExpressiveTheme(this)) {
            setTheme(
                    com.android.settingslib.widget.theme.R.style
                            .Theme_AlertDialog_SettingsLib_Expressive);
        }

        getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);