Skip to content

Commit

Permalink
Replace rememberKoinInject with koinInject
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Jan 28, 2024
1 parent 7b1d632 commit f57dc7e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import androidx.compose.runtime.getValue
import androidx.tv.foundation.lazy.list.items
import nl.ndat.tvlauncher.data.repository.AppRepository
import nl.ndat.tvlauncher.ui.component.card.AppCard
import org.koin.compose.rememberKoinInject
import org.koin.compose.koinInject

@Composable
fun AppCardRow() {
val appRepository = rememberKoinInject<AppRepository>()
val appRepository = koinInject<AppRepository>()
val apps by appRepository.getApps().collectAsState(initial = emptyList())

CardRow {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import nl.ndat.tvlauncher.data.repository.ChannelRepository
import nl.ndat.tvlauncher.data.sqldelight.App
import nl.ndat.tvlauncher.data.sqldelight.Channel
import nl.ndat.tvlauncher.ui.component.card.ChannelProgramCard
import org.koin.compose.rememberKoinInject
import org.koin.compose.koinInject

@Composable
fun ChannelProgramCardRow(
channel: Channel,
) {
val channelRepository = rememberKoinInject<ChannelRepository>()
val appRepository = rememberKoinInject<AppRepository>()
val channelRepository = koinInject<ChannelRepository>()
val appRepository = koinInject<AppRepository>()
val programs by channelRepository.getProgramsByChannel(channel).collectAsState(initial = emptyList())

var app by remember { mutableStateOf<App?>(null) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import nl.ndat.tvlauncher.data.repository.ChannelRepository
import nl.ndat.tvlauncher.ui.component.row.AppCardRow
import nl.ndat.tvlauncher.ui.component.row.ChannelProgramCardRow
import nl.ndat.tvlauncher.ui.toolbar.Toolbar
import org.koin.compose.rememberKoinInject
import org.koin.compose.koinInject

@Composable
fun LauncherPage() {
val channelRepository = rememberKoinInject<ChannelRepository>()
val channelRepository = koinInject<ChannelRepository>()
val channels by channelRepository.getChannels().collectAsState(initial = emptyList())

TvLazyColumn(
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/nl/ndat/tvlauncher/ui/toolbar/Toolbar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import androidx.compose.ui.focus.focusRestorer
import androidx.compose.ui.unit.dp
import nl.ndat.tvlauncher.data.model.ToolbarLocation
import nl.ndat.tvlauncher.data.repository.PreferenceRepository
import org.koin.compose.rememberKoinInject
import org.koin.compose.koinInject

@OptIn(ExperimentalFoundationApi::class, ExperimentalComposeUiApi::class)
@Composable
fun Toolbar(
modifier: Modifier = Modifier,
) {
val preferenceRepository = rememberKoinInject<PreferenceRepository>()
val preferenceRepository = koinInject<PreferenceRepository>()
val location by preferenceRepository.toolbarLocation.collectAsState()

Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import nl.ndat.tvlauncher.R
import nl.ndat.tvlauncher.data.repository.InputRepository
import org.koin.compose.rememberKoinInject
import org.koin.compose.koinInject

@Composable
fun ToolbarInputsButton() {
val inputRepository = rememberKoinInject<InputRepository>()
val inputRepository = koinInject<InputRepository>()
val inputs by inputRepository.getInputs().collectAsState(initial = emptyList())
val context = LocalContext.current

Expand Down

0 comments on commit f57dc7e

Please sign in to comment.