Search in sources :

Example 66 with LayoutPreference

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

the class AccountHeaderPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    FakeFeatureFactory.setupForTest(mContext);
    mHeaderPreference = new LayoutPreference(RuntimeEnvironment.application, R.layout.settings_entity_header);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) Before(org.junit.Before)

Example 67 with LayoutPreference

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

the class BluetoothDetailsButtonsControllerTest method setUp.

@Override
public void setUp() {
    super.setUp();
    mController = new BluetoothDetailsButtonsController(mContext, mFragment, mCachedDevice, mLifecycle);
    mLeftButton = new Button(mContext);
    mRightButton = new Button(mContext);
    mLayoutPreference = new LayoutPreference(mContext, R.layout.app_action_buttons);
    mLayoutPreference.setKey(mController.getPreferenceKey());
    mScreen.addPreference(mLayoutPreference);
    mLeftButton = (Button) mLayoutPreference.findViewById(R.id.left_button);
    mRightButton = (Button) mLayoutPreference.findViewById(R.id.right_button);
    setupDevice(mDeviceConfig);
    when(mCachedDevice.isBusy()).thenReturn(false);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) Button(android.widget.Button)

Example 68 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(int resource) {
    mHeader = new LayoutPreference(getPrefContext(), resource);
    addPreferenceToTop(mHeader);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference)

Example 69 with LayoutPreference

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

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)

Example 70 with LayoutPreference

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

the class AccountHeaderPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    FakeFeatureFactory.setupForTest(mContext);
    mHeaderPreference = new LayoutPreference(RuntimeEnvironment.application, R.layout.settings_entity_header);
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) Before(org.junit.Before)

Aggregations

LayoutPreference (com.android.settings.applications.LayoutPreference)85 Button (android.widget.Button)18 View (android.view.View)12 Switch (android.widget.Switch)12 SwitchBar (com.android.settings.widget.SwitchBar)12 Before (org.junit.Before)12 Preference (android.support.v7.preference.Preference)7 Intent (android.content.Intent)6 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)6 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)6 Test (org.junit.Test)6 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