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

Commit 9cebc7eb authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "base: Add theme support to Ringtone and Profile pickers activities" into cm-11.0

parents 43299c39 64d1bb3f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -177,6 +177,16 @@ public class ProfileManager {
     */
    public static final String EXTRA_PROFILES_STATE = "profile_state";

    /**
     * Set the resource id theme to use for the dialog picker activity.<br/>
     * The default theme is <code>com.android.internal.R.Theme_Holo_Dialog_Alert</code>.
     *
     * @see #ACTION_PROFILE_PICKER
     * @hide
     */
    public static final String EXTRA_PROFILE_DIALOG_THEME =
            "android.intent.extra.profile.DIALOG_THEME";

    /**
     * Profiles are disabled.
     *
+28 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class RingtonePreference extends Preference implements
    private int mRingtoneType;
    private boolean mShowDefault;
    private boolean mShowSilent;
    private int mDialogStyle;
    
    private int mRequestCode;

@@ -61,6 +62,8 @@ public class RingtonePreference extends Preference implements
                true);
        mShowSilent = a.getBoolean(com.android.internal.R.styleable.RingtonePreference_showSilent,
                true);
        mDialogStyle = a.getResourceId(
                com.android.internal.R.styleable.RingtonePreference_dialogStyle, 0);
        a.recycle();
    }

@@ -131,6 +134,27 @@ public class RingtonePreference extends Preference implements
        mShowSilent = showSilent;
    }

    /**
     * Returns the resource id style of the ringtone dialog.
     *
     * @return The resource id of the style
     * @hide
     */
    public int getDialogStyle() {
        return mDialogStyle;
    }

    /**
     * Sets the resource id style of the ringtone dialog.
     *
     * @param dialogStyle The resource id of the style.
     * @see RingtoneManager#EXTRA_RINGTONE_DIALOG_THEME
     * @hide
     */
    public void setDialogStyle(int dialogStyle) {
        mDialogStyle = dialogStyle;
    }

    @Override
    protected void onClick() {
        // Launch the ringtone picker
@@ -161,6 +185,10 @@ public class RingtonePreference extends Preference implements
            ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
                    RingtoneManager.getDefaultUri(getRingtoneType()));
        }
        if (mDialogStyle != 0) {
            ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_DIALOG_THEME,
                    mDialogStyle);
        }

        ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, mShowSilent);
        ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, mRingtoneType);
+3 −0
Original line number Diff line number Diff line
@@ -5330,6 +5330,9 @@
        <attr name="showDefault" format="boolean" />
        <!-- Whether to show an item for 'Silent'. -->
        <attr name="showSilent" format="boolean" />
        <!-- The style of the ringtone dialog.
             @hide -->
        <attr name="dialogStyle" format="reference" />
    </declare-styleable>

    <!-- Base attributes available to VolumePreference. -->
+5 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,11 @@ please see styles_device_defaults.xml.
        <item name="android:showDefault">true</item>
    </style>

    <!-- @hide -->
    <style name="Preference.Holo.Light.RingtonePreference" parent="Preference.Holo.RingtonePreference">
        <item name="android:dialogStyle">@android:style/Theme.Holo.Light.Dialog.Alert</item>
    </style>

    <!-- No margins or background by default. Could be different for x-large screens -->
    <style name="PreferencePanel">
    </style>
+1 −1
Original line number Diff line number Diff line
@@ -1462,7 +1462,7 @@ please see themes_device_defaults.xml.
        <item name="yesNoPreferenceStyle">@android:style/Preference.Holo.DialogPreference.YesNoPreference</item>
        <item name="dialogPreferenceStyle">@android:style/Preference.Holo.DialogPreference</item>
        <item name="editTextPreferenceStyle">@android:style/Preference.Holo.DialogPreference.EditTextPreference</item>
        <item name="ringtonePreferenceStyle">@android:style/Preference.Holo.RingtonePreference</item>
        <item name="ringtonePreferenceStyle">@android:style/Preference.Holo.Light.RingtonePreference</item>
        <item name="preferenceLayoutChild">@android:layout/preference_child_holo</item>
        <item name="detailsElementBackground">@android:drawable/panel_bg_holo_light</item>

Loading