Search in sources :

Example 61 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project platform_packages_apps_Settings by BlissRoms.

the class NotificationSettingsBase method setupBlockDesc.

protected void setupBlockDesc(int summaryResId) {
    mBlockedDesc = (FooterPreference) getPreferenceScreen().findPreference(KEY_BLOCKED_DESC);
    mBlockedDesc = new FooterPreference(getPrefContext());
    mBlockedDesc.setSelectable(false);
    mBlockedDesc.setTitle(summaryResId);
    mBlockedDesc.setEnabled(false);
    mBlockedDesc.setOrder(50);
    getPreferenceScreen().addPreference(mBlockedDesc);
}
Also used : FooterPreference(com.android.settingslib.widget.FooterPreference)

Example 62 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ZenCustomRuleCallsSettings method updatePreferences.

@Override
public void updatePreferences() {
    super.updatePreferences();
    PreferenceScreen screen = getPreferenceScreen();
    Preference footerPreference = screen.findPreference(FooterPreference.KEY_FOOTER);
    footerPreference.setTitle(mContext.getResources().getString(R.string.zen_mode_custom_calls_footer, mRule.getName()));
}
Also used : PreferenceScreen(androidx.preference.PreferenceScreen) Preference(androidx.preference.Preference) FooterPreference(com.android.settingslib.widget.FooterPreference)

Example 63 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ZenCustomRuleMessagesSettings method updatePreferences.

@Override
public void updatePreferences() {
    super.updatePreferences();
    PreferenceScreen screen = getPreferenceScreen();
    Preference footerPreference = screen.findPreference(FooterPreference.KEY_FOOTER);
    footerPreference.setTitle(mContext.getResources().getString(R.string.zen_mode_custom_messages_footer, mRule.getName()));
}
Also used : PreferenceScreen(androidx.preference.PreferenceScreen) Preference(androidx.preference.Preference) FooterPreference(com.android.settingslib.widget.FooterPreference)

Example 64 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ChooseLockGenericTest method updatePreferencesOrFinish_callingAppIsAdmin_noFooter.

@Test
public void updatePreferencesOrFinish_callingAppIsAdmin_noFooter() {
    initActivity(new Intent().putExtra(EXTRA_KEY_IS_CALLING_APP_ADMIN, true));
    mFragment.updatePreferencesOrFinish(/* isRecreatingActivity= */
    false);
    FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
    assertThat(footer).isNull();
}
Also used : Intent(android.content.Intent) FooterPreference(com.android.settingslib.widget.FooterPreference) Test(org.junit.Test)

Example 65 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class UsbDefaultFragment method onCreatePreferences.

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    super.onCreatePreferences(savedInstanceState, rootKey);
    FooterPreferenceMixinCompat footer = new FooterPreferenceMixinCompat(this, this.getSettingsLifecycle());
    FooterPreference pref = footer.createFooterPreference();
    pref.setTitle(R.string.usb_default_info);
}
Also used : FooterPreferenceMixinCompat(com.android.settingslib.widget.FooterPreferenceMixinCompat) FooterPreference(com.android.settingslib.widget.FooterPreference)

Aggregations

FooterPreference (com.android.settingslib.widget.FooterPreference)84 Test (org.junit.Test)22 Before (org.junit.Before)18 Intent (android.content.Intent)17 Preference (androidx.preference.Preference)10 View (android.view.View)8 PreferenceScreen (androidx.preference.PreferenceScreen)7 NotificationChannel (android.app.NotificationChannel)6 NotificationChannelGroup (android.app.NotificationChannelGroup)6 Preference (android.support.v7.preference.Preference)6 PreferenceCategory (android.support.v7.preference.PreferenceCategory)6 TextView (android.widget.TextView)6 LayoutPreference (com.android.settings.applications.LayoutPreference)6 MasterSwitchPreference (com.android.settings.widget.MasterSwitchPreference)6 RestrictedSwitchPreference (com.android.settingslib.RestrictedSwitchPreference)6 Context (android.content.Context)3 Drawable (android.graphics.drawable.Drawable)2 SpannableString (android.text.SpannableString)2 Pair (android.util.Pair)2 VisibleForTesting (androidx.annotation.VisibleForTesting)2