Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 296a49c9 authored by Galia Peycheva's avatar Galia Peycheva
Browse files

Update volume control ui for tv

As part of this we introduce a new theme "volume_dialog_theme", which
in the general case is the same as the previously used "qs_theme". Just
for TVs we override the accentColor.

Before: https://hsv.googleplex.com/5706562045739008
After: https://hsv.googleplex.com/5373850558660608

Bug: 162302410
Test: flash on atv device && press +/- on remote
Change-Id: I1151746cf417effbb300c0c11a26b8f75e9d8fb2
parent eb1ec3af
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

  <solid android:color="@color/tv_volume_dialog_background" />
  <corners android:radius="@dimen/tv_volume_dialog_corner_radius"/>

</shape>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
  <solid android:color="@color/tv_volume_dialog_circle" />

</shape>
+4 −6
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:color/transparent"
    android:theme="@style/qs_theme">
    android:theme="@style/volume_dialog_theme">

    <FrameLayout
        android:id="@+id/volume_dialog"
@@ -46,7 +46,7 @@
            android:translationZ="@dimen/volume_dialog_elevation"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:background="@drawable/rounded_bg_full">
            android:background="@drawable/tv_volume_dialog_background">

            <LinearLayout
                android:id="@+id/volume_dialog_rows"
@@ -54,9 +54,7 @@
                android:layout_height="wrap_content"
                android:minWidth="@dimen/volume_dialog_panel_width"
                android:gravity="center"
                android:orientation="horizontal"
                android:paddingRight="@dimen/volume_dialog_stream_padding"
                android:paddingLeft="@dimen/volume_dialog_stream_padding">
                android:orientation="horizontal">
                <!-- volume rows added and removed here! :-) -->
            </LinearLayout>

+5 −2
Original line number Diff line number Diff line
@@ -21,11 +21,12 @@
    android:background="@android:color/transparent"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:theme="@style/qs_theme">
    android:theme="@style/volume_dialog_theme">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:padding="@dimen/tv_volume_dialog_row_padding"
        android:background="@android:color/transparent"
        android:gravity="center"
        android:layout_gravity="center"
@@ -35,7 +36,7 @@
            style="@style/VolumeButtons"
            android:layout_width="@dimen/tv_volume_dialog_bubble_size"
            android:layout_height="@dimen/tv_volume_dialog_bubble_size"
            android:background="@drawable/ripple_drawable_20dp"
            android:background="@drawable/tv_volume_dialog_circle"
            android:tint="@color/accent_tint_color_selector"
            android:soundEffectsEnabled="false" />
        <TextView
@@ -68,6 +69,8 @@
            android:layout_height="@dimen/tv_volume_dialog_bubble_size"
            android:maxLength="2"
            android:gravity="center"
            android:background="@drawable/tv_volume_dialog_circle"
            android:textSize="@dimen/tv_volume_number_text_size"
            android:textColor="@color/accent_tint_color_selector"/>
    </LinearLayout>

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
    android:gravity="right"
    android:layout_gravity="right"
    android:background="@android:color/transparent"
    android:theme="@style/qs_theme">
    android:theme="@style/volume_dialog_theme">

    <FrameLayout
        android:id="@+id/volume_dialog"
Loading