Search in sources :

Example 36 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.

the class EntityHeaderControllerTest method testBuildView_withContext_shouldBuildPreference.

@Test
public void testBuildView_withContext_shouldBuildPreference() {
    mController = EntityHeaderController.newInstance(mActivity, mFragment, null);
    Preference preference = mController.done(mActivity, mShadowContext);
    assertThat(preference instanceof LayoutPreference).isTrue();
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) LayoutPreference(com.android.settings.applications.LayoutPreference) Preference(android.support.v7.preference.Preference) Test(org.junit.Test)

Example 37 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.

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 38 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.

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 39 with LayoutPreference

use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.

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 40 with LayoutPreference

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

the class EntityHeaderControllerTest method testBuildView_withContext_shouldBuildPreference.

@Test
public void testBuildView_withContext_shouldBuildPreference() {
    mController = EntityHeaderController.newInstance(mActivity, mFragment, null);
    Preference preference = mController.done(mActivity, mShadowContext);
    assertThat(preference instanceof LayoutPreference).isTrue();
}
Also used : LayoutPreference(com.android.settings.applications.LayoutPreference) LayoutPreference(com.android.settings.applications.LayoutPreference) Preference(android.support.v7.preference.Preference) Test(org.junit.Test)

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