Skip to content

Commit c607089

Browse files
committed
Altered grid view similar to Youtube app layout
1 parent 2846434 commit c607089

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupCarouselItem.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.schabi.newpipe.local.subscription.item
33
import android.content.Context
44
import android.os.Parcelable
55
import android.view.View
6+
import androidx.recyclerview.widget.GridLayoutManager
67
import androidx.recyclerview.widget.LinearLayoutManager
78
import com.xwray.groupie.GroupAdapter
89
import com.xwray.groupie.viewbinding.BindableItem
@@ -43,7 +44,7 @@ class FeedGroupCarouselItem(
4344
adapter = carouselAdapter
4445
addItemDecoration(feedGroupCarouselDecoration)
4546
}
46-
47+
viewHolder.recyclerView.setLayoutManager(GridLayoutManager(view.context, 3))
4748
return viewHolder
4849
}
4950

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
5-
android:layout_width="64dp"
6-
android:layout_height="48dp"
7-
android:layout_gravity="center_vertical"
5+
android:layout_width="112dp"
6+
android:layout_height="75dp"
7+
android:layout_gravity="center"
88
android:clickable="true"
99
android:focusable="true"
1010
android:foreground="?attr/selectableItemBackground"
@@ -25,6 +25,8 @@
2525
android:paddingTop="2dp"
2626
android:paddingBottom="2dp"
2727
android:scaleType="fitCenter"
28+
android:scaleX="1.5"
29+
android:scaleY="1.5"
2830
tools:ignore="ContentDescription"
2931
tools:src="@drawable/ic_fastfood" />
3032

@@ -39,7 +41,7 @@
3941
android:padding="2dp"
4042
android:textAllCaps="false"
4143
android:textColor="?attr/colorAccent"
42-
android:textSize="10sp"
44+
android:textSize="14sp"
4345
android:textStyle="bold"
4446
tools:ignore="SmallSp"
4547
tools:text="ALL" />

app/src/main/res/values/dimens.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
<!-- Feed Groups dimensions-->
127127
<dimen name="feed_group_carousel_start_end_margin">12dp</dimen>
128-
<dimen name="feed_group_carousel_top_bottom_margin">4dp</dimen>
128+
<dimen name="feed_group_carousel_top_bottom_margin">12dp</dimen>
129129
<dimen name="feed_group_carousel_between_items_margin">4dp</dimen>
130130

131131
<dimen name="search_suggestion_text_size">16sp</dimen>

0 commit comments

Comments
 (0)