Skip to content

Commit

Permalink
Experiments with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulyaara committed Feb 19, 2024
1 parent fc66d58 commit c2e6335
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions ui/common/src/main/java/org/kafka/common/extensions/elevation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.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
}
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)
} else {
// If not the first element, always set elevation and show the shadow
24.dp
}
}
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
import org.kafka.common.extensions.Elevation.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
import org.kafka.common.extensions.Elevation.elevation
import org.kafka.common.test.testTagUi
import org.kafka.common.widgets.shadowMaterial
import org.kafka.navigation.LocalNavigator
Expand Down

0 comments on commit c2e6335

Please sign in to comment.