Search in sources :

Example 6 with PreferenceViewHolder

use of android.support.v7.preference.PreferenceViewHolder in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ToggleBackupSettingFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mBackupManager = IBackupManager.Stub.asInterface(ServiceManager.getService(Context.BACKUP_SERVICE));
    PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(getActivity());
    setPreferenceScreen(preferenceScreen);
    mSummaryPreference = new Preference(getPrefContext()) {

        @Override
        public void onBindViewHolder(PreferenceViewHolder view) {
            super.onBindViewHolder(view);
            final TextView summaryView = (TextView) view.findViewById(android.R.id.summary);
            summaryView.setText(getSummary());
        }
    };
    mSummaryPreference.setPersistent(false);
    mSummaryPreference.setLayoutResource(R.layout.text_description_preference);
    preferenceScreen.addPreference(mSummaryPreference);
}
Also used : PreferenceScreen(android.support.v7.preference.PreferenceScreen) Preference(android.support.v7.preference.Preference) TextView(android.widget.TextView) PreferenceViewHolder(android.support.v7.preference.PreferenceViewHolder)

Aggregations

Preference (android.support.v7.preference.Preference)6 PreferenceViewHolder (android.support.v7.preference.PreferenceViewHolder)4 View (android.view.View)4 TextView (android.widget.TextView)4 PreferenceScreen (android.support.v7.preference.PreferenceScreen)2 OnClickListener (android.view.View.OnClickListener)2 ImageView (android.widget.ImageView)2 Intent (android.content.Intent)1 Uri (android.net.Uri)1 SwitchPreference (android.support.v14.preference.SwitchPreference)1 ListPreference (android.support.v7.preference.ListPreference)1 OnPreferenceChangeListener (android.support.v7.preference.Preference.OnPreferenceChangeListener)1 PreferenceCategory (android.support.v7.preference.PreferenceCategory)1 AccessibilityEvent (android.view.accessibility.AccessibilityEvent)1 AccessibilityManager (android.view.accessibility.AccessibilityManager)1 Button (android.widget.Button)1 AccessPoint (com.android.settingslib.wifi.AccessPoint)1 AccessPointPreference (com.android.settingslib.wifi.AccessPointPreference)1