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

Commit ccd06394 authored by Luca Stefani's avatar Luca Stefani
Browse files

DeskClock: Avoid using a collapsable toolbar

Doesn't really need to be one, and looks ugly.

Change-Id: I02257c8714fd0c08e9b321b98b46c9e8c5d5d06d
parent f4e0e040
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/content_parent"
    android:layout_width="match_parent"
@@ -26,41 +25,19 @@
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?colorPrimary"
        android:fitsSystemWindows="true"
        android:outlineAmbientShadowColor="@android:color/transparent"
        android:outlineSpotShadowColor="@android:color/transparent"
        android:background="?colorPrimary"
        android:theme="@style/Theme.CollapsingToolbar.Settings">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/settingslib_toolbar_layout_height"
            android:clipToPadding="false"
            app:forceApplySystemWindowInsetTop="true"
            app:extraMultilineHeightEnabled="true"
            app:contentScrim="@android:color/system_neutral1_700"
            app:maxLines="3"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
            app:scrimAnimationDuration="50"
            app:scrimVisibleHeightTrigger="@dimen/settingslib_scrim_visible_height_trigger"
            app:statusBarScrim="@null"
            app:titleCollapseMode="fade"
            app:collapsedTitleTextAppearance="@style/CollapsingToolbarTitle.Collapsed"
            app:expandedTitleTextAppearance="@style/CollapsingToolbarTitle.Expanded"
            app:expandedTitleMarginStart="@dimen/expanded_title_margin_start"
            app:expandedTitleMarginEnd="@dimen/expanded_title_margin_end"
            app:toolbarId="@id/action_bar">
        android:theme="@style/Theme.Toolbar.Settings">

        <Toolbar
            android:id="@+id/action_bar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:theme="?android:attr/actionBarTheme"
                android:transitionName="shared_element_view"
                app:layout_collapseMode="pin"/>
            android:transitionName="shared_element_view" />

        </com.google.android.material.appbar.CollapsingToolbarLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <FrameLayout

res/values/dimens_settingslib.xml

deleted100644 → 0
+0 −23
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2021 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.
-->
<resources>
    <!-- Collapsing toolbar layout dimensions -->
    <dimen name="settingslib_toolbar_layout_height">179dp</dimen>
    <dimen name="settingslib_scrim_visible_height_trigger">137dp</dimen>
    <dimen name="expanded_title_margin_start">24dp</dimen>
    <dimen name="expanded_title_margin_end">24dp</dimen>
</resources>

res/values/styles_settingslib.xml

deleted100644 → 0
+0 −28
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2021 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.
-->
<resources>
    <style name="CollapsingToolbarTitle.Collapsed" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
        <item name="android:textSize">20dp</item>
        <item name="android:textColor">?attr/colorOnSurface</item>
    </style>

    <style name="CollapsingToolbarTitle.Expanded" parent="CollapsingToolbarTitle.Collapsed">
        <item name="android:textSize">36dp</item>
        <item name="android:textColor">?attr/colorOnSurface</item>
    </style>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
  limitations under the License.
-->
<resources>
    <style name="Theme.CollapsingToolbar.Settings" parent="Theme.Material3Expressive.DynamicColors.Dark.NoActionBar">
    <style name="Theme.Toolbar.Settings" parent="Theme.Material3Expressive.DynamicColors.Dark.NoActionBar">
        <item name="colorPrimary">?attr/colorSurface</item>
        <item name="colorSecondary">?attr/colorPrimary</item>
    </style>
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ import com.android.deskclock.RingtonePreviewKlaxon;
import com.android.deskclock.alarms.AlarmUpdateHandler;
import com.android.deskclock.data.DataModel;
import com.android.deskclock.provider.Alarm;
import com.android.deskclock.widget.CollapsingToolbarBaseActivity;
import com.android.deskclock.widget.ToolbarBaseActivity;

import java.util.List;
import java.util.concurrent.ExecutorService;
@@ -73,7 +73,7 @@ import java.util.concurrent.Executors;
 *     <li>user-selected audio files available as ringtones</li>
 * </ul>
 */
public class RingtonePickerActivity extends CollapsingToolbarBaseActivity
public class RingtonePickerActivity extends ToolbarBaseActivity
        implements LoaderManager.LoaderCallbacks<List<ItemAdapter.ItemHolder<Uri>>> {

    /** Key to an extra that defines resource id to the title of this activity. */
Loading