Altered grid view similar to Youtube app layout

This commit is contained in:
Samuel Wu 2022-10-26 00:06:48 +11:00
parent 28464344c1
commit c607089cbb
3 changed files with 9 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package org.schabi.newpipe.local.subscription.item
import android.content.Context
import android.os.Parcelable
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.xwray.groupie.GroupAdapter
import com.xwray.groupie.viewbinding.BindableItem
@ -43,7 +44,7 @@ class FeedGroupCarouselItem(
adapter = carouselAdapter
addItemDecoration(feedGroupCarouselDecoration)
}
viewHolder.recyclerView.setLayoutManager(GridLayoutManager(view.context, 3))
return viewHolder
}

View File

@ -2,9 +2,9 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="64dp"
android:layout_height="48dp"
android:layout_gravity="center_vertical"
android:layout_width="112dp"
android:layout_height="75dp"
android:layout_gravity="center"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
@ -25,6 +25,8 @@
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:scaleType="fitCenter"
android:scaleX="1.5"
android:scaleY="1.5"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_fastfood" />
@ -39,7 +41,7 @@
android:padding="2dp"
android:textAllCaps="false"
android:textColor="?attr/colorAccent"
android:textSize="10sp"
android:textSize="14sp"
android:textStyle="bold"
tools:ignore="SmallSp"
tools:text="ALL" />

View File

@ -125,7 +125,7 @@
<!-- Feed Groups dimensions-->
<dimen name="feed_group_carousel_start_end_margin">12dp</dimen>
<dimen name="feed_group_carousel_top_bottom_margin">4dp</dimen>
<dimen name="feed_group_carousel_top_bottom_margin">12dp</dimen>
<dimen name="feed_group_carousel_between_items_margin">4dp</dimen>
<dimen name="search_suggestion_text_size">16sp</dimen>