Merge "[Physical Keyboard] Update seekbars" into main
This commit is contained in:
@@ -122,20 +122,38 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/input_setting_keys_custom_seekbar_layout"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingEnd="36dp">
|
||||
<ImageView
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:tint="@androidprv:color/materialColorPrimary"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_remove_24dp" />
|
||||
<SeekBar
|
||||
android:id="@+id/input_setting_keys_value_custom_slider"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="36dp"
|
||||
style="@android:style/Widget.Material.SeekBar"
|
||||
android:min="1"
|
||||
android:max="50"
|
||||
android:progressBackgroundTint="@color/input_dialog_slider_progress_background"
|
||||
android:progressTint="@color/input_dialog_slider_progress"
|
||||
android:thumbTint="@color/input_dialog_slider_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="8dp" />
|
||||
<ImageView
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone"/>
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:tint="@androidprv:color/materialColorPrimary"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_add_24dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RadioGroup>
|
||||
|
@@ -94,8 +94,5 @@
|
||||
<!-- Volume seekbar colors -->
|
||||
<color name="seekbar_thumb_tint_color">@android:color/system_accent1_100</color>
|
||||
<color name="seekbar_progress_tint_color">@android:color/system_accent1_100</color>
|
||||
|
||||
<!-- Keyboard a11y input dialog -->
|
||||
<color name="input_dialog_slider_progress">@android:color/system_on_primary_container_dark</color>
|
||||
</resources>
|
||||
|
||||
|
@@ -275,8 +275,4 @@
|
||||
<color name="seekbar_thumb_tint_color">@android:color/system_accent1_800</color>
|
||||
<color name="seekbar_progress_tint_color">@android:color/system_accent1_800</color>
|
||||
<color name="seekbar_progress_background_tint_color">@android:color/system_neutral2_50</color>
|
||||
|
||||
<!-- Keyboard a11y input dialog -->
|
||||
<color name="input_dialog_slider_progress">@android:color/system_on_primary_dark</color>
|
||||
<color name="input_dialog_slider_progress_background">@android:color/system_outline_light</color>
|
||||
</resources>
|
||||
|
@@ -27,7 +27,7 @@
|
||||
android:order="10"
|
||||
settings:controller="com.android.settings.inputmethod.MousePointerAccelerationPreferenceController" />
|
||||
|
||||
<com.android.settings.widget.SeekBarPreference
|
||||
<com.android.settings.widget.LabeledSeekBarPreference
|
||||
android:key="pointer_speed"
|
||||
android:title="@string/pointer_speed"
|
||||
android:order="20"
|
||||
@@ -50,12 +50,6 @@
|
||||
android:summary="@string/accessibility_pointer_and_touchpad_summary"
|
||||
settings:searchable="true"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="pointer_category"
|
||||
android:persistent="false"
|
||||
android:order="51"
|
||||
android:title="@string/mouse_scrolling_category_title">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="mouse_reverse_vertical_scrolling"
|
||||
android:order="52"
|
||||
@@ -69,13 +63,11 @@
|
||||
android:title="@string/mouse_scrolling_acceleration"
|
||||
settings:controller="com.android.settings.inputmethod.MouseScrollingAccelerationPreferenceController" />
|
||||
|
||||
<com.android.settings.widget.SeekBarPreference
|
||||
<com.android.settings.widget.LabeledSeekBarPreference
|
||||
android:key="mouse_scrolling_speed"
|
||||
android:title="@string/mouse_scrolling_speed"
|
||||
android:order="60"
|
||||
android:selectable="false"
|
||||
settings:controller="com.android.settings.inputmethod.MouseScrollingSpeedPreferenceController"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
@@ -61,7 +61,7 @@
|
||||
settings:controller="com.android.settings.inputmethod.TouchpadAccelerationPreferenceController"
|
||||
android:order="38"/>
|
||||
|
||||
<com.android.settings.widget.SeekBarPreference
|
||||
<com.android.settings.widget.LabeledSeekBarPreference
|
||||
android:key="touchpad_pointer_speed"
|
||||
android:title="@string/trackpad_pointer_speed"
|
||||
android:order="40"
|
||||
|
@@ -122,6 +122,8 @@ public abstract class KeyboardAccessibilityKeysDialogFragment extends DialogFrag
|
||||
R.id.input_setting_keys_value_custom);
|
||||
TextView customValueTextView = accessibilityKeyDialog.findViewById(
|
||||
R.id.input_setting_keys_value_custom_value);
|
||||
View seekbarView = accessibilityKeyDialog.findViewById(
|
||||
R.id.input_setting_keys_custom_seekbar_layout);
|
||||
SeekBar customProgressBar = accessibilityKeyDialog.findViewById(
|
||||
R.id.input_setting_keys_value_custom_slider);
|
||||
TextView titleTextView = accessibilityKeyDialog.findViewById(
|
||||
@@ -147,7 +149,7 @@ public abstract class KeyboardAccessibilityKeysDialogFragment extends DialogFrag
|
||||
customValueTextView.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
customValueTextView.setText(
|
||||
progressToThresholdInSecond(customProgressBar.getProgress()));
|
||||
customProgressBar.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
seekbarView.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
buttonView.setChecked(isChecked);
|
||||
});
|
||||
cannedValueRadioGroup.setOnCheckedChangeListener(
|
||||
@@ -174,14 +176,14 @@ public abstract class KeyboardAccessibilityKeysDialogFragment extends DialogFrag
|
||||
// setting
|
||||
initStateBasedOnThreshold(cannedValueRadioGroup, customRadioButton,
|
||||
customValueTextView,
|
||||
customProgressBar);
|
||||
customProgressBar, seekbarView);
|
||||
} else if (customRadioButton.isChecked()) {
|
||||
cannedValueRadioGroup.clearCheck();
|
||||
customRadioButton.setChecked(true);
|
||||
customValueTextView.setVisibility(View.VISIBLE);
|
||||
customValueTextView.setText(
|
||||
progressToThresholdInSecond(customProgressBar.getProgress()));
|
||||
customProgressBar.setVisibility(View.VISIBLE);
|
||||
seekbarView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -199,7 +201,7 @@ public abstract class KeyboardAccessibilityKeysDialogFragment extends DialogFrag
|
||||
|
||||
private void initStateBasedOnThreshold(RadioGroup cannedValueRadioGroup,
|
||||
RadioButton customRadioButton, TextView customValueTextView,
|
||||
SeekBar customProgressBar) {
|
||||
SeekBar customProgressBar, View seekbarView) {
|
||||
int inputSettingKeysThreshold = getInputSettingKeysValue();
|
||||
switch (inputSettingKeysThreshold) {
|
||||
case 600 -> cannedValueRadioGroup.check(R.id.input_setting_keys_value_600);
|
||||
@@ -213,5 +215,6 @@ public abstract class KeyboardAccessibilityKeysDialogFragment extends DialogFrag
|
||||
customRadioButton.setChecked(true);
|
||||
}
|
||||
}
|
||||
seekbarView.setVisibility(customRadioButton.isChecked() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user