Loading packages/SystemUI/res/color/accent_tint_color_selector.xml 0 → 100644 +21 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="?android:attr/colorButtonNormal"/> <item android:color="?android:attr/colorAccent"/> </selector> No newline at end of file packages/SystemUI/res/layout/volume_dialog.xml +43 −38 Original line number Diff line number Diff line Loading @@ -38,24 +38,27 @@ android:layout_height="wrap_content" android:clipChildren="false" android:clipToPadding="false" android:paddingTop="10dp" android:paddingBottom="10dp" android:background="@drawable/rounded_bg_full" android:translationZ="@dimen/volume_panel_elevation" android:orientation="horizontal" > <!-- volume rows added and removed here! :-) --> </LinearLayout> <LinearLayout <FrameLayout android:id="@+id/footer" android:layout_width="@dimen/volume_dialog_panel_width" android:layout_height="@dimen/volume_dialog_panel_width" android:clipChildren="false" android:clipToPadding="false" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:layout_below="@id/volume_dialog_rows" android:background="@drawable/rounded_bg_full" android:background="@drawable/rounded_bg_full"> <LinearLayout android:id="@+id/footer_linear_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false" android:gravity="center" android:layout_gravity="end" android:translationZ="@dimen/volume_panel_elevation" Loading @@ -79,7 +82,7 @@ android:background="?android:selectableItemBackgroundBorderless" android:layout_width="@dimen/volume_dialog_panel_width" android:layout_height="@dimen/volume_button_size" android:tint="?android:attr/colorAccent" android:tint="@color/accent_tint_color_selector" android:soundEffectsEnabled="false" /> <TextView Loading @@ -90,7 +93,9 @@ android:maxLines="1" android:textColor="?android:attr/colorControlNormal" android:textAppearance="@style/TextAppearance.Volume.Header.Secondary" /> </LinearLayout> <include layout="@layout/volume_dnd_icon"/> </FrameLayout> </LinearLayout> </com.android.systemui.volume.VolumeUiLayout> No newline at end of file packages/SystemUI/res/layout/volume_dialog_row.xml +70 −61 Original line number Diff line number Diff line Loading @@ -13,14 +13,20 @@ See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:tag="row" android:layout_height="wrap_content" android:layout_width="@dimen/volume_dialog_panel_width" android:clipChildren="true" android:clipToPadding="true" android:theme="@style/qs_theme" android:theme="@style/qs_theme"> <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:gravity="center" android:orientation="vertical" > Loading Loading @@ -97,5 +103,8 @@ android:layout_height="@dimen/volume_button_size" android:background="?android:selectableItemBackgroundBorderless" android:soundEffectsEnabled="false" /> </LinearLayout> <include layout="@layout/volume_dnd_icon"/> </FrameLayout> packages/SystemUI/res/layout/volume_dnd_icon.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="14dp" android:layout_height="14dp" android:layout_marginTop="6dp" android:layout_marginRight="6dp" android:layout_gravity="right|top"> <ImageView android:id="@+id/dnd_icon" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/ic_dnd" android:tint="?android:attr/textColorTertiary"/> </FrameLayout> packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +32 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener; import android.view.animation.DecelerateInterpolator; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; Loading Loading @@ -109,7 +110,9 @@ public class VolumeDialogImpl implements VolumeDialog { private ViewGroup mDialogRowsView; private ViewGroup mFooter; private ImageButton mRingerIcon; private ImageView mZenIcon; private TextView mRingerStatus; private TextView mRingerTitle; private final List<VolumeRow> mRows = new ArrayList<>(); private ConfigurableTexts mConfigurableTexts; private final SparseBooleanArray mDynamic = new SparseBooleanArray(); Loading Loading @@ -216,6 +219,8 @@ public class VolumeDialogImpl implements VolumeDialog { mFooter = mDialog.findViewById(R.id.footer); mRingerIcon = mFooter.findViewById(R.id.ringer_icon); mRingerStatus = mFooter.findViewById(R.id.ringer_status); mRingerTitle = mFooter.findViewById(R.id.ringer_title); mZenIcon = mFooter.findViewById(R.id.dnd_icon); if (mRows.isEmpty()) { addRow(AudioManager.STREAM_MUSIC, Loading Loading @@ -349,6 +354,7 @@ public class VolumeDialogImpl implements VolumeDialog { if (stream == STREAM_ACCESSIBILITY) { row.header.setFilters(new InputFilter[] {new InputFilter.LengthFilter(13)}); } row.dndIcon = row.view.findViewById(R.id.dnd_icon); row.slider = row.view.findViewById(R.id.volume_row_slider); row.slider.setOnSeekBarChangeListener(new VolumeSeekBarChangeListener(row)); row.anim = null; Loading Loading @@ -559,6 +565,8 @@ public class VolumeDialogImpl implements VolumeDialog { if (ss == null) { return; } enableRingerViewsH(mState.zenMode == Global.ZEN_MODE_OFF || !mState.disallowRinger); switch (mState.ringerModeInternal) { case AudioManager.RINGER_MODE_VIBRATE: mRingerStatus.setText(R.string.volume_ringer_status_vibrate); Loading Loading @@ -603,6 +611,28 @@ public class VolumeDialogImpl implements VolumeDialog { } } /** * Toggles enable state of views in a VolumeRow (not including seekbar, outputChooser or icon) * Hides/shows zen icon * @param enable whether to enable volume row views and hide dnd icon */ private void enableVolumeRowViewsH(VolumeRow row, boolean enable) { row.header.setEnabled(enable); row.dndIcon.setVisibility(enable ? View.GONE : View.VISIBLE); } /** * Toggles enable state of footer/ringer views * Hides/shows zen icon * @param enable whether to enable ringer views and hide dnd icon */ private void enableRingerViewsH(boolean enable) { mRingerTitle.setEnabled(enable); mRingerStatus.setEnabled(enable); mRingerIcon.setEnabled(enable); mZenIcon.setVisibility(enable ? View.GONE : View.VISIBLE); } private void trimObsoleteH() { if (D.BUG) Log.d(TAG, "trimObsoleteH"); for (int i = mRows.size() - 1; i >= 0; i--) { Loading Loading @@ -748,6 +778,7 @@ public class VolumeDialogImpl implements VolumeDialog { if (zenMuted) { row.tracking = false; } enableVolumeRowViewsH(row, !zenMuted); // update slider final boolean enableSlider = !zenMuted; Loading Loading @@ -1178,5 +1209,6 @@ public class VolumeDialogImpl implements VolumeDialog { private int lastAudibleLevel = 1; private View outputChooser; private TextView connectedDevice; private ImageView dndIcon; } } Loading
packages/SystemUI/res/color/accent_tint_color_selector.xml 0 → 100644 +21 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="?android:attr/colorButtonNormal"/> <item android:color="?android:attr/colorAccent"/> </selector> No newline at end of file
packages/SystemUI/res/layout/volume_dialog.xml +43 −38 Original line number Diff line number Diff line Loading @@ -38,24 +38,27 @@ android:layout_height="wrap_content" android:clipChildren="false" android:clipToPadding="false" android:paddingTop="10dp" android:paddingBottom="10dp" android:background="@drawable/rounded_bg_full" android:translationZ="@dimen/volume_panel_elevation" android:orientation="horizontal" > <!-- volume rows added and removed here! :-) --> </LinearLayout> <LinearLayout <FrameLayout android:id="@+id/footer" android:layout_width="@dimen/volume_dialog_panel_width" android:layout_height="@dimen/volume_dialog_panel_width" android:clipChildren="false" android:clipToPadding="false" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:layout_below="@id/volume_dialog_rows" android:background="@drawable/rounded_bg_full" android:background="@drawable/rounded_bg_full"> <LinearLayout android:id="@+id/footer_linear_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false" android:gravity="center" android:layout_gravity="end" android:translationZ="@dimen/volume_panel_elevation" Loading @@ -79,7 +82,7 @@ android:background="?android:selectableItemBackgroundBorderless" android:layout_width="@dimen/volume_dialog_panel_width" android:layout_height="@dimen/volume_button_size" android:tint="?android:attr/colorAccent" android:tint="@color/accent_tint_color_selector" android:soundEffectsEnabled="false" /> <TextView Loading @@ -90,7 +93,9 @@ android:maxLines="1" android:textColor="?android:attr/colorControlNormal" android:textAppearance="@style/TextAppearance.Volume.Header.Secondary" /> </LinearLayout> <include layout="@layout/volume_dnd_icon"/> </FrameLayout> </LinearLayout> </com.android.systemui.volume.VolumeUiLayout> No newline at end of file
packages/SystemUI/res/layout/volume_dialog_row.xml +70 −61 Original line number Diff line number Diff line Loading @@ -13,14 +13,20 @@ See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:tag="row" android:layout_height="wrap_content" android:layout_width="@dimen/volume_dialog_panel_width" android:clipChildren="true" android:clipToPadding="true" android:theme="@style/qs_theme" android:theme="@style/qs_theme"> <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:gravity="center" android:orientation="vertical" > Loading Loading @@ -97,5 +103,8 @@ android:layout_height="@dimen/volume_button_size" android:background="?android:selectableItemBackgroundBorderless" android:soundEffectsEnabled="false" /> </LinearLayout> <include layout="@layout/volume_dnd_icon"/> </FrameLayout>
packages/SystemUI/res/layout/volume_dnd_icon.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="14dp" android:layout_height="14dp" android:layout_marginTop="6dp" android:layout_marginRight="6dp" android:layout_gravity="right|top"> <ImageView android:id="@+id/dnd_icon" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/ic_dnd" android:tint="?android:attr/textColorTertiary"/> </FrameLayout>
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +32 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener; import android.view.animation.DecelerateInterpolator; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; Loading Loading @@ -109,7 +110,9 @@ public class VolumeDialogImpl implements VolumeDialog { private ViewGroup mDialogRowsView; private ViewGroup mFooter; private ImageButton mRingerIcon; private ImageView mZenIcon; private TextView mRingerStatus; private TextView mRingerTitle; private final List<VolumeRow> mRows = new ArrayList<>(); private ConfigurableTexts mConfigurableTexts; private final SparseBooleanArray mDynamic = new SparseBooleanArray(); Loading Loading @@ -216,6 +219,8 @@ public class VolumeDialogImpl implements VolumeDialog { mFooter = mDialog.findViewById(R.id.footer); mRingerIcon = mFooter.findViewById(R.id.ringer_icon); mRingerStatus = mFooter.findViewById(R.id.ringer_status); mRingerTitle = mFooter.findViewById(R.id.ringer_title); mZenIcon = mFooter.findViewById(R.id.dnd_icon); if (mRows.isEmpty()) { addRow(AudioManager.STREAM_MUSIC, Loading Loading @@ -349,6 +354,7 @@ public class VolumeDialogImpl implements VolumeDialog { if (stream == STREAM_ACCESSIBILITY) { row.header.setFilters(new InputFilter[] {new InputFilter.LengthFilter(13)}); } row.dndIcon = row.view.findViewById(R.id.dnd_icon); row.slider = row.view.findViewById(R.id.volume_row_slider); row.slider.setOnSeekBarChangeListener(new VolumeSeekBarChangeListener(row)); row.anim = null; Loading Loading @@ -559,6 +565,8 @@ public class VolumeDialogImpl implements VolumeDialog { if (ss == null) { return; } enableRingerViewsH(mState.zenMode == Global.ZEN_MODE_OFF || !mState.disallowRinger); switch (mState.ringerModeInternal) { case AudioManager.RINGER_MODE_VIBRATE: mRingerStatus.setText(R.string.volume_ringer_status_vibrate); Loading Loading @@ -603,6 +611,28 @@ public class VolumeDialogImpl implements VolumeDialog { } } /** * Toggles enable state of views in a VolumeRow (not including seekbar, outputChooser or icon) * Hides/shows zen icon * @param enable whether to enable volume row views and hide dnd icon */ private void enableVolumeRowViewsH(VolumeRow row, boolean enable) { row.header.setEnabled(enable); row.dndIcon.setVisibility(enable ? View.GONE : View.VISIBLE); } /** * Toggles enable state of footer/ringer views * Hides/shows zen icon * @param enable whether to enable ringer views and hide dnd icon */ private void enableRingerViewsH(boolean enable) { mRingerTitle.setEnabled(enable); mRingerStatus.setEnabled(enable); mRingerIcon.setEnabled(enable); mZenIcon.setVisibility(enable ? View.GONE : View.VISIBLE); } private void trimObsoleteH() { if (D.BUG) Log.d(TAG, "trimObsoleteH"); for (int i = mRows.size() - 1; i >= 0; i--) { Loading Loading @@ -748,6 +778,7 @@ public class VolumeDialogImpl implements VolumeDialog { if (zenMuted) { row.tracking = false; } enableVolumeRowViewsH(row, !zenMuted); // update slider final boolean enableSlider = !zenMuted; Loading Loading @@ -1178,5 +1209,6 @@ public class VolumeDialogImpl implements VolumeDialog { private int lastAudibleLevel = 1; private View outputChooser; private TextView connectedDevice; private ImageView dndIcon; } }