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

Commit 5fc981c4 authored by Ido Ben-Hur's avatar Ido Ben-Hur Committed by Michael Bestas
Browse files

DeskClock: Use the new material switch to match with settings

Change-Id: I349a40ce19c93b546fe0acdddc276e7960127e2d
parent 77c3ff0a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -67,15 +67,18 @@
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_caret_down" />

    <androidx.appcompat.widget.SwitchCompat
    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/onoff"
        style="@style/DeskClock.Switch"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="6.0dip"
        android:focusable="true"
        android:minWidth="@dimen/touch_target_min_size"
        android:minHeight="@dimen/touch_target_min_size"
        android:text=""
        android:textOn=""
        android:textOff=""
        app:layout_constraintEnd_toStartOf="@id/end_guide_thin"
        app:layout_constraintTop_toBottomOf="@id/digital_clock" />

+5 −2
Original line number Diff line number Diff line
@@ -69,15 +69,18 @@
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_caret_up" />

    <androidx.appcompat.widget.SwitchCompat
    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/onoff"
        style="@style/DeskClock.Switch"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="6.0dip"
        android:focusable="true"
        android:minWidth="@dimen/touch_target_min_size"
        android:minHeight="@dimen/touch_target_min_size"
        android:text=""
        android:textOn=""
        android:textOff=""
        app:layout_constraintEnd_toStartOf="@id/end_guide_thin"
        app:layout_constraintTop_toBottomOf="@id/digital_clock" />

+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 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.
  -->
<com.google.android.material.materialswitch.MaterialSwitch
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/switchWidget"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clickable="false"
    android:focusable="false"
    android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
+5 −3
Original line number Diff line number Diff line
@@ -17,12 +17,14 @@

<!-- Layout used by SwitchPreference for the switch widget style. This is inflated
     inside android.R.layout.preference. -->
<androidx.appcompat.widget.SwitchCompat
<com.google.android.material.materialswitch.MaterialSwitch
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/DeskClock.Switch"
    android:theme="@style/Theme.Material3.DynamicColors.DayNight"
    android:id="@+id/switchWidget"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:focusable="false"
    android:clickable="false"
    android:background="@null"/>
    android:text=""
    android:textOn=""
    android:textOff=""/>
+0 −14
Original line number Diff line number Diff line
@@ -124,20 +124,6 @@
        <item name="android:popupBackground">@drawable/popup_background</item>
    </style>

    <style name="DeskClock.Switch" parent="@android:style/Widget.Material.CompoundButton.Switch">
        <item name="android:switchMinWidth">52dp</item>
        <item name="android:minHeight">@dimen/touch_target_min_size</item>
        <item name="android:track">@drawable/switch_track</item>
        <item name="track">@drawable/switch_track</item>
        <item name="android:thumb">@drawable/switch_thumb</item>
        <item name="thumbTint">@color/default_background</item>
    </style>

    <style name="DeskClock.SwitchPreferenceCompat" parent="@style/Preference.SwitchPreferenceCompat.Material">
        <item name="iconSpaceReserved">false</item>
        <item name="android:widgetLayout">@layout/widget_switch_compat</item>
    </style>

    <style name="TimerLabelTextAppearance" parent="SecondaryLabelTextAppearance">
        <item name="android:textSize">20sp</item>
    </style>
Loading