Skip to content

Commit

Permalink
Moves modifier to the scaffold instead of the pager component. (#2475)
Browse files Browse the repository at this point in the history
* Moves modifier to the scaffold instead of the pager component.

Also the `pageNestedScrollConnection` parameter was redundant and has been removed from `PagerScreen`.

---------

Co-authored-by: yschimke <[email protected]>
  • Loading branch information
yschimke and yschimke authored Dec 6, 2024
1 parent 6cd025b commit 3400c2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion compose-layout/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ package com.google.android.horologist.compose.pager {
}

public final class PagerScreenKt {
method @androidx.compose.runtime.Composable public static void PagerScreen(androidx.wear.compose.foundation.pager.PagerState state, optional androidx.compose.ui.Modifier modifier, optional int beyondViewportPageCount, optional boolean userScrollEnabled, optional boolean reverseLayout, optional kotlin.jvm.functions.Function1<? super java.lang.Integer,?>? key, optional androidx.compose.ui.input.nestedscroll.NestedScrollConnection pageNestedScrollConnection, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> content);
method @androidx.compose.runtime.Composable public static void PagerScreen(androidx.wear.compose.foundation.pager.PagerState state, optional androidx.compose.ui.Modifier modifier, optional int beyondViewportPageCount, optional boolean userScrollEnabled, optional boolean reverseLayout, optional kotlin.jvm.functions.Function1<? super java.lang.Integer,?>? key, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> content);
}

public final class VerticalPageIndicatorKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
package com.google.android.horologist.compose.pager

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.pager.PagerDefaults
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
Expand All @@ -31,7 +29,6 @@ import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.platform.LocalConfiguration
import androidx.wear.compose.foundation.ExperimentalWearFoundationApi
import androidx.wear.compose.foundation.HierarchicalFocusCoordinator
Expand All @@ -55,18 +52,13 @@ public fun PagerScreen(
userScrollEnabled: Boolean = true,
reverseLayout: Boolean = false,
key: ((index: Int) -> Any)? = null,
pageNestedScrollConnection: NestedScrollConnection = PagerDefaults.pageNestedScrollConnection(
state,
Orientation.Horizontal,
),
content: @Composable (Int) -> Unit,
) {
PagerScaffold(
modifier = Modifier.fillMaxSize(),
modifier = modifier.fillMaxSize(),
pagerState = state,
) {
HorizontalPager(
modifier = modifier,
state = state,
beyondViewportPageCount = beyondViewportPageCount,
userScrollEnabled = userScrollEnabled,
Expand Down

0 comments on commit 3400c2a

Please sign in to comment.