|
|
|
@ -13,12 +13,15 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
|
import androidx.compose.ui.platform.ComposeView
|
|
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
|
import androidx.lifecycle.LifecycleOwner
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
|
|
import mozilla.components.lib.state.ext.observeAsComposableState
|
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
|
import org.mozilla.fenix.components.components
|
|
|
|
|
import org.mozilla.fenix.compose.ComposeViewHolder
|
|
|
|
|
import org.mozilla.fenix.theme.FirefoxTheme
|
|
|
|
|
import org.mozilla.fenix.theme.Theme
|
|
|
|
@ -42,12 +45,17 @@ class PocketRecommendationsHeaderViewHolder(
|
|
|
|
|
composeView.resources.getDimensionPixelSize(R.dimen.home_item_horizontal_margin)
|
|
|
|
|
composeView.setPadding(horizontalPadding, 0, horizontalPadding, 0)
|
|
|
|
|
|
|
|
|
|
val wallpaperState = components.appStore
|
|
|
|
|
.observeAsComposableState { state -> state.wallpaperState }.value
|
|
|
|
|
val wallpaperAdaptedTextColor = wallpaperState?.currentWallpaper?.textColor?.let { Color(it) }
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
Spacer(Modifier.height(24.dp))
|
|
|
|
|
|
|
|
|
|
PoweredByPocketHeader(
|
|
|
|
|
onLearnMoreClicked = interactor::onLearnMoreClicked,
|
|
|
|
|
modifier = Modifier.fillMaxWidth()
|
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
textColor = wallpaperAdaptedTextColor ?: FirefoxTheme.colors.textPrimary
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|