aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2018-07-28 05:45:01 +0000
committerAlex Ning <chineseperson5@gmail.com>2018-07-28 05:45:01 +0000
commite3653eb503f4396903bcdd1423510f7c4893dde9 (patch)
treeb5a2ccf41ddd6ed7766adf9518d3bd9d94de7607 /app/src/main/res
parent0e6d4ae525d4b0727d9e131195f33ec74cff8861 (diff)
downloadinfinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.tar
infinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.tar.gz
infinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.tar.bz2
infinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.tar.lz
infinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.tar.xz
infinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.tar.zst
infinity-for-reddit-e3653eb503f4396903bcdd1423510f7c4893dde9.zip
Add a RecyclerView for subscribed subreddits in navigation drawer, rewrite some code and minor bugs fixed
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/activity_main.xml56
-rw-r--r--app/src/main/res/layout/item_subscribed_subreddit.xml24
-rw-r--r--app/src/main/res/values/strings.xml3
3 files changed, 77 insertions, 6 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index db65bf75..8d43bd79 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -18,9 +18,59 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
- android:fitsSystemWindows="true"
- app:headerLayout="@layout/nav_header_main"
- app:menu="@menu/activity_main_drawer" />
+ 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: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="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: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>
+
+ </android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
diff --git a/app/src/main/res/layout/item_subscribed_subreddit.xml b/app/src/main/res/layout/item_subscribed_subreddit.xml
index d8fb3247..3795aa62 100644
--- a/app/src/main/res/layout/item_subscribed_subreddit.xml
+++ b/app/src/main/res/layout/item_subscribed_subreddit.xml
@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="wrap_content"
+ android:padding="16dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground">
-</android.support.constraint.ConstraintLayout> \ No newline at end of file
+ <de.hdodenhof.circleimageview.CircleImageView
+ android:id="@+id/subreddit_icon_circle_image_view_item_subscribed_subreddit"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_gravity="center_vertical"
+ android:layout_marginEnd="32dp"/>
+
+ <TextView
+ android:id="@+id/subreddit_name_text_view_item_subscribed_subreddit"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@android:color/black"
+ android:layout_gravity="center_vertical"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2f36e7c0..38b51769 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -15,4 +15,7 @@
<string name="nsfw">NSFW</string>
<string name="karma_info">Karma: %1$d</string>
+
+ <string name="profile">Profile</string>
+ <string name="subscriptions">Subscriptions</string>
</resources>