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

Commit 68baceed authored by bobyang's avatar bobyang
Browse files

Update pack entry's title and description by gRPC result

Bug: 398982575
Flag: EXEMPT refactor
Test: Tested by building and installing picker on local, checking if we
get data from pack

Change-Id: I82d6c86ed248177a993ebca6e717a822304bd746
parent 9966f906
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -374,6 +374,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
}