Loading packages/SystemUI/res/layout/screen_record_options.xml +29 −16 Original line number Diff line number Diff line Loading @@ -40,16 +40,22 @@ android:popupBackground="@drawable/screenrecord_spinner_background" android:dropDownWidth="274dp" android:importantForAccessibility="yes"/> <FrameLayout android:id="@+id/screenrecord_audio_switch_container" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Switch android:layout_width="wrap_content" android:minWidth="48dp" android:layout_height="48dp" android:layout_weight="0" android:layout_gravity="end" android:focusable="false" android:clickable="false" android:id="@+id/screenrecord_audio_switch" android:contentDescription="@string/screenrecord_audio_label" style="@style/ScreenRecord.Switch" android:importantForAccessibility="yes"/> </FrameLayout> </LinearLayout> <LinearLayout android:id="@+id/show_taps" Loading @@ -75,13 +81,20 @@ android:fontFamily="@*android:string/config_bodyFontFamily" android:textColor="?android:attr/textColorPrimary" android:contentDescription="@string/screenrecord_taps_label"/> <FrameLayout android:id="@+id/screenrecord_taps_switch_container" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Switch android:layout_width="wrap_content" android:minWidth="48dp" android:layout_height="48dp" android:focusable="false" android:clickable="false" android:id="@+id/screenrecord_taps_switch" android:contentDescription="@string/screenrecord_taps_label" style="@style/ScreenRecord.Switch" android:importantForAccessibility="yes"/> </FrameLayout> </LinearLayout> </LinearLayout> No newline at end of file packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt +10 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.MotionEvent.ACTION_MOVE import android.view.View import android.view.View.GONE import android.view.View.VISIBLE import android.view.ViewGroup import android.view.accessibility.AccessibilityNodeInfo import android.widget.AdapterView import android.widget.ArrayAdapter Loading Loading @@ -64,10 +65,13 @@ class ScreenRecordPermissionDialogDelegate( mediaProjectionMetricsLogger, R.drawable.ic_screenrecord, R.color.screenrecord_icon_color ), SystemUIDialog.Delegate { ), SystemUIDialog.Delegate { private lateinit var tapsSwitch: Switch private lateinit var tapsSwitchContainer: ViewGroup private lateinit var tapsView: View private lateinit var audioSwitch: Switch private lateinit var audioSwitchContainer: ViewGroup private lateinit var options: Spinner override fun createDialog(): SystemUIDialog { Loading Loading @@ -114,12 +118,17 @@ class ScreenRecordPermissionDialogDelegate( private fun initRecordOptionsView() { audioSwitch = dialog.requireViewById(R.id.screenrecord_audio_switch) tapsSwitch = dialog.requireViewById(R.id.screenrecord_taps_switch) audioSwitchContainer = dialog.requireViewById(R.id.screenrecord_audio_switch_container) tapsSwitchContainer = dialog.requireViewById(R.id.screenrecord_taps_switch_container) // Add these listeners so that the switch only responds to movement // within its target region, to meet accessibility requirements audioSwitch.setOnTouchListener { _, event -> event.action == ACTION_MOVE } tapsSwitch.setOnTouchListener { _, event -> event.action == ACTION_MOVE } audioSwitchContainer.setOnClickListener { audioSwitch.toggle() } tapsSwitchContainer.setOnClickListener { tapsSwitch.toggle() } tapsView = dialog.requireViewById(R.id.show_taps) updateTapsViewVisibility() Loading Loading
packages/SystemUI/res/layout/screen_record_options.xml +29 −16 Original line number Diff line number Diff line Loading @@ -40,16 +40,22 @@ android:popupBackground="@drawable/screenrecord_spinner_background" android:dropDownWidth="274dp" android:importantForAccessibility="yes"/> <FrameLayout android:id="@+id/screenrecord_audio_switch_container" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Switch android:layout_width="wrap_content" android:minWidth="48dp" android:layout_height="48dp" android:layout_weight="0" android:layout_gravity="end" android:focusable="false" android:clickable="false" android:id="@+id/screenrecord_audio_switch" android:contentDescription="@string/screenrecord_audio_label" style="@style/ScreenRecord.Switch" android:importantForAccessibility="yes"/> </FrameLayout> </LinearLayout> <LinearLayout android:id="@+id/show_taps" Loading @@ -75,13 +81,20 @@ android:fontFamily="@*android:string/config_bodyFontFamily" android:textColor="?android:attr/textColorPrimary" android:contentDescription="@string/screenrecord_taps_label"/> <FrameLayout android:id="@+id/screenrecord_taps_switch_container" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Switch android:layout_width="wrap_content" android:minWidth="48dp" android:layout_height="48dp" android:focusable="false" android:clickable="false" android:id="@+id/screenrecord_taps_switch" android:contentDescription="@string/screenrecord_taps_label" style="@style/ScreenRecord.Switch" android:importantForAccessibility="yes"/> </FrameLayout> </LinearLayout> </LinearLayout> No newline at end of file
packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt +10 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.MotionEvent.ACTION_MOVE import android.view.View import android.view.View.GONE import android.view.View.VISIBLE import android.view.ViewGroup import android.view.accessibility.AccessibilityNodeInfo import android.widget.AdapterView import android.widget.ArrayAdapter Loading Loading @@ -64,10 +65,13 @@ class ScreenRecordPermissionDialogDelegate( mediaProjectionMetricsLogger, R.drawable.ic_screenrecord, R.color.screenrecord_icon_color ), SystemUIDialog.Delegate { ), SystemUIDialog.Delegate { private lateinit var tapsSwitch: Switch private lateinit var tapsSwitchContainer: ViewGroup private lateinit var tapsView: View private lateinit var audioSwitch: Switch private lateinit var audioSwitchContainer: ViewGroup private lateinit var options: Spinner override fun createDialog(): SystemUIDialog { Loading Loading @@ -114,12 +118,17 @@ class ScreenRecordPermissionDialogDelegate( private fun initRecordOptionsView() { audioSwitch = dialog.requireViewById(R.id.screenrecord_audio_switch) tapsSwitch = dialog.requireViewById(R.id.screenrecord_taps_switch) audioSwitchContainer = dialog.requireViewById(R.id.screenrecord_audio_switch_container) tapsSwitchContainer = dialog.requireViewById(R.id.screenrecord_taps_switch_container) // Add these listeners so that the switch only responds to movement // within its target region, to meet accessibility requirements audioSwitch.setOnTouchListener { _, event -> event.action == ACTION_MOVE } tapsSwitch.setOnTouchListener { _, event -> event.action == ACTION_MOVE } audioSwitchContainer.setOnClickListener { audioSwitch.toggle() } tapsSwitchContainer.setOnClickListener { tapsSwitch.toggle() } tapsView = dialog.requireViewById(R.id.show_taps) updateTapsViewVisibility() Loading