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