diff options
author | Alex Ning <chineseperson5@gmail.com> | 2018-07-29 12:25:55 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2018-07-29 12:25:55 +0000 |
commit | ddc7b36e72dee19b87204beacc8322ca221b5524 (patch) | |
tree | d3e6475c0e135d732b0d2591142113c88898a491 /app/src/main/res | |
parent | e3653eb503f4396903bcdd1423510f7c4893dde9 (diff) | |
download | infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.tar infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.tar.gz infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.tar.bz2 infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.tar.lz infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.tar.xz infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.tar.zst infinity-for-reddit-ddc7b36e72dee19b87204beacc8322ca221b5524.zip |
Save subscribed subreddits and users to the SQLite database by using Room Persistence Library. Add a following section in the navigation drawer to display all the followed users. Add a NestedScrollView in the navigation drawer to wrap all the elements. Disable nested scrolling feature in all the RecyclerViews in the navigation drawer.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 121 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 1 |
2 files changed, 71 insertions, 51 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 8d43bd79..5f50b6fa 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -13,64 +13,83 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - <android.support.design.widget.NavigationView - android:id="@+id/nav_view" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_gravity="start" - android:fitsSystemWindows="true"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - - <include - android:id="@+id/nav_header_main_activity" - layout="@layout/nav_header_main" /> - - <LinearLayout + <android.support.design.widget.NavigationView + android:id="@+id/nav_view" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_gravity="start" + android:fitsSystemWindows="true"> + + <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="16dp" - android:clickable="true" - android:focusable="true" - android:background="?attr/selectableItemBackground"> - - <ImageView - android:layout_width="24dp" - android:layout_height="24dp" - android:layout_marginEnd="32dp" - android:layout_gravity="center_vertical" - android:src="@drawable/ic_account_circle_grey_24dp"/> - - <TextView - android:layout_width="wrap_content" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="@string/profile" - android:textColor="@android:color/black" - android:layout_gravity="center_vertical"/> + android:orientation="vertical"> - </LinearLayout> + <include + android:id="@+id/nav_header_main_activity" + layout="@layout/nav_header_main" /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#E0E0E0"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/subscriptions" - android:layout_margin="16dp"/> + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_marginEnd="32dp" + android:layout_gravity="center_vertical" + android:src="@drawable/ic_account_circle_grey_24dp"/> - <android.support.v7.widget.RecyclerView - android:id="@+id/subscribed_subreddit_recycler_view_main_activity" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/profile" + android:textColor="@android:color/black" + android:layout_gravity="center_vertical"/> + + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#E0E0E0"/> + + <TextView + android:id="@+id/following_label_main_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/following" + android:layout_margin="16dp"/> + + <android.support.v7.widget.RecyclerView + android:id="@+id/subscribed_user_recycler_view_main_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <TextView + android:id="@+id/subscriptions_label_main_activity" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/subscriptions" + android:layout_margin="16dp"/> + + <android.support.v7.widget.RecyclerView + android:id="@+id/subscribed_subreddit_recycler_view_main_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + </LinearLayout> - </LinearLayout> + </android.support.v4.widget.NestedScrollView> - </android.support.design.widget.NavigationView> + </android.support.design.widget.NavigationView> </android.support.v4.widget.DrawerLayout> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 38b51769..1b973d6b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,5 +17,6 @@ <string name="karma_info">Karma: %1$d</string> <string name="profile">Profile</string> + <string name="following">Following</string> <string name="subscriptions">Subscriptions</string> </resources> |