create top level switch and palette view on settings page

This commit is contained in:
Owen LeJeune
2022-02-10 13:57:43 -05:00
parent 09982636b2
commit 620cbca62d
5 changed files with 240 additions and 27 deletions

View File

@@ -3,11 +3,12 @@ package com.owenlejeune.tvtime.extensions
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.lazy.LazyGridScope
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.runtime.Composable
import androidx.paging.compose.LazyPagingItems
@OptIn(ExperimentalFoundationApi::class)
fun <T: Any> LazyGridScope.items(
fun <T: Any> LazyGridScope.lazyPagingItems(
lazyPagingItems: LazyPagingItems<T>,
itemContent: @Composable LazyItemScope.(value: T?) -> Unit
) {
@@ -17,7 +18,16 @@ fun <T: Any> LazyGridScope.items(
}
@OptIn(ExperimentalFoundationApi::class)
fun <T: Any> LazyGridScope.items(
fun <T: Any> LazyGridScope.listItems(
items: List<T>,
itemContent: @Composable (value: T) -> Unit
) {
items(items.size) { index ->
itemContent(items[index])
}
}
fun <T: Any> LazyListScope.listItems(
items: List<T>,
itemContent: @Composable (value: T) -> Unit
) {