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

Commit 4efac66e authored by Edgar Wang's avatar Edgar Wang
Browse files

[Expressive design] Update CollapsingToolbar

Bug: 366357390
Test: manual
Flag: EXEMPT resource only update
Change-Id: I7c6306af2a7bb610a828fabf61c5c555deb5f589
parent ec72a55a
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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.
-->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:start="16dp"
        android:end="16dp"
        android:top="4dp"
        android:bottom="4dp">
        <shape>
            <size android:width="32dp" android:height="40dp" />
            <solid android:color="@color/settingslib_materialColorSurfaceContainerHighest" />
            <corners
                android:radius="100dp" />
        </shape>
    </item>

    <item
        android:width="24dp"
        android:height="24dp"
        android:gravity="center"
        android:start="16dp"
        android:end="16dp"
        android:top="4dp"
        android:bottom="4dp">
        <vector
            android:width="24dp"
            android:height="24dp"
            android:viewportWidth="960"
            android:viewportHeight="960"
            android:tint="@color/settingslib_materialColorOnSurfaceVariant"
            android:autoMirrored="true">
            <path
                android:fillColor="@android:color/white"
                android:pathData="M313,520L537,744L480,800L160,480L480,160L537,216L313,440L800,440L800,520L313,520Z"/>
        </vector>
    </item>
</layer-list>
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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.
-->

<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/content_parent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <include layout="@layout/settingslib_expressive_collapsing_toolbar_content_layout"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
 No newline at end of file
+56 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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.
-->
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:outlineAmbientShadowColor="@android:color/transparent"
        android:outlineSpotShadowColor="@android:color/transparent"
        android:background="@android:color/transparent"
        app:expanded="false"
        android:theme="@style/SettingsLibTheme.CollapsingToolbar.Expressive">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/settingslib_toolbar_layout_height"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
            app:toolbarId="@id/action_bar"
            style="@style/SettingsLibCollapsingToolbarLayoutStyle.Expressive">

            <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"/>

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

    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</merge>
 No newline at end of file
+44 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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="SettingsLibCollapsingToolbarLayoutStyle">
        <item name="expandedTitleTextAppearance">@style/SettingsLibCollapsingToolbarTitle.Expanded</item>
        <item name="collapsedTitleTextAppearance">@style/SettingsLibCollapsingToolbarTitle.Collapsed</item>
        <item name="expandedTitleMarginStart">@dimen/settingslib_expressive_space_small4</item>
        <item name="expandedTitleMarginEnd">@dimen/settingslib_expressive_space_small4</item>
        <item name="expandedTitleMarginBottom">@dimen/settingslib_expressive_space_medium1</item>
        <item name="maxLines">3</item>
        <item name="scrimVisibleHeightTrigger">@dimen/settingslib_scrim_visible_height_trigger</item>
        <item name="contentScrim">@color/settingslib_materialColorSurfaceVariant</item>
        <item name="statusBarScrim">@null</item>
        <item name="scrimAnimationDuration">50</item>
        <item name="collapsedTitleTextColor">@color/settingslib_materialColorOnSurface</item>
        <item name="expandedTitleTextColor">@color/settingslib_materialColorOnSurface</item>
    </style>
    <style name="SettingsLibCollapsingToolbarLayoutStyle.Expressive">
        <item name="contentScrim">@color/settingslib_materialColorSurfaceContainer</item>
    </style>

    <style name="SettingsLibCollapsingToolbarTitle.Collapsed" parent="@android:style/TextAppearance.DeviceDefault.Headline">
        <!--set dp because we don't want size adjust when font size change-->
        <item name="android:textSize">20dp</item>
    </style>

    <style name="SettingsLibCollapsingToolbarTitle.Expanded" parent="CollapsingToolbarTitle.Collapsed">
        <item name="android:textSize">36dp</item>
    </style>
</resources>
 No newline at end of file
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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="SettingsLibTheme.CollapsingToolbar.Expressive" parent="@style/Theme.MaterialComponents.DayNight"/>
</resources>
 No newline at end of file
Loading