Skip to content

Commit

Permalink
Bump Compose to v1.7.0-alpha02
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Jul 28, 2024
1 parent c5c073a commit 2def4c6
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "2.0.0"
android_gradle_plugin = "8.5.1"
compose = "1.6.11"
compose = "1.7.0-alpha02"

android_sdk_compile = "34"
android_sdk_target = "34"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ fun FeedInfoBottomSheet(
onDismissRequest = { feedPresenter.dispatch(FeedEvent.BackClicked) },
containerColor = AppTheme.colorScheme.tintedBackground,
contentColor = Color.Unspecified,
windowInsets =
contentWindowInsets = {
WindowInsets.systemBars
.only(WindowInsetsSides.Bottom)
.union(WindowInsets.ime.only(WindowInsetsSides.Bottom)),
.union(WindowInsets.ime.only(WindowInsetsSides.Bottom))
},
sheetState = SheetState(skipPartiallyExpanded = true, density = LocalDensity.current),
scrimColor = SYSTEM_SCRIM
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ fun GroupSelectionSheet(presenter: GroupSelectionPresenter, modifier: Modifier =
onDismissRequest = { presenter.dispatch(GroupSelectionEvent.BackClicked) },
containerColor = AppTheme.colorScheme.tintedBackground,
contentColor = Color.Unspecified,
windowInsets =
contentWindowInsets = {
WindowInsets.systemBars
.only(WindowInsetsSides.Bottom)
.union(WindowInsets.ime.only(WindowInsetsSides.Bottom)),
.union(WindowInsets.ime.only(WindowInsetsSides.Bottom))
},
sheetState = SheetState(skipPartiallyExpanded = true, density = LocalDensity.current),
scrimColor = SYSTEM_SCRIM
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import dev.sasikanth.rss.reader.ui.AppTheme
import dev.sasikanth.rss.reader.util.relativeDurationString
import dev.sasikanth.rss.reader.utils.Constants
import dev.sasikanth.rss.reader.utils.LocalWindowSizeClass
import dev.sasikanth.rss.reader.utils.getOffsetFractionForPage

private val featuredImageAspectRatio: Float
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import dev.sasikanth.rss.reader.ui.AppTheme
import dev.sasikanth.rss.reader.util.canBlurImage
import dev.sasikanth.rss.reader.utils.Constants.EPSILON
import dev.sasikanth.rss.reader.utils.LocalWindowSizeClass
import dev.sasikanth.rss.reader.utils.getOffsetFractionForPage
import kotlin.math.absoluteValue
import kotlinx.collections.immutable.ImmutableList
import kotlinx.coroutines.flow.collectLatest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package dev.sasikanth.rss.reader.ui

import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material.ripple.RippleAlpha
import androidx.compose.material.ripple.RippleTheme
import androidx.compose.material3.LocalRippleConfiguration
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.RippleConfiguration
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
Expand All @@ -42,7 +42,11 @@ internal fun AppTheme(
) {
CompositionLocalProvider(
LocalAppColorScheme provides appColorScheme,
LocalRippleTheme provides AppRippleTheme
LocalRippleConfiguration provides
RippleConfiguration(
color = AppTheme.colorScheme.tintedForeground,
rippleAlpha = DefaultRippleAlpha
)
) {
content()
}
Expand All @@ -55,13 +59,6 @@ internal object AppTheme {
@Composable @ReadOnlyComposable get() = LocalAppColorScheme.current
}

private object AppRippleTheme : RippleTheme {

@Composable override fun defaultColor() = AppTheme.colorScheme.tintedForeground

@Composable override fun rippleAlpha(): RippleAlpha = DefaultRippleAlpha
}

private val GolosFontFamily: FontFamily
@Composable
get() =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2024 Sasikanth Miriyampalli
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sasikanth.rss.reader.utils

import androidx.compose.foundation.pager.PagerState

fun PagerState.getOffsetFractionForPage(page: Int): Float {
return (currentPage - page) + currentPageOffsetFraction
}

0 comments on commit 2def4c6

Please sign in to comment.