aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2018-08-05 04:26:50 +0000
committerAlex Ning <chineseperson5@gmail.com>2018-08-05 04:26:50 +0000
commitc6026e5659a16ae1d2b3b72a1bafafd0ba467f12 (patch)
tree5f4d08ee68a753cb40e6f6bf8041f65ea3751bff /app/src/main/res
parent9334d3860eb37156a7614ec37b0075bf82bbabba (diff)
downloadinfinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.tar
infinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.tar.gz
infinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.tar.bz2
infinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.tar.lz
infinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.tar.xz
infinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.tar.zst
infinity-for-reddit-c6026e5659a16ae1d2b3b72a1bafafd0ba467f12.zip
Fetch the subreddit info and save it to the database. Solve a bug that cannot create a instance of SubredditViewModel.
Diffstat (limited to '')
-rw-r--r--app/src/main/res/layout/activity_view_subreddit_detail.xml48
-rw-r--r--app/src/main/res/values/strings.xml2
2 files changed, 33 insertions, 17 deletions
diff --git a/app/src/main/res/layout/activity_view_subreddit_detail.xml b/app/src/main/res/layout/activity_view_subreddit_detail.xml
index 58b808f9..a840154b 100644
--- a/app/src/main/res/layout/activity_view_subreddit_detail.xml
+++ b/app/src/main/res/layout/activity_view_subreddit_detail.xml
@@ -29,13 +29,12 @@
<ImageView
android:id="@+id/banner_image_view_view_subreddit_detail_activity"
- android:src="@drawable/subreddit_default_icon"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="180dp" />
<de.hdodenhof.circleimageview.CircleImageView
- android:src="@drawable/subreddit_default_icon"
+ android:id="@+id/icon_circle_image_view_view_subreddit_detail_activity"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginTop="-36dp"
@@ -53,22 +52,46 @@
android:background="@android:color/white">
<TextView
- android:id="@+id/name_text_view_view_subreddit_detail_activity"
+ android:id="@+id/subreddit_name_text_view_view_subreddit_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
- android:textColor="@android:color/black"
- android:text="Dummy"/>
+ android:textSize="18sp"
+ android:textColor="@color/colorAccent"/>
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/subscriber_count_text_view_view_subreddit_detail_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:textColor="@android:color/black" />
+
+ <TextView
+ android:id="@+id/online_subscriber_count_text_view_view_subreddit_detail_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_alignParentEnd="true"
+ android:textColor="@android:color/black" />
+
+ </RelativeLayout>
<TextView
- android:id="@+id/subscriber_count_text_view_view_subreddit_detail_activity"
+ android:id="@+id/description_text_view_view_subreddit_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
- android:textColor="@android:color/black"
- android:text="Subscriber: 10000"/>
+ android:textColor="@android:color/black" />
</LinearLayout>
@@ -86,13 +109,4 @@
<include layout="@layout/content_view_subreddit_detail" />
- <android.support.design.widget.FloatingActionButton
- android:id="@+id/fab"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/fab_margin"
- app:layout_anchor="@id/app_bar_layout_view_subreddit_detail_activity"
- app:layout_anchorGravity="bottom|end"
- app:srcCompat="@drawable/baseline_add_white_24" />
-
</android.support.design.widget.CoordinatorLayout> \ 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 00eb8251..f1a80eb3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -20,6 +20,8 @@
<string name="following">Following</string>
<string name="subscriptions">Subscriptions</string>
<string name="title_activity_view_subreddit_detail">ViewSubredditDetailActivity</string>
+ <string name="subscribers_number_detail">Subscribers: %1$d</string>
+ <string name="online_subscribers_number_detail">Online: %1$d</string>
<string name="large_text">
"Material is the metaphor.\n\n"