Search in sources :

Example 16 with FooterPreference

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

the class BluetoothDetailsMacAddressControllerTest method macAddress.

@Test
public void macAddress() {
    showScreen(mController);
    FooterPreference footer = (FooterPreference) mScreen.findPreference(mController.getPreferenceKey());
    assertThat(footer.getTitle().toString()).endsWith(mDeviceConfig.getAddress());
}
Also used : FooterPreference(com.android.settingslib.widget.FooterPreference) Test(org.junit.Test)

Example 17 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.

the class BluetoothPairingDetailTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = RuntimeEnvironment.application;
    mFragment = spy(new BluetoothPairingDetail());
    doReturn(mContext).when(mFragment).getContext();
    doReturn(mResource).when(mFragment).getResources();
    mAvailableDevicesCategory = spy(new BluetoothProgressCategory(mContext));
    mFooterPreference = new FooterPreference(mContext);
    mFragment.mLocalAdapter = mLocalAdapter;
    mFragment.mLocalManager = mLocalManager;
    mFragment.mDeviceListGroup = mPreferenceGroup;
    mFragment.mAlwaysDiscoverable = new AlwaysDiscoverable(mContext, mLocalAdapter);
}
Also used : FooterPreference(com.android.settingslib.widget.FooterPreference) Before(org.junit.Before)

Example 18 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.

the class BluetoothSettingsTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(RuntimeEnvironment.application);
    FakeFeatureFactory.setupForTest(mContext);
    mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
    mFragment = spy(new BluetoothSettings());
    doReturn(mContext).when(mFragment).getContext();
    doReturn(mResource).when(mFragment).getResources();
    doReturn(mActivity).when(mFragment).getActivity();
    mContainer = new View(mContext);
    mEmptyMessage = new TextView(mContext);
    doReturn(mContainer).when(mActivity).findViewById(android.R.id.list_container);
    doReturn(mEmptyMessage).when(mActivity).findViewById(android.R.id.empty);
    mFooterPreference = new FooterPreference(RuntimeEnvironment.application);
    mFragment.setLocalBluetoothAdapter(mLocalAdapter);
    mFragment.mPairingPrefController = mPairingPreferenceController;
}
Also used : TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) FooterPreference(com.android.settingslib.widget.FooterPreference) Before(org.junit.Before)

Example 19 with FooterPreference

use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.

the class BluetoothDetailsMacAddressControllerTest method macAddress.

@Test
public void macAddress() {
    showScreen(mController);
    FooterPreference footer = (FooterPreference) mScreen.findPreference(mController.getPreferenceKey());
    assertThat(footer.getTitle().toString()).endsWith(mDeviceConfig.getAddress());
}
Also used : FooterPreference(com.android.settingslib.widget.FooterPreference) Test(org.junit.Test)

Example 20 with FooterPreference

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

the class BluetoothPairingDetailTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = RuntimeEnvironment.application;
    mFragment = spy(new BluetoothPairingDetail());
    doReturn(mContext).when(mFragment).getContext();
    doReturn(mResource).when(mFragment).getResources();
    mAvailableDevicesCategory = spy(new BluetoothProgressCategory(mContext));
    mFooterPreference = new FooterPreference(mContext);
    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter());
    mBluetoothDevice = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS);
    mFragment.mBluetoothAdapter = mBluetoothAdapter;
    mFragment.mLocalManager = mLocalManager;
    mFragment.mDeviceListGroup = mPreferenceGroup;
    mFragment.mAlwaysDiscoverable = new AlwaysDiscoverable(mContext);
}
Also used : FooterPreference(com.android.settingslib.widget.FooterPreference) Before(org.junit.Before)

Aggregations

FooterPreference (com.android.settingslib.widget.FooterPreference)56 Before (org.junit.Before)14 Test (org.junit.Test)12 NotificationChannel (android.app.NotificationChannel)6 NotificationChannelGroup (android.app.NotificationChannelGroup)6 Preference (android.support.v7.preference.Preference)6 PreferenceCategory (android.support.v7.preference.PreferenceCategory)6 View (android.view.View)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 Intent (android.content.Intent)5 Preference (androidx.preference.Preference)5 PreferenceScreen (androidx.preference.PreferenceScreen)3 Context (android.content.Context)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 Handler (android.os.Handler)1 PowerManager (android.os.PowerManager)1 SwitchPreference (android.support.v14.preference.SwitchPreference)1