Search in sources :

Example 11 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project android_packages_apps_Settings by crdroidandroid.

the class SettingsPreferenceFragment method setHeaderView.

protected void setHeaderView(View view) {
    mHeader = new LayoutPreference(getPrefContext(), view);
    addPreferenceToTop(mHeader);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference)

Example 12 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project android_packages_apps_Settings by crdroidandroid.

the class RemoveAccountPreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    final LayoutPreference removeAccountPreference = (LayoutPreference) screen.findPreference(KEY_REMOVE_ACCOUNT);
    Button removeAccountButton = (Button) removeAccountPreference.findViewById(R.id.button);
    removeAccountButton.setOnClickListener(this);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) Button(android.widget.Button)

Example 13 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project android_packages_apps_Settings by crdroidandroid.

the class BluetoothDetailsHeaderControllerTest method setUp.

@Override
public void setUp() {
    super.setUp();
    FakeFeatureFactory.setupForTest(spy(mContext));
    ShadowEntityHeaderController.setUseMock(mHeaderController);
    mController = new BluetoothDetailsHeaderController(mContext, mFragment, mCachedDevice, mLifecycle);
    mPreference = new LayoutPreference(mContext, R.layout.settings_entity_header);
    mPreference.setKey(mController.getPreferenceKey());
    mScreen.addPreference(mPreference);
    setupDevice(mDeviceConfig);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference)

Example 14 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project android_packages_apps_Settings by crdroidandroid.

the class EntityHeaderController method done.

/**
 * Done mutating entity header, rebinds everything and return a new {@link LayoutPreference}.
 */
public LayoutPreference done(Activity activity, Context uiContext) {
    final LayoutPreference pref = new LayoutPreference(uiContext, done(activity));
    // Makes sure it's the first preference onscreen.
    pref.setOrder(-1000);
    pref.setSelectable(false);
    pref.setKey(PREF_KEY_APP_HEADER);
    return pref;
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference)

Example 15 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project android_packages_apps_Settings by SudaMod.

the class StartNowPreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    LayoutPreference pref = (LayoutPreference) screen.findPreference(getPreferenceKey());
    Button startButton = (Button) pref.findViewById(R.id.dream_start_now_button);
    startButton.setOnClickListener(v -> mBackend.startDreaming());
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) Button(android.widget.Button)

Aggregations

LayoutPreference (com.android.settings.applications.LayoutPreference)76 Button (android.widget.Button)16 View (android.view.View)12 Switch (android.widget.Switch)12 SwitchBar (com.android.settings.widget.SwitchBar)12 Before (org.junit.Before)10 Preference (android.support.v7.preference.Preference)7 ImageView (android.widget.ImageView)6 Test (org.junit.Test)6 Intent (android.content.Intent)5 TextView (android.widget.TextView)5 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)5 Context (android.content.Context)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 Bundle (android.os.Bundle)1 OnPreferenceClickListener (android.support.v7.preference.Preference.OnPreferenceClickListener)1 BatterySipper (com.android.internal.os.BatterySipper)1