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

Commit eb2e0cef authored by Edgar Wang's avatar Edgar Wang Committed by Android (Google) Code Review
Browse files

Merge "[Expressive design] Add FloatingToolbar" into main

parents 0f57bed4 113d7bca
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -14,16 +14,19 @@ android_library {
        "SettingsLintDefaults",
    ],

    srcs: ["src/**/*.java"],
    srcs: [
        "src/**/*.java",
        "src/**/*.kt",
    ],
    resource_dirs: ["res"],

    static_libs: [
        "SettingsLibSettingsTheme",
        "SettingsLibSettingsTransition",
        "androidx.activity_activity",
        "androidx.annotation_annotation",
        "androidx.core_core",
        "androidx.activity_activity",
        "com.google.android.material_material",
        "SettingsLibSettingsTransition",
        "SettingsLibSettingsTheme",
    ],
    sdk_version: "system_current",
    min_sdk_version: "29",
@@ -33,8 +36,8 @@ android_library {
        "com.android.cellbroadcast",
        "com.android.devicelock",
        "com.android.extservices",
        "com.android.permission",
        "com.android.healthfitness",
        "com.android.mediaprovider",
        "com.android.permission",
    ],
}
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2025 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">
    <corners android:radius="100dp" />
    <solid android:color="@color/settingslib_materialColorSecondaryContainer" />
</shape>
 No newline at end of file
+16 −0
Original line number Diff line number Diff line
@@ -72,4 +72,20 @@
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

    <com.google.android.material.floatingtoolbar.FloatingToolbarLayout
        android:id="@+id/floating_toolbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight"
        style="@style/Widget.SettingsLib.Material3Expressive.FloatingToolbar"
        app:layout_behavior="com.google.android.material.behavior.HideViewOnScrollBehavior"
        android:layout_margin="@dimen/settingslib_expressive_space_small1"
        android:visibility="gone">

        <com.android.settingslib.collapsingtoolbar.widget.ScrollableToolbarItemLayout
            android:id="@+id/floating_toolbar_items"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.google.android.material.floatingtoolbar.FloatingToolbarLayout>
</merge>
 No newline at end of file
+53 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2025 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar_item_container"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center_vertical"
    android:minHeight="@dimen/settingslib_expressive_space_medium4"
    android:paddingHorizontal="@dimen/settingslib_expressive_space_small1"
    android:paddingVertical="@dimen/settingslib_expressive_space_extrasmall5">

    <LinearLayout
        android:id="@+id/item_icon_frame"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingEnd="@dimen/settingslib_expressive_space_extrasmall4">
        <ImageView
            android:id="@android:id/icon"
            android:layout_width="@dimen/settingslib_expressive_space_small3"
            android:layout_height="@dimen/settingslib_expressive_space_small3"
            android:src="@drawable/settingslib_expressive_icon_close"
            app:tint="@color/settingslib_materialColorOnSecondaryContainer"
            android:importantForAccessibility="no"/>
    </LinearLayout>

    <TextView
        android:id="@android:id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:maxLines="2"
        android:ellipsize="end"
        android:maxWidth="@dimen/settingslib_expressive_space_large3"
        android:textAppearance="@style/TextAppearance.SettingsLib.LabelLarge"
        android:textColor="@color/settingslib_materialColorOnSecondaryContainer" />
</LinearLayout>
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
@@ -41,4 +41,13 @@
    <style name="SettingsLibCollapsingToolbarTitle.Expanded" parent="@style/TextAppearance.SettingsLib.DisplaySmall.Emphasized">
        <item name="android:textSize">36dp</item>
    </style>

    <style name="Widget.SettingsLib.Material3Expressive.FloatingToolbar" parent="Base.Widget.Material3.FloatingToolbar">
        <item name="backgroundTint">@color/settingslib_materialColorSurfaceContainerHighest</item>
        <item name="android:paddingStart">@dimen/settingslib_expressive_space_extrasmall6</item>
        <item name="android:paddingEnd">@dimen/settingslib_expressive_space_extrasmall6</item>
        <item name="android:paddingTop">@dimen/settingslib_expressive_space_extrasmall6</item>
        <item name="android:paddingBottom">@dimen/settingslib_expressive_space_extrasmall6</item>
        <item name="android:layout_gravity">bottom|center</item>
    </style>
</resources>
 No newline at end of file
Loading