Volume UI updates
- redline compliance - a11y labeling - hide setting icon if device isn't provisioned Change-Id: I62e0da51879dc5f6e05ed814f2d9b6ee41e125a1 Fixes: 74152268 Fixes: 73963013 Fixes: 73902271 Test: manual inspection
This commit is contained in:
@@ -1318,6 +1318,9 @@ easier.
|
||||
<!-- Progress bar attributes -->
|
||||
<item name="colorProgressBackgroundNormal">@color/config_progress_background_tint</item>
|
||||
<item name="progressBarCornerRadius">@dimen/config_progressBarCornerRadius</item>
|
||||
|
||||
<!-- volume background -->
|
||||
<item name="panelColorBackground">@color/primary_material_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.DeviceDefault.QuickSettings.Dialog" parent="Theme.DeviceDefault.Light.Dialog">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@*android:color/material_grey_200" />
|
||||
<solid android:color="?android:attr/panelColorBackground" />
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/corner_size"
|
||||
android:topLeftRadius="0dp"
|
||||
|
||||
@@ -73,17 +73,19 @@
|
||||
<!-- volume rows added and removed here! :-) -->
|
||||
</LinearLayout>
|
||||
<FrameLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/settings_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rounded_bg_bottom_background">
|
||||
<com.android.keyguard.AlphaOptimizedImageButton
|
||||
android:id="@+id/settings"
|
||||
android:src="@drawable/ic_settings"
|
||||
android:src="@drawable/ic_settings_16dp"
|
||||
android:layout_width="@dimen/volume_dialog_tap_target_size"
|
||||
android:layout_height="@dimen/volume_dialog_tap_target_size"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/accessibility_volume_settings"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:tint="#8A000000"
|
||||
android:tint="?android:attr/colorControlNormal"
|
||||
android:soundEffectsEnabled="false" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/volume_dialog_slider_margin_top"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical" >
|
||||
@@ -42,6 +41,8 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/volume_row_slider_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/volume_dialog_slider_margin_top"
|
||||
android:layout_marginBottom="@dimen/volume_dialog_slider_margin_bottom"
|
||||
android:layoutDirection="rtl"
|
||||
android:layout_height="@dimen/volume_dialog_slider_height">
|
||||
<SeekBar
|
||||
@@ -60,6 +61,7 @@
|
||||
android:layout_width="@dimen/volume_dialog_tap_target_size"
|
||||
android:layout_height="@dimen/volume_dialog_tap_target_size"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:layout_marginBottom="@dimen/volume_dialog_row_margin_bottom"
|
||||
android:tint="@color/accent_tint_color_selector"
|
||||
android:soundEffectsEnabled="false" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
|
||||
<dimen name="volume_dialog_panel_width">64dp</dimen>
|
||||
|
||||
<dimen name="volume_dialog_slider_height">101dp</dimen>
|
||||
<dimen name="volume_dialog_slider_height">108dp</dimen>
|
||||
|
||||
<dimen name="volume_dialog_row_height">252dp</dimen>
|
||||
|
||||
@@ -280,7 +280,13 @@
|
||||
|
||||
<dimen name="volume_dialog_spacer">4dp</dimen>
|
||||
|
||||
<dimen name="volume_dialog_slider_margin_top">13dp</dimen>
|
||||
<dimen name="volume_dialog_slider_margin_top">22dp</dimen>
|
||||
|
||||
<dimen name="volume_dialog_slider_margin_bottom">-2dp</dimen>
|
||||
|
||||
<dimen name="volume_dialog_row_margin_bottom">8dp</dimen>
|
||||
|
||||
<dimen name="volume_dialog_settings_icon_size">16dp</dimen>
|
||||
|
||||
<!-- Gravity for the notification panel -->
|
||||
<integer name="notification_panel_layout_gravity">0x31</integer><!-- center_horizontal|top -->
|
||||
|
||||
@@ -1268,6 +1268,9 @@
|
||||
<!-- Button label for ending zen mode in the volume dialog -->
|
||||
<string name="volume_zen_end_now">Turn off now</string>
|
||||
|
||||
<!-- Content description for accessibility (not shown on the screen): volume dialog settings button. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_volume_settings">Sound settings</string>
|
||||
|
||||
<!-- Content description for accessibility (not shown on the screen): volume dialog expand button. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_volume_expand">Expand</string>
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ import static android.media.AudioManager.RINGER_MODE_NORMAL;
|
||||
import static android.media.AudioManager.RINGER_MODE_SILENT;
|
||||
import static android.media.AudioManager.RINGER_MODE_VIBRATE;
|
||||
import static android.media.AudioManager.STREAM_ACCESSIBILITY;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import static com.android.systemui.volume.Events.DISMISS_REASON_SETTINGS_CLICKED;
|
||||
|
||||
@@ -81,6 +83,7 @@ import com.android.systemui.plugins.VolumeDialogController;
|
||||
import com.android.systemui.plugins.VolumeDialogController.State;
|
||||
import com.android.systemui.plugins.VolumeDialogController.StreamState;
|
||||
import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
@@ -102,6 +105,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
private final Context mContext;
|
||||
private final H mHandler = new H();
|
||||
private final VolumeDialogController mController;
|
||||
private final DeviceProvisionedController mDeviceProvisionedController;
|
||||
|
||||
private Window mWindow;
|
||||
private CustomDialog mDialog;
|
||||
@@ -109,6 +113,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
private ViewGroup mDialogRowsView;
|
||||
private ViewGroup mRinger;
|
||||
private ImageButton mRingerIcon;
|
||||
private View mSettingsView;
|
||||
private ImageButton mSettingsIcon;
|
||||
private ImageView mZenIcon;
|
||||
private final List<VolumeRow> mRows = new ArrayList<>();
|
||||
@@ -139,6 +144,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
mAccessibilityMgr = Dependency.get(AccessibilityManagerWrapper.class);
|
||||
mActiveSliderTint = ColorStateList.valueOf(Utils.getColorAccent(mContext));
|
||||
mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive);
|
||||
mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class);
|
||||
}
|
||||
|
||||
public void init(int windowType, Callback callback) {
|
||||
@@ -212,6 +218,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
mRinger = mDialog.findViewById(R.id.ringer);
|
||||
mRingerIcon = mRinger.findViewById(R.id.ringer_icon);
|
||||
mZenIcon = mRinger.findViewById(R.id.dnd_icon);
|
||||
mSettingsView = mDialog.findViewById(R.id.settings_container);
|
||||
mSettingsIcon = mDialog.findViewById(R.id.settings);
|
||||
|
||||
if (mRows.isEmpty()) {
|
||||
@@ -387,6 +394,8 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
}
|
||||
|
||||
public void initSettingsH() {
|
||||
mSettingsView.setVisibility(
|
||||
mDeviceProvisionedController.isDeviceProvisioned() ? VISIBLE : GONE);
|
||||
mSettingsIcon.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Settings.ACTION_SOUND_SETTINGS);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -607,7 +616,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
* @param enable whether to enable volume row views and hide dnd icon
|
||||
*/
|
||||
private void enableVolumeRowViewsH(VolumeRow row, boolean enable) {
|
||||
row.dndIcon.setVisibility(enable ? View.GONE : View.VISIBLE);
|
||||
row.dndIcon.setVisibility(enable ? GONE : VISIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,7 +626,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
*/
|
||||
private void enableRingerViewsH(boolean enable) {
|
||||
mRingerIcon.setEnabled(enable);
|
||||
mZenIcon.setVisibility(enable ? View.GONE : View.VISIBLE);
|
||||
mZenIcon.setVisibility(enable ? GONE : VISIBLE);
|
||||
}
|
||||
|
||||
private void trimObsoleteH() {
|
||||
@@ -797,7 +806,7 @@ public class VolumeDialogImpl implements VolumeDialog {
|
||||
}
|
||||
final int progress = row.slider.getProgress();
|
||||
final int level = getImpliedLevel(row.slider, progress);
|
||||
final boolean rowVisible = row.view.getVisibility() == View.VISIBLE;
|
||||
final boolean rowVisible = row.view.getVisibility() == VISIBLE;
|
||||
final boolean inGracePeriod = (SystemClock.uptimeMillis() - row.userAttempt)
|
||||
< USER_ATTEMPT_GRACE_PERIOD;
|
||||
mHandler.removeMessages(H.RECHECK, row);
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<item name="android:colorAccent">@*android:color/accent_device_default_dark</item>
|
||||
<item name="android:colorControlNormal">?android:attr/textColorPrimary</item>
|
||||
<item name="android:colorBackgroundFloating">@*android:color/material_grey_900</item>
|
||||
<item name="android:panelColorBackground">@*android:color/material_grey_800</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user