Skip to content

Commit 700c1b4

Browse files
committed
Removed unnecessary layout
Moved the feed button up a bit
1 parent 4b4337e commit 700c1b4

2 files changed

Lines changed: 16 additions & 25 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
151151
!recyclerView.canScrollVertically(-1)
152152
) {
153153

154-
if (feedBinding.newItemsLoadedLayout.isVisible) {
154+
if (feedBinding.newItemsLoadedButton.isVisible) {
155155
hideNewItemsLoaded(true)
156156
}
157157
}
@@ -619,8 +619,8 @@ class FeedFragment : BaseStateFragment<FeedState>() {
619619
}
620620

621621
private fun showNewItemsLoaded() {
622-
feedBinding.newItemsLoadedLayout.clearAnimation()
623-
feedBinding.newItemsLoadedLayout
622+
feedBinding.newItemsLoadedButton.clearAnimation()
623+
feedBinding.newItemsLoadedButton
624624
.slideUp(
625625
250L,
626626
delay = 100,
@@ -636,20 +636,20 @@ class FeedFragment : BaseStateFragment<FeedState>() {
636636
}
637637

638638
private fun hideNewItemsLoaded(animate: Boolean, delay: Long = 0) {
639-
feedBinding.newItemsLoadedLayout.clearAnimation()
639+
feedBinding.newItemsLoadedButton.clearAnimation()
640640
if (animate) {
641-
feedBinding.newItemsLoadedLayout.animate(
641+
feedBinding.newItemsLoadedButton.animate(
642642
false,
643643
200,
644644
delay = delay,
645645
execOnEnd = {
646646
// Make the layout invisible so that the onScroll toTop method
647647
// only does necessary work
648-
feedBinding?.newItemsLoadedLayout?.isVisible = false
648+
feedBinding?.newItemsLoadedButton?.isVisible = false
649649
}
650650
)
651651
} else {
652-
feedBinding.newItemsLoadedLayout.isVisible = false
652+
feedBinding.newItemsLoadedButton.isVisible = false
653653
}
654654
}
655655

app/src/main/res/layout/fragment_feed.xml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,16 @@
8787

8888
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
8989

90-
<androidx.constraintlayout.widget.ConstraintLayout
91-
android:id="@+id/new_items_loaded_layout"
92-
android:layout_width="match_parent"
90+
<Button
91+
android:id="@+id/new_items_loaded_button"
92+
android:layout_width="wrap_content"
9393
android:layout_height="wrap_content"
94-
android:layout_alignParentBottom="true"
95-
android:visibility="gone"
96-
tools:visibility="visible">
97-
98-
<Button
99-
android:id="@+id/new_items_loaded_button"
100-
android:layout_width="wrap_content"
101-
android:layout_height="wrap_content"
102-
android:text="@string/feed_new_items"
103-
android:textSize="12sp"
104-
android:theme="@style/ServiceColoredButton"
105-
app:layout_constraintBottom_toBottomOf="parent"
106-
app:layout_constraintLeft_toLeftOf="parent"
107-
app:layout_constraintRight_toRightOf="parent" />
108-
</androidx.constraintlayout.widget.ConstraintLayout>
94+
android:layout_alignBottom="@id/swipeRefreshLayout"
95+
android:layout_centerHorizontal="true"
96+
android:layout_marginBottom="5sp"
97+
android:text="@string/feed_new_items"
98+
android:textSize="12sp"
99+
android:theme="@style/ServiceColoredButton" />
109100

110101
<LinearLayout
111102
android:layout_width="wrap_content"

0 commit comments

Comments
 (0)