Start implementing showing subscribed subreddits in the nav drawer. Use a RecyclerView to display all the items in the nav drawer.

This commit is contained in:
Alex Ning
2020-02-19 09:59:12 +08:00
parent 8c454d52c7
commit 248aca0fb9
7 changed files with 401 additions and 36 deletions

View File

@@ -20,7 +20,14 @@
android:layout_gravity="start"
android:background="?attr/backgroundColor">
<androidx.core.widget.NestedScrollView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/nav_drawer_recycler_view_main_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:clipToPadding="false" />
<!--<androidx.core.widget.NestedScrollView
android:id="@+id/nested_scroll_view_main_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -237,7 +244,7 @@
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>-->
</com.google.android.material.navigation.NavigationView>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dividerColor" />

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/label_post"
android:textSize="?attr/font_default" />

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawablePadding="32dp"
android:focusable="true"
android:gravity="center_vertical"
android:padding="16dp"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/thing_icon_gif_image_view_item_nav_drawer_subscribed_thing"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="32dp" />
<TextView
android:id="@+id/thing_name_text_view_item_nav_drawer_subscribed_thing"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:layout_gravity="center_vertical" />
</LinearLayout>