Home
last modified time | relevance | path

Searched refs:mSwitch (Results 1 – 25 of 43) sorted by relevance

12

/packages/apps/Settings/src/com/android/settings/notification/
DNotificationAppPreference.java34 private Switch mSwitch; field in NotificationAppPreference
69 if (mSwitch != null && !mSwitch.isEnabled()) { in onBindViewHolder()
82 mSwitch = (Switch) view.findViewById(R.id.switchWidget); in onBindViewHolder()
83 if (mSwitch != null) { in onBindViewHolder()
84 mSwitch.setContentDescription(getTitle()); in onBindViewHolder()
85 mSwitch.setChecked(mChecked); in onBindViewHolder()
86 mSwitch.setEnabled(mEnableSwitch); in onBindViewHolder()
91 return mSwitch != null && mChecked; in isChecked()
96 if (mSwitch != null) { in setChecked()
97 mSwitch.setChecked(checked); in setChecked()
[all …]
DNotificationSwitchBarPreference.java30 private ToggleSwitch mSwitch; field in NotificationSwitchBarPreference
41 mSwitch = (ToggleSwitch) holder.findViewById(android.R.id.switch_widget); in onBindViewHolder()
42 if (mSwitch != null) { in onBindViewHolder()
43 mSwitch.setOnClickListener(new View.OnClickListener() { in onBindViewHolder()
46 if (!mSwitch.isEnabled()) { in onBindViewHolder()
56 mSwitch.setChecked(mChecked); in onBindViewHolder()
57 mSwitch.setEnabled(mEnableSwitch); in onBindViewHolder()
62 return mSwitch != null && mSwitch.isEnabled() && mChecked; in isChecked()
67 if (mSwitch != null) { in setChecked()
68 mSwitch.setChecked(checked); in setChecked()
[all …]
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/widget/
DMasterSwitchPreference.java37 private Switch mSwitch; field in MasterSwitchPreference
71 if (mSwitch != null && !mSwitch.isEnabled()) { in onBindViewHolder()
84 mSwitch = (Switch) holder.findViewById(R.id.switchWidget); in onBindViewHolder()
85 if (mSwitch != null) { in onBindViewHolder()
86 mSwitch.setContentDescription(getTitle()); in onBindViewHolder()
87 mSwitch.setChecked(mChecked); in onBindViewHolder()
88 mSwitch.setEnabled(mEnableSwitch); in onBindViewHolder()
93 return mSwitch != null && mChecked; in isChecked()
98 if (mSwitch != null) { in setChecked()
99 mSwitch.setChecked(checked); in setChecked()
[all …]
DSwitchBar.java77 private ToggleSwitch mSwitch; field in SwitchBar
127 mSwitch = findViewById(R.id.switch_widget); in SwitchBar()
130 mSwitch.setSaveEnabled(false); in SwitchBar()
132 lp = (MarginLayoutParams) mSwitch.getLayoutParams(); in SwitchBar()
201 mSwitch.setChecked(checked); in setChecked()
206 mSwitch.setCheckedInternal(checked); in setCheckedInternal()
210 return mSwitch.isChecked(); in isChecked()
220 mSwitch.setEnabled(enabled); in setEnabled()
225 return mDisabledByAdmin ? mRestrictedIcon : mSwitch; in getDelegatingView()
239 mSwitch.setEnabled(false); in setDisabledByAdmin()
[all …]
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/notification/
DNotificationAppPreference.java34 private Switch mSwitch; field in NotificationAppPreference
69 if (mSwitch != null && !mSwitch.isEnabled()) { in onBindViewHolder()
82 mSwitch = (Switch) view.findViewById(R.id.switchWidget); in onBindViewHolder()
83 if (mSwitch != null) { in onBindViewHolder()
84 mSwitch.setContentDescription(getTitle()); in onBindViewHolder()
85 mSwitch.setChecked(mChecked); in onBindViewHolder()
86 mSwitch.setEnabled(mEnableSwitch); in onBindViewHolder()
91 return mSwitch != null && mChecked; in isChecked()
96 if (mSwitch != null) { in setChecked()
97 mSwitch.setChecked(checked); in setChecked()
[all …]
DNotificationSwitchBarPreference.java30 private ToggleSwitch mSwitch; field in NotificationSwitchBarPreference
41 mSwitch = (ToggleSwitch) holder.findViewById(android.R.id.switch_widget); in onBindViewHolder()
42 if (mSwitch != null) { in onBindViewHolder()
43 mSwitch.setOnClickListener(new View.OnClickListener() { in onBindViewHolder()
46 if (!mSwitch.isEnabled()) { in onBindViewHolder()
56 mSwitch.setChecked(mChecked); in onBindViewHolder()
57 mSwitch.setEnabled(mEnableSwitch); in onBindViewHolder()
62 return mSwitch != null && mSwitch.isEnabled() && mChecked; in isChecked()
67 if (mSwitch != null) { in setChecked()
68 mSwitch.setChecked(checked); in setChecked()
[all …]
/packages/apps/Settings/src/com/android/settings/widget/
DMasterSwitchPreference.java37 private Switch mSwitch; field in MasterSwitchPreference
71 if (mSwitch != null && !mSwitch.isEnabled()) { in onBindViewHolder()
84 mSwitch = (Switch) holder.findViewById(R.id.switchWidget); in onBindViewHolder()
85 if (mSwitch != null) { in onBindViewHolder()
86 mSwitch.setContentDescription(getTitle()); in onBindViewHolder()
87 mSwitch.setChecked(mChecked); in onBindViewHolder()
88 mSwitch.setEnabled(mEnableSwitch); in onBindViewHolder()
93 return mSwitch != null && mChecked; in isChecked()
98 if (mSwitch != null) { in setChecked()
99 mSwitch.setChecked(checked); in setChecked()
[all …]
DSwitchBar.java75 private ToggleSwitch mSwitch; field in SwitchBar
128 mSwitch = findViewById(R.id.switch_widget); in SwitchBar()
131 mSwitch.setSaveEnabled(false); in SwitchBar()
133 mSwitch.setFocusable(false); in SwitchBar()
134 mSwitch.setClickable(false); in SwitchBar()
136 lp = (MarginLayoutParams) mSwitch.getLayoutParams(); in SwitchBar()
211 mSwitch.setChecked(checked); in setChecked()
216 mSwitch.setCheckedInternal(checked); in setCheckedInternal()
220 return mSwitch.isChecked(); in isChecked()
230 mSwitch.setEnabled(enabled); in setEnabled()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/
DBlockPreferenceControllerTest.java76 private SwitchBar mSwitch; field in BlockPreferenceControllerTest
86 mSwitch = new SwitchBar(mContext); in setUp()
87 when(mPreference.findViewById(R.id.switch_bar)).thenReturn(mSwitch); in setUp()
176 assertFalse(mSwitch.isEnabled()); in testIsEnabled_lockedApp()
185 assertFalse(mSwitch.isEnabled()); in testIsEnabled_GroupNotBlockable()
194 assertFalse(mSwitch.isEnabled()); in testIsEnabled_systemAppNotBlockable()
205 assertTrue(mSwitch.isEnabled()); in testIsEnabled_systemAppBlockable()
218 assertFalse(mSwitch.isEnabled()); in testIsEnabled_lockedChannel()
231 assertFalse(mSwitch.isEnabled()); in testIsEnabled_defaultAppChannel()
243 assertTrue(mSwitch.isEnabled()); in testIsEnabled_channel()
[all …]
/packages/apps/Settings/src/com/android/settings/biometrics/face/
DFaceEnrollAccessibilityToggle.java35 private Switch mSwitch; field in FaceEnrollAccessibilityToggle
61 mSwitch = findViewById(R.id.toggle); in FaceEnrollAccessibilityToggle()
62 mSwitch.setChecked(false); in FaceEnrollAccessibilityToggle()
63 mSwitch.setClickable(false); in FaceEnrollAccessibilityToggle()
64 mSwitch.setFocusable(false); in FaceEnrollAccessibilityToggle()
68 return mSwitch.isChecked(); in isChecked()
72 mSwitch.setChecked(checked); in setChecked()
76 mSwitch.setOnCheckedChangeListener(listener); in setListener()
80 return mSwitch; in getSwitch()
/packages/apps/Car/CompanionDeviceSupport/src/com/android/car/companiondevicesupport/feature/trust/ui/
DTrustedDeviceDetailFragment.java48 private Switch mSwitch; field in TrustedDeviceDetailFragment
76 mSwitch = view.findViewById(R.id.trusted_device_switch); in onViewCreated()
77 mSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> { in onViewCreated()
82 mSwitch.setChecked(false); in onViewCreated()
87 mSwitch.setChecked(true); in onViewCreated()
107 mSwitch.setChecked(false); in setTrustedDevices()
112 mSwitch.setChecked(false); in setTrustedDevices()
127 mSwitch.setChecked(true); in setTrustedDevices()
150 mSwitch.setChecked(false); in observeViewModel()
161 mSwitch.setChecked(true); in observeViewModel()
/packages/apps/LegacyCamera/src/com/android/camera/ui/
DInLineSettingSwitch.java33 private Switch mSwitch; field in InLineSettingSwitch
48 mSwitch = (Switch) findViewById(R.id.setting_switch); in onFinishInflate()
49 mSwitch.setOnCheckedChangeListener(mCheckedChangeListener); in onFinishInflate()
56 mSwitch.setContentDescription(getContext().getResources().getString( in initialize()
62 mSwitch.setOnCheckedChangeListener(null); in updateView()
64 mSwitch.setChecked(mIndex == 1); in updateView()
67 mSwitch.setChecked(index == 1); in updateView()
69 mSwitch.setOnCheckedChangeListener(mCheckedChangeListener); in updateView()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/biometrics/face/
DFaceEnrollAccessibilityToggle.java35 private Switch mSwitch; field in FaceEnrollAccessibilityToggle
61 mSwitch = findViewById(R.id.toggle); in FaceEnrollAccessibilityToggle()
62 mSwitch.setChecked(false); in FaceEnrollAccessibilityToggle()
66 return mSwitch.isChecked(); in isChecked()
70 mSwitch.setChecked(checked); in setChecked()
74 mSwitch.setOnCheckedChangeListener(listener); in setListener()
78 return mSwitch; in getSwitch()
/packages/apps/Settings/tests/robotests/src/com/android/settings/location/
DLocationSwitchBarControllerTest.java50 private ToggleSwitch mSwitch; field in LocationSwitchBarControllerTest
63 ReflectionHelpers.setField(mSwitchBar, "mSwitch", mSwitch); in setUp()
87 mController.onSwitchChanged(mSwitch, true); in onSwitchChanged_switchChecked_shouldSetLocationEnabled()
94 mController.onSwitchChanged(mSwitch, false); in onSwitchChanged_switchUnchecked_shouldSetLocationDisabled()
135 when(mSwitch.isChecked()).thenReturn(false); in onLocationModeChanged_locationOn_shouldCheckSwitch()
140 verify(mSwitch).setChecked(true); in onLocationModeChanged_locationOn_shouldCheckSwitch()
147 when(mSwitch.isChecked()).thenReturn(true); in onLocationModeChanged_locationOff_shouldUncheckSwitch()
151 verify(mSwitch).setChecked(false); in onLocationModeChanged_locationOff_shouldUncheckSwitch()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/gestures/
DPreventRingingSwitchPreferenceController.java45 SwitchBar mSwitch; field in PreventRingingSwitchPreferenceController
75 mSwitch = pref.findViewById(R.id.switch_bar); in displayPreference()
76 if (mSwitch != null) { in displayPreference()
77 mSwitch.addOnSwitchChangeListener(this); in displayPreference()
78 mSwitch.show(); in displayPreference()
85 if (mSwitch != null) { in setChecked()
86 mSwitch.setChecked(isChecked); in setChecked()
/packages/apps/Car/Settings/src/com/android/car/settings/common/
DMasterSwitchPreference.java43 private Switch mSwitch; field in MasterSwitchPreference
91 mSwitch = widgetFrame.findViewById(R.id.master_switch); in onBindWidgetFrame()
92 mSwitch.setChecked(mIsChecked); in onBindWidgetFrame()
93 mSwitch.setOnCheckedChangeListener(mCheckedChangeListener); in onBindWidgetFrame()
107 if (mSwitch != null) { in setSwitchChecked()
108 mSwitch.setChecked(checked); in setSwitchChecked()
/packages/apps/Settings/src/com/android/settings/gestures/
DPreventRingingSwitchPreferenceController.java45 SwitchBar mSwitch; field in PreventRingingSwitchPreferenceController
75 mSwitch = pref.findViewById(R.id.switch_bar); in displayPreference()
76 if (mSwitch != null) { in displayPreference()
77 mSwitch.addOnSwitchChangeListener(this); in displayPreference()
78 mSwitch.show(); in displayPreference()
85 if (mSwitch != null) { in setChecked()
86 mSwitch.setChecked(isChecked); in setChecked()
/packages/apps/Messaging/src/com/android/messaging/ui/debug/
DDebugMmsConfigItemView.java47 private Switch mSwitch; field in DebugMmsConfigItemView
61 mSwitch = (Switch) findViewById(R.id.switch_button); in onFinishInflate()
63 mSwitch.setOnCheckedChangeListener(this); in onFinishInflate()
75 mSwitch.setVisibility(View.VISIBLE); in bind()
77 mSwitch.setChecked(Boolean.valueOf(value)); in bind()
82 mSwitch.setVisibility(View.GONE); in bind()
87 mSwitch.setVisibility(View.GONE); in bind()
/packages/apps/Messaging/src/com/android/messaging/ui/conversationsettings/
DPeopleOptionsItemView.java46 private SwitchCompat mSwitch; field in PeopleOptionsItemView
59 mSwitch = (SwitchCompat) findViewById(R.id.switch_button); in onFinishInflate()
84 mSwitch.setVisibility(VISIBLE); in bind()
85 mSwitch.setChecked(mData.getChecked()); in bind()
87 mSwitch.setVisibility(GONE); in bind()
94 mSwitch.setEnabled(enabled); in bind()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/bluetooth/
DBluetoothSwitchPreferenceController.java45 private SwitchWidgetController mSwitch; field in BluetoothSwitchPreferenceController
59 mSwitch = switchController; in BluetoothSwitchPreferenceController()
63 mSwitch.setupView(); in BluetoothSwitchPreferenceController()
64 updateText(mSwitch.isChecked()); in BluetoothSwitchPreferenceController()
77 if (mSwitch != null) { in onStart()
78 updateText(mSwitch.isChecked()); in onStart()
/packages/apps/Settings/src/com/android/settings/bluetooth/
DBluetoothSwitchPreferenceController.java45 private SwitchWidgetController mSwitch; field in BluetoothSwitchPreferenceController
59 mSwitch = switchController; in BluetoothSwitchPreferenceController()
63 mSwitch.setupView(); in BluetoothSwitchPreferenceController()
64 updateText(mSwitch.isChecked()); in BluetoothSwitchPreferenceController()
77 if (mSwitch != null) { in onStart()
78 updateText(mSwitch.isChecked()); in onStart()
/packages/apps/Settings/src/com/android/settings/deviceinfo/storage/
DAutomaticStorageManagementSwitchPreferenceController.java46 private MasterSwitchPreference mSwitch; field in AutomaticStorageManagementSwitchPreferenceController
64 mSwitch = screen.findPreference(getPreferenceKey()); in displayPreference()
77 mSwitch.setChecked(Utils.isStorageManagerEnabled(mContext)); in onResume()
79 if (mSwitch != null) { in onResume()
80 mSwitchController = new MasterSwitchController(mSwitch); in onResume()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/deviceinfo/storage/
DAutomaticStorageManagementSwitchPreferenceController.java46 private MasterSwitchPreference mSwitch; field in AutomaticStorageManagementSwitchPreferenceController
64 mSwitch = screen.findPreference(getPreferenceKey()); in displayPreference()
77 mSwitch.setChecked(Utils.isStorageManagerEnabled(mContext)); in onResume()
79 if (mSwitch != null) { in onResume()
80 mSwitchController = new MasterSwitchController(mSwitch); in onResume()
/packages/apps/Settings/src/com/android/settings/applications/manageapplications/
DApplicationViewHolder.java50 final Switch mSwitch; field in ApplicationViewHolder
58 mSwitch = itemView.findViewById(R.id.switchWidget); in ApplicationViewHolder()
152 if (mSwitch != null && mWidgetContainer != null) { in updateSwitch()
154 mSwitch.setChecked(checked); in updateSwitch()
155 mSwitch.setEnabled(enabled); in updateSwitch()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/applications/manageapplications/
DApplicationViewHolder.java50 final Switch mSwitch; field in ApplicationViewHolder
58 mSwitch = itemView.findViewById(R.id.switchWidget); in ApplicationViewHolder()
152 if (mSwitch != null && mWidgetContainer != null) { in updateSwitch()
154 mSwitch.setChecked(checked); in updateSwitch()
155 mSwitch.setEnabled(enabled); in updateSwitch()

12