use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.
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);
}
use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.
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());
}
use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.
the class WifiDetailPreferenceController method setupEntityHeader.
private void setupEntityHeader(PreferenceScreen screen) {
LayoutPreference headerPref = (LayoutPreference) screen.findPreference(KEY_HEADER);
mEntityHeaderController = EntityHeaderController.newInstance(mFragment.getActivity(), mFragment, headerPref.findViewById(R.id.entity_header));
ImageView iconView = headerPref.findViewById(R.id.entity_header_icon);
iconView.setBackground(mContext.getDrawable(R.drawable.ic_settings_widget_background));
iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
mEntityHeaderController.setLabel(mAccessPoint.getSsidStr());
}
use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.
the class BatteryHeaderPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
mContext = spy(RuntimeEnvironment.application);
mBatteryMeterView = new BatteryMeterView(mContext);
mBatteryPercentText = new TextView(mContext);
mSummary = new TextView(mContext);
ShadowEntityHeaderController.setUseMock(mEntityHeaderController);
mSummary2 = new TextView(mContext);
mBatteryIntent = new Intent();
mBatteryIntent.putExtra(BatteryManager.EXTRA_LEVEL, BATTERY_LEVEL);
mBatteryIntent.putExtra(BatteryManager.EXTRA_SCALE, 100);
mBatteryIntent.putExtra(BatteryManager.EXTRA_PLUGGED, 1);
doReturn(mBatteryIntent).when(mContext).registerReceiver(any(), any());
mBatteryLayoutPref = new LayoutPreference(mContext, R.layout.battery_header);
doReturn(mBatteryLayoutPref).when(mPreferenceScreen).findPreference(BatteryHeaderPreferenceController.KEY_BATTERY_HEADER);
mBatteryInfo.batteryLevel = BATTERY_LEVEL;
mController = new BatteryHeaderPreferenceController(mContext, mActivity, mPreferenceFragment, mLifecycle);
mController.mBatteryMeterView = mBatteryMeterView;
mController.mBatteryPercentText = mBatteryPercentText;
mController.mSummary1 = mSummary;
mController.mSummary2 = mSummary2;
}
use of com.android.settings.applications.LayoutPreference in project platform_packages_apps_Settings by BlissRoms.
the class SettingsPreferenceFragment method setHeaderView.
protected void setHeaderView(View view) {
mHeader = new LayoutPreference(getPrefContext(), view);
addPreferenceToTop(mHeader);
}
Aggregations