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

Commit 17e0936f authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge changes I7d029be2,I6f3f05ba into main

* changes:
  [Spa] Polish CustomizedAppBar
  [Spa] Polish UI
parents 00abf9e1 7870a98d
Loading
Loading
Loading
Loading
+2 −16
Original line number Diff line number Diff line
@@ -20,24 +20,12 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.ui.unit.dp

object SettingsDimension {
    val extraSmall2 = 4.dp
    val extraSmall3 = 6.dp
    val extraSmall4 = 8.dp
    val extraSmall5 = 10.dp
    val extraSmall6 = 12.dp
    val small1 = 16.dp
    val small4 = 24.dp

    val paddingTiny = 2.dp
    val paddingExtraSmall1 = 6.dp
    val paddingSmall = if (isSpaExpressiveEnabled) 8.dp else 4.dp
    val paddingLarge = 16.dp
    val paddingExtraLarge = 24.dp
    val paddingExtraLarge1 = 28.dp

    val spinnerHorizontalPadding = paddingExtraLarge
    val spinnerVerticalPadding = paddingLarge

    val actionIconSize = 40.dp
    val actionIconPadding = 8.dp

@@ -46,7 +34,8 @@ object SettingsDimension {
    val itemIconContainerSize = 72.dp
    val itemPaddingStart = if (isSpaExpressiveEnabled) paddingLarge else paddingExtraLarge
    val itemPaddingEnd = paddingLarge
    val itemPaddingVertical = if (isSpaExpressiveEnabled) extraSmall6 else paddingLarge
    val itemPaddingVertical =
        if (isSpaExpressiveEnabled) SettingsSpace.extraSmall6 else paddingLarge
    val itemPadding = PaddingValues(
        start = itemPaddingStart,
        top = itemPaddingVertical,
@@ -100,7 +89,4 @@ object SettingsDimension {
    val illustrationCornerRadius = 28.dp

    val preferenceMinHeight = 72.dp

    val spinnerOptionMinHeight = 48.dp
    val spinnerIconSize = 20.dp
}
+7 −9
Original line number Diff line number Diff line
@@ -16,22 +16,20 @@

package com.android.settingslib.spa.framework.theme

import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.unit.dp

object SettingsShape {
    val CornerExtraSmall = RoundedCornerShape(4.dp)

    val CornerFull = CircleShape
    val CornerExtraSmall2 = RoundedCornerShape(4.dp)
    val CornerMedium = RoundedCornerShape(12.dp)
    val CornerLarge1 = RoundedCornerShape(16.dp)
    val CornerLarge2 = RoundedCornerShape(20.dp)
    val CornerExtraLarge1 = RoundedCornerShape(28.dp)

    val CornerMedium2 = RoundedCornerShape(20.dp)

    val CornerLarge = RoundedCornerShape(24.dp)

    val CornerExtraLarge = RoundedCornerShape(28.dp)

    val CornerExtraLarge1 = RoundedCornerShape(40.dp)
    // Legacy tokens below

    val TopCornerMedium2 =
        RoundedCornerShape(CornerSize(20.dp), CornerSize(20.dp), CornerSize(0), CornerSize(0))
+24 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.settingslib.spa.framework.theme

import androidx.compose.ui.unit.dp

object SettingsSize {
    val small2 = 20.dp
    val medium3 = 40.dp
}
+34 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.settingslib.spa.framework.theme

import androidx.compose.ui.unit.dp

object SettingsSpace {
    val extraSmall1 = 2.dp
    val extraSmall2 = 4.dp
    val extraSmall3 = 6.dp
    val extraSmall4 = 8.dp
    val extraSmall5 = 10.dp
    val extraSmall6 = 12.dp
    val extraSmall7 = 14.dp

    val small1 = 16.dp
    val small2 = 18.dp
    val small3 = 20.dp
    val small4 = 24.dp
}
+10 −13
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            displayLargeEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.displayLargeEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 57.sp,
                    lineHeight = 64.sp,
                    letterSpacing = (-0.2).sp,
@@ -202,7 +202,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            displayMediumEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.displayMediumEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 45.sp,
                    lineHeight = 52.sp,
                    letterSpacing = 0.0.sp,
@@ -220,7 +220,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            displaySmallEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.displaySmallEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 36.sp,
                    lineHeight = 44.sp,
                    letterSpacing = 0.0.sp,
@@ -238,7 +238,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            headlineLargeEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.headlineLargeEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 32.sp,
                    lineHeight = 40.sp,
                    letterSpacing = 0.0.sp,
@@ -256,7 +256,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            headlineMediumEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.headlineMediumEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 28.sp,
                    lineHeight = 36.sp,
                    letterSpacing = 0.0.sp,
@@ -274,7 +274,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            headlineSmallEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.headlineSmallEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 24.sp,
                    lineHeight = 32.sp,
                    letterSpacing = 0.0.sp,
@@ -292,7 +292,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            titleLargeEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.titleLargeEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 22.sp,
                    lineHeight = 28.sp,
                    letterSpacing = 0.02.em,
@@ -346,7 +346,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            bodyLargeEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.bodyLargeEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 16.sp,
                    lineHeight = 24.sp,
                    letterSpacing = 0.01.em,
@@ -364,7 +364,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            bodyMediumEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.bodyMediumEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 14.sp,
                    lineHeight = 20.sp,
                    letterSpacing = 0.01.em,
@@ -382,7 +382,7 @@ private class SettingsTypography(settingsFontFamily: SettingsFontFamily) {
            bodySmallEmphasized =
                TextStyle(
                    fontFamily = settingsFontFamily.bodySmallEmphasized,
                    fontWeight = FontWeight.Medium,
                    fontWeight = FontWeight.SemiBold,
                    fontSize = 12.sp,
                    lineHeight = 16.sp,
                    letterSpacing = 0.01.em,
@@ -457,6 +457,3 @@ internal fun rememberSettingsTypography(): Typography {
/** Creates a new [TextStyle] which font weight set to medium. */
internal fun TextStyle.toMediumWeight() =
    copy(fontWeight = FontWeight.Medium, letterSpacing = 0.01.em)

internal fun TextStyle.toSemiBoldWeight() =
    copy(fontWeight = FontWeight.SemiBold, letterSpacing = 0.01.em)
Loading