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

Commit cdd5da22 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

[Spa] Add Scaffold isFirstLayerPageWhenEmbedded param

And if the page is first layer page when embedded and the activity is
embedded, not show the Scaffold's back button, because it is the first
layer page now.

Bug: 408233278
Flag: EXEMPT bug fix
Test: manual - with gallery
Change-Id: Ifd37d19061d805ef87c7a2ae76c5c2e5af7aa55f
parent 36bb1d84
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ val androidTop: String = File(rootDir, "../../../../..").canonicalPath

allprojects {
    extra["androidTop"] = androidTop
    extra["jetpackComposeVersion"] = "1.8.0-rc02"
    extra["jetpackComposeVersion"] = "1.8.0"
}

subprojects {
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#

[versions]
agp = "8.9.1"
agp = "8.9.2"
dexmaker-mockito = "2.28.3"
jvm = "21"
kotlin = "2.1.10"
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ android_library {
    static_libs: [
        "MPAndroidChart",
        "SettingsLibColor",
        "aconfig_settingstheme_exported_flags_java_lib",
        "androidx.compose.animation_animation",
        "androidx.compose.material3_material3",
        "androidx.compose.material_material-icons-extended",
@@ -36,6 +35,7 @@ android_library {
        "androidx.lifecycle_lifecycle-livedata-ktx",
        "androidx.lifecycle_lifecycle-runtime-compose",
        "androidx.navigation_navigation-compose",
        "androidx.window_window",
        "com.google.android.material_material",
        "lottie_compose",
    ],
+3 −2
Original line number Diff line number Diff line
@@ -52,14 +52,15 @@ android {
dependencies {
    api(project(":SettingsLibColor"))
    api("androidx.appcompat:appcompat:1.7.0")
    api("androidx.compose.material3:material3:1.4.0-alpha12")
    api("androidx.compose.material3:material3:1.4.0-alpha13")
    api("androidx.compose.material:material-icons-extended:1.7.8")
    api("androidx.compose.runtime:runtime-livedata:$jetpackComposeVersion")
    api("androidx.compose.ui:ui-tooling-preview:$jetpackComposeVersion")
    api("androidx.graphics:graphics-shapes-android:1.0.1")
    api("androidx.lifecycle:lifecycle-livedata-ktx")
    api("androidx.lifecycle:lifecycle-runtime-compose")
    api("androidx.navigation:navigation-compose:2.9.0-beta01")
    api("androidx.navigation:navigation-compose:2.9.0-rc01")
    api("androidx.window:window:1.5.0-alpha01")
    api("com.github.PhilJay:MPAndroidChart:v3.1.0-alpha")
    api("com.google.android.material:material:1.13.0-alpha08")
    debugApi("androidx.compose.ui:ui-tooling:$jetpackComposeVersion")
+32 −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.compose

import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext

@Composable
internal fun localActivity(): Activity? = LocalContext.current.getActivity()

internal fun Context.getActivity(): Activity? = when (this) {
    is Activity -> this
    is ContextWrapper -> baseContext.getActivity()
    else -> null
}
Loading