Skip to content

Commit

Permalink
Github release changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulyaara committed Mar 18, 2024
1 parent 42ba282 commit 31ec69c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android.enableR8.fullMode=true
# Run 'aapt optimize' on resources to minimize their APK size impact.
android.enableResourceOptimizations=true

org.gradle.jvmargs=-Xmx3072m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx6020m -Dfile.encoding=UTF-8

# https://docs.gradle.org/7.6/userguide/configuration_cache.html
org.gradle.unsafe.configuration-cache=true
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ include ':ui:webview'

include ':core-playback'
include ':ui-playback'
project(':core-playback').projectDir = new File(settingsDir, '/Sarahang/core-playback')
project(':ui-playback').projectDir = new File(settingsDir, '/Sarahang/ui-playback')
project(':core-playback').projectDir = new File(settingsDir, '../Sarahang/core-playback')
project(':ui-playback').projectDir = new File(settingsDir, '../Sarahang/ui-playback')
40 changes: 32 additions & 8 deletions ui/common/src/main/java/org/kafka/common/extensions/elevation.kt
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
package org.kafka.common.extensions

import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.grid.LazyGridState
import androidx.compose.runtime.derivedStateOf
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import ui.common.theme.theme.Dimens

object Elevation {
val LazyListState.elevation: Dp
get() = if (firstVisibleItemIndex == 0) {
// For the first element, use the minimum of scroll offset and default elevation
// i.e. a value between 0 and 4.dp
minOf(firstVisibleItemScrollOffset.toFloat().dp, 24.dp)
val ScrollState.elevation
get() = derivedStateOf {
this.run { ((value / 100) * 2).coerceAtMost(MaxElevation).dp } ?: 0.dp
}

val LazyListState.elevation: Dp
get() = if (firstVisibleItemIndex == 0) {
// For the first element, use the minimum of scroll offset and default elevation
// i.e. a value between 0 and 4.dp
minOf(firstVisibleItemScrollOffset.toFloat().dp, 24.dp)
} else {
// If not the first element, always set elevation and show the shadow
24.dp
}


val LazyListState?.elevation
get() = derivedStateOf {
if (this?.firstVisibleItemIndex == 0) {
minOf(firstVisibleItemScrollOffset.toFloat().dp, MaxElevation.dp)
} else {
// If not the first element, always set elevation and show the shadow
24.dp
Dimens.Spacing20
}
}


fun LazyGridState.elevation(maxElevation: Int = 40) = derivedStateOf {
this.run { firstVisibleItemScrollOffset.coerceAtMost(maxElevation) }.dp
}

private const val MaxElevation = 20
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.kafka.data.entities.RecentItem
import kotlinx.collections.immutable.ImmutableList
import org.kafka.common.extensions.Elevation.elevation
import org.kafka.common.extensions.elevation
import org.kafka.common.widgets.shadowMaterial
import org.kafka.homepage.R
import org.kafka.navigation.LocalNavigator
Expand Down
2 changes: 1 addition & 1 deletion ui/item/src/main/java/org/kafka/item/files/Files.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.kafka.data.entities.File
import kotlinx.coroutines.CoroutineScope
import org.kafka.common.extensions.Elevation.elevation
import org.kafka.common.extensions.elevation
import org.kafka.common.test.testTagUi
import org.kafka.common.widgets.shadowMaterial
import org.kafka.navigation.LocalNavigator
Expand Down

0 comments on commit 31ec69c

Please sign in to comment.