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

Commit 5c4e58cd authored by Bob Yang's avatar Bob Yang Committed by Android (Google) Code Review
Browse files

Merge "Update pack entry's title and description by gRPC result" into main

parents efef4e77 68baceed
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -375,6 +375,32 @@ constructor(private val defaultCustomizationOptionsBinder: DefaultCustomizationO
                }

                if (BaseFlags.get().isPackThemeEnabled()) {
                    launch {
                        optionsViewModel.packThemeViewModel.packThemeData.collect { packThemeData ->
                            val homeTitle =
                                optionPackThemeHome?.findViewById<TextView>(R.id.option_entry_title)
                            val lockTitle =
                                optionPackThemeLock?.findViewById<TextView>(R.id.option_entry_title)
                            val homeDescription =
                                optionPackThemeHome?.findViewById<TextView>(
                                    R.id.option_entry_description
                                )
                            val lockDescription =
                                optionPackThemeHome?.findViewById<TextView>(
                                    R.id.option_entry_description
                                )
                            if (packThemeData.currentThemePackInfo.title.isNotEmpty()) {
                                homeTitle?.text = packThemeData.currentThemePackInfo.title
                                lockTitle?.text = packThemeData.currentThemePackInfo.title
                            }
                            if (packThemeData.currentThemePackInfo.description.isNotEmpty()) {
                                homeDescription?.text =
                                    packThemeData.currentThemePackInfo.description
                                lockDescription?.text =
                                    packThemeData.currentThemePackInfo.description
                            }
                        }
                    }
                    launch {
                        optionsViewModel.packThemeViewModel.startThemePackActivityIntent.collect {
                            intent ->
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.wallpaper.customization.ui.viewmodel

import android.content.ComponentName
import android.content.Intent
import com.android.customization.picker.pack.data.PackThemeData
import com.android.wallpaper.picker.domain.interactor.PackThemeInteractor
import dagger.hilt.android.scopes.ViewModelScoped
import javax.inject.Inject
@@ -39,4 +40,5 @@ class PackThemeViewModel @Inject constructor(private val interactor: PackThemeIn
                null
            }
        }
    val packThemeData: Flow<PackThemeData> = interactor.packThemeData
}