diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-02-19 01:59:12 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-02-19 01:59:12 +0000 |
commit | 248aca0fb9f64eb66ec6214f60f51be3de181899 (patch) | |
tree | 550a9d106941fc64513f273a81141bfe0f283af6 /app/src/main/res | |
parent | 8c454d52c7c55af04c52d07bab5d16355d159406 (diff) | |
download | infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.tar infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.tar.gz infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.tar.bz2 infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.tar.lz infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.tar.xz infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.tar.zst infinity-for-reddit-248aca0fb9f64eb66ec6214f60f51be3de181899.zip |
Start implementing showing subscribed subreddits in the nav drawer. Use a RecyclerView to display all the items in the nav drawer.
Diffstat (limited to 'app/src/main/res')
5 files changed, 60 insertions, 2 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 798dd9c3..a47d4fc8 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -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> diff --git a/app/src/main/res/layout/item_nav_drawer_divider.xml b/app/src/main/res/layout/item_nav_drawer_divider.xml new file mode 100644 index 00000000..c0e73dff --- /dev/null +++ b/app/src/main/res/layout/item_nav_drawer_divider.xml @@ -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" />
\ No newline at end of file diff --git a/app/src/main/res/layout/item_nav_drawer_menu_group_title.xml b/app/src/main/res/layout/item_nav_drawer_menu_group_title.xml new file mode 100644 index 00000000..5db89c04 --- /dev/null +++ b/app/src/main/res/layout/item_nav_drawer_menu_group_title.xml @@ -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" />
\ No newline at end of file diff --git a/app/src/main/res/layout/item_nav_drawer_menu_item.xml b/app/src/main/res/layout/item_nav_drawer_menu_item.xml new file mode 100644 index 00000000..4e9f911f --- /dev/null +++ b/app/src/main/res/layout/item_nav_drawer_menu_item.xml @@ -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" />
\ No newline at end of file diff --git a/app/src/main/res/layout/item_nav_drawer_subscribed_thing.xml b/app/src/main/res/layout/item_nav_drawer_subscribed_thing.xml new file mode 100644 index 00000000..0dc934fe --- /dev/null +++ b/app/src/main/res/layout/item_nav_drawer_subscribed_thing.xml @@ -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>
\ No newline at end of file |