Skip to content

Commit

Permalink
Fix scrolling of reader announcement card
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLukas committed May 17, 2024
1 parent 2b7e362 commit 5c9f9bc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ fun ReaderAnnouncementCard(
items: List<ReaderAnnouncementCardItemData>
) {
Column(
modifier = Modifier.fillMaxWidth(),
modifier = Modifier
.fillMaxWidth()
.padding(Margin.ExtraLarge.value),
verticalArrangement = Arrangement.spacedBy(Margin.ExtraLarge.value),
) {
// Title
Expand All @@ -61,9 +63,6 @@ fun ReaderAnnouncementCard(
// Done button
Button(
modifier = Modifier
.padding(
horizontal = Margin.Large.value,
)
.fillMaxWidth(),
onClick = { },
elevation = ButtonDefaults.elevation(0.dp),
Expand Down Expand Up @@ -145,7 +144,6 @@ fun ReaderTagsFeedPostListItemPreview() {
Box(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
) {
ReaderAnnouncementCard(
items = listOf(
Expand Down
55 changes: 35 additions & 20 deletions WordPress/src/main/res/layout/reader_fragment_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,45 @@

</com.google.android.material.appbar.AppBarLayout>

<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:paddingBottom="56dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<FrameLayout
android:id="@+id/container"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reader_announcement_card_compose_view" />

<androidx.compose.ui.platform.ComposeView
android:id="@+id/reader_announcement_card_compose_view"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways" />

</LinearLayout>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<FrameLayout
android:id="@+id/interests_fragment_container"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<include
android:id="@+id/jetpack_banner"
layout="@layout/jetpack_banner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

<include
android:id="@+id/jetpack_banner"
layout="@layout/jetpack_banner" />

<FrameLayout
android:id="@+id/interests_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 comments on commit 5c9f9bc

Please sign in to comment.