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

Commit 9d0478eb authored by Anton Potapov's avatar Anton Potapov Committed by Android (Google) Code Review
Browse files

Merge "Add Volume Panel Compose fundamentals" into main

parents 0aac72e8 b10a97bd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -899,6 +899,14 @@
                  android:exported="true"
                  />

        <activity
            android:name=".volume.panel.ui.activity.VolumePanelActivity"
            android:label="@string/sound_settings"
            android:excludeFromRecents="true"
            android:exported="false"
            android:launchMode="singleInstance"
            android:theme="@style/Theme.VolumePanelActivity" />

        <activity android:name=".wallet.ui.WalletActivity"
                  android:label="@string/wallet_title"
                  android:theme="@style/Wallet.Theme"
+9 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import com.android.systemui.scene.shared.model.Scene
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel
import com.android.systemui.statusbar.phone.SystemUIDialogFactory
import com.android.systemui.volume.panel.ui.viewmodel.VolumePanelViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.StateFlow

@@ -63,6 +64,14 @@ object ComposeFacade : BaseComposeFacade {
        throwComposeUnavailableError()
    }

    override fun setVolumePanelActivityContent(
        activity: ComponentActivity,
        viewModel: VolumePanelViewModel,
        onDismissAnimationFinished: () -> Unit,
    ) {
        throwComposeUnavailableError()
    }

    override fun createFooterActionsView(
        context: Context,
        viewModel: FooterActionsViewModel,
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.systemui.volume.panel.component.bottombar

import dagger.Module

@Module interface BottomBarModule
+15 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ import com.android.systemui.scene.ui.composable.SceneContainer
import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel
import com.android.systemui.statusbar.phone.SystemUIDialogFactory
import com.android.systemui.statusbar.phone.create
import com.android.systemui.volume.panel.ui.composable.VolumePanelRoot
import com.android.systemui.volume.panel.ui.viewmodel.VolumePanelViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
@@ -91,6 +93,19 @@ object ComposeFacade : BaseComposeFacade {
        }
    }

    override fun setVolumePanelActivityContent(
        activity: ComponentActivity,
        viewModel: VolumePanelViewModel,
        onDismissAnimationFinished: () -> Unit,
    ) {
        activity.setContent {
            VolumePanelRoot(
                viewModel = viewModel,
                onDismissAnimationFinished = onDismissAnimationFinished,
            )
        }
    }

    override fun createFooterActionsView(
        context: Context,
        viewModel: FooterActionsViewModel,
+43 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.systemui.volume.panel.component.bottombar

import com.android.systemui.volume.panel.component.bottombar.ui.BottomBarComponent
import com.android.systemui.volume.panel.component.shared.model.VolumePanelComponents
import com.android.systemui.volume.panel.domain.AlwaysAvailableCriteria
import com.android.systemui.volume.panel.domain.ComponentAvailabilityCriteria
import com.android.systemui.volume.panel.shared.model.VolumePanelUiComponent
import dagger.Binds
import dagger.Module
import dagger.multibindings.IntoMap
import dagger.multibindings.StringKey

@Module
interface BottomBarModule {

    @Binds
    @IntoMap
    @StringKey(VolumePanelComponents.BOTTOM_BAR)
    fun bindMediaVolumeSliderComponent(component: BottomBarComponent): VolumePanelUiComponent

    @Binds
    @IntoMap
    @StringKey(VolumePanelComponents.BOTTOM_BAR)
    fun bindComponentAvailabilityCriteria(
        defaultCriteria: AlwaysAvailableCriteria
    ): ComponentAvailabilityCriteria
}
Loading