Skip to content

Commit

Permalink
code fixes after library bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mimoccc committed Aug 29, 2024
1 parent 6e85f6f commit e72482f
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class AppPlugin : BasePlugin() {
isDebuggable = false
isJniDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
isShrinkResources = false
isCrunchPngs = true
signingConfig = signingConfigs[name]
// todo : move
Expand Down
6 changes: 5 additions & 1 deletion documentation/release-notes-1.3.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## Release notes 1.0.0 - 29. 8. 2024, 9:11:57
## Release notes 1.0.0 - 29. 8. 2024, 10:22:22

* 29.08.2024

* [milan jurkulák] : ksp libs bump

* 28.08.2024

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ kotlin-annotationProcessingEmbeddable = { module = "org.jetbrains.kotlin:kotlin-
kotlin-kapt4 = { module = "org.jetbrains.kotlin:kotlin-annotation-processing-compiler", version.ref = "kotlin" }
kotlin-scriptingCompiler = { module = "org.jetbrains.kotlin:kotlin-scripting-compiler", version.ref = "kotlin" }
kotlin-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
#aalto-xml={ module="com.fasterxml:aalto-xml" , version="1.3.1"} # todo
aalto-xml={ module="com.fasterxml:aalto-xml" , version="1.3.1"} # todo
#
#classpath("org.jetbrains.kotlin:kotlin-scripting-jsr223:1.9.22")
#classpath("org.jetbrains.kotlin:kotlin-scripting-common:1.9.22")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Milan Jurkulák 2023.
* Copyright (c) Milan Jurkulák 2024.
* Contact:
* e: mimoccc@gmail.com
* e: mj@mjdev.org
Expand All @@ -16,6 +16,9 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableIntState
Expand All @@ -32,9 +35,6 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.itemsIndexed
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import androidx.tv.material3.ExperimentalTvMaterial3Api
import kotlinx.coroutines.delay
import org.mjdev.tvlib.annotations.Previews
Expand Down Expand Up @@ -67,7 +67,7 @@ fun Gallery(
) {
mutableStateOf(ContentScale.Crop)
},
listState: TvLazyListState = rememberTvLazyListState(),
listState: LazyListState = rememberLazyListState(),
switchImageScale: () -> Unit = {
imageScaleType.value = when (imageScaleType.value) {
ContentScale.Fit -> ContentScale.Crop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package org.mjdev.tvlib.ui.components.tv

import android.content.ComponentName
import android.content.Context
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
Expand All @@ -20,8 +22,6 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import org.mjdev.tvlib.extensions.ComposeExt.computeCardWidth
import org.mjdev.tvlib.helpers.apps.rememberAppsManager
import org.mjdev.tvlib.R
Expand All @@ -33,7 +33,7 @@ import org.mjdev.tvlib.ui.components.card.ItemCard
@Composable
fun AppsRow(
title: Any? = R.string.title_apps,
rowState: TvLazyListState = rememberTvLazyListState(),
rowState: LazyListState = rememberLazyListState(),
padding: Dp = 8.dp,
backgroundColor: Color = Color.DarkGray.copy(alpha = 0.3f),
roundCornerSize: Dp = 8.dp,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Milan Jurkulák 2023.
* Copyright (c) Milan Jurkulák 2024.
* Contact:
* e: mimoccc@gmail.com
* e: mj@mjdev.org
Expand All @@ -10,20 +10,21 @@ package org.mjdev.tvlib.ui.components.tv

import android.os.Build
import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import kotlinx.coroutines.launch
import org.mjdev.tvlib.extensions.ComposeExt.isEditMode
import org.mjdev.tvlib.interfaces.ItemWithTitle
Expand Down Expand Up @@ -61,7 +62,7 @@ fun BrowseView(
onUserPicClicked: (() -> Unit)? = null,
onItemFocused: ((item: Any?, fromUser: Boolean) -> Unit)? = null,
onItemClicked: ((item: Any?) -> Unit)? = null,
state: TvLazyListState = rememberTvLazyListState(),
state: LazyListState = rememberLazyListState(),
isEdit: Boolean = isEditMode()
) {
val coroutineScope = rememberCoroutineScope()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -28,9 +30,8 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import org.mjdev.tvlib.annotations.Previews
import androidx.compose.foundation.lazy.items
import org.mjdev.tvlib.extensions.ComposeExt.computeCardWidth
import org.mjdev.tvlib.ui.components.card.PhotoCard
import org.mjdev.tvlib.ui.components.text.TextAny
Expand All @@ -41,7 +42,7 @@ import org.mjdev.tvlib.ui.components.text.TextAny
fun CategoryRow(
title: Any? = "category",
items: List<Any?> = listOf(Unit, Unit, Unit),
rowState: TvLazyListState = rememberTvLazyListState(),
rowState: LazyListState = rememberLazyListState(),
padding: Dp = 8.dp,
cardWidth: Dp = computeCardWidth(),
contentScale: ContentScale = ContentScale.Crop,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -33,8 +35,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import org.mjdev.tvlib.annotations.Previews
import org.mjdev.tvlib.extensions.ComposeExt.computeCardWidth
import org.mjdev.tvlib.extensions.CursorExt.getData
Expand All @@ -49,7 +49,7 @@ import org.mjdev.tvlib.ui.components.text.TextAny
@Composable
fun CursorRow(
title: Any? = null,
rowState: TvLazyListState = rememberTvLazyListState(),
rowState: LazyListState = rememberLazyListState(),
padding: Dp = 16.dp,
backgroundColor: Color = Color.DarkGray.copy(alpha = 0.3f),
roundCornerSize: Dp = 8.dp,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Milan Jurkulák 2023.
* Copyright (c) Milan Jurkulák 2024.
* Contact:
* e: mimoccc@gmail.com
* e: mj@mjdev.org
Expand All @@ -10,15 +10,15 @@ package org.mjdev.tvlib.ui.components.tv

import android.content.Context
import android.database.Cursor
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import org.mjdev.tvlib.R
import org.mjdev.tvlib.annotations.Previews
import org.mjdev.tvlib.extensions.ComposeExt.computeCardWidth
Expand All @@ -30,7 +30,7 @@ import org.mjdev.tvlib.helpers.cursor.CachingCursor.Companion.rememberCursor
@Composable
fun LocalAudioRow(
title: Any? = R.string.title_audio_local,
rowState: TvLazyListState = rememberTvLazyListState(),
rowState: LazyListState = rememberLazyListState(),
padding: Dp = 8.dp,
backgroundColor: Color = Color.DarkGray.copy(alpha = 0.3f),
roundCornerSize: Dp = 8.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ package org.mjdev.tvlib.ui.components.tv

import android.content.Context
import android.database.Cursor
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import org.mjdev.tvlib.R
import org.mjdev.tvlib.annotations.Previews
import org.mjdev.tvlib.extensions.ComposeExt.computeCardWidth
Expand All @@ -30,7 +30,7 @@ import org.mjdev.tvlib.data.local.PhotoItem
@Composable
fun LocalPhotosRow(
title: Any? = R.string.title_photo_local,
rowState: TvLazyListState = rememberTvLazyListState(),
rowState: LazyListState = rememberLazyListState(),
padding: Dp = 8.dp,
backgroundColor: Color = Color.DarkGray.copy(alpha = 0.3f),
roundCornerSize: Dp = 8.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ package org.mjdev.tvlib.ui.components.tv

import android.content.Context
import android.database.Cursor
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import org.mjdev.tvlib.R
import org.mjdev.tvlib.annotations.Previews
import org.mjdev.tvlib.extensions.ComposeExt.computeCardWidth
Expand All @@ -30,7 +30,7 @@ import org.mjdev.tvlib.data.local.VideoItem
@Composable
fun LocalVideoRow(
title: Any? = R.string.title_video_local,
rowState: TvLazyListState = rememberTvLazyListState(),
rowState: LazyListState = rememberLazyListState(),
padding: Dp = 8.dp,
backgroundColor: Color = Color.DarkGray.copy(alpha = 0.3f),
roundCornerSize: Dp = 8.dp,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Milan Jurkulák 2023.
* Copyright (c) Milan Jurkulák 2024.
* Contact:
* e: mimoccc@gmail.com
* e: mj@mjdev.org
Expand All @@ -13,17 +13,16 @@ import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.unit.dp
import androidx.tv.foundation.PivotOffsets
import androidx.tv.foundation.lazy.list.TvLazyColumn
import androidx.tv.foundation.lazy.list.TvLazyListScope
import androidx.tv.foundation.lazy.list.TvLazyListState
import androidx.tv.foundation.lazy.list.rememberTvLazyListState
import kotlinx.coroutines.launch
import org.mjdev.tvlib.annotations.Previews
import org.mjdev.tvlib.extensions.ModifierExt.onEditMode
Expand All @@ -38,17 +37,16 @@ fun ScrollableTvLazyColumn(
else Arrangement.Bottom,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
userScrollEnabled: Boolean = true,
pivotOffsets: PivotOffsets = PivotOffsets(),
state: TvLazyListState = rememberTvLazyListState(),
content: TvLazyListScope.() -> Unit = {}
state: LazyListState = rememberLazyListState(),
content: LazyListScope.() -> Unit = {}
) {
val scope = rememberCoroutineScope()
val scrollDelta: (delta: Float) -> Unit = { delta ->
scope.launch {
state.scrollBy(delta)
}
}
TvLazyColumn(
LazyColumn(
modifier = modifier
.onEditMode { fillMaxSize() }
.pointerInput(Unit) {
Expand All @@ -62,7 +60,6 @@ fun ScrollableTvLazyColumn(
verticalArrangement = verticalArrangement,
horizontalAlignment = horizontalAlignment,
userScrollEnabled = userScrollEnabled,
pivotOffsets = pivotOffsets,
content = {
content.invoke(this)
}
Expand Down
Loading

0 comments on commit e72482f

Please sign in to comment.