diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-02-23 02:12:26 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-02-23 02:12:26 +0000 |
commit | 3fa6969b750cb0effa7b134e8b7a198f36692637 (patch) | |
tree | 63e7692eb46180c1d5b74f63ad29bf4852f23885 /app/src/main/res | |
parent | ce4773230ab31e84b10b53793331ec6575ce553d (diff) | |
download | infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.tar infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.tar.gz infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.tar.bz2 infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.tar.lz infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.tar.xz infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.tar.zst infinity-for-reddit-3fa6969b750cb0effa7b134e8b7a198f36692637.zip |
Add a feature: Search for users. Fixed calling callback.onResult twice when loading user's posts.
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/fragment_subreddit_listing.xml | 47 | ||||
-rw-r--r-- | app/src/main/res/layout/item_footer_error.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/layout/item_subreddit_listing.xml | 48 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 9 |
4 files changed, 102 insertions, 10 deletions
diff --git a/app/src/main/res/layout/fragment_subreddit_listing.xml b/app/src/main/res/layout/fragment_subreddit_listing.xml new file mode 100644 index 00000000..d6fba93a --- /dev/null +++ b/app/src/main/res/layout/fragment_subreddit_listing.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/coordinator_layout_subreddit_listing_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".SubredditListingFragment"> + + <com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar + android:id="@+id/progress_bar_subreddit_listing_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + app:mlpb_progress_stoke_width="3dp" + app:mlpb_progress_color="@color/colorAccent" + android:layout_gravity="center_horizontal"/> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_view_subreddit_listing_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <LinearLayout + android:id="@+id/fetch_subreddit_listing_info_linear_layout_subreddit_listing_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical" + android:visibility="gone"> + + <ImageView + android:id="@+id/fetch_subreddit_listing_info_image_view_subreddit_listing_fragment" + android:layout_width="150dp" + android:layout_height="wrap_content" /> + + <TextView + android:id="@+id/fetch_subreddit_listing_info_text_view_subreddit_listing_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:gravity="center" /> + + </LinearLayout> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_footer_error.xml b/app/src/main/res/layout/item_footer_error.xml index bd653604..e1d3c14b 100644 --- a/app/src/main/res/layout/item_footer_error.xml +++ b/app/src/main/res/layout/item_footer_error.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/relative_layout_footer_progress_bar_item" + android:id="@+id/relative_layout_footer_error_item" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -9,16 +9,16 @@ android:layout_marginBottom="16dp"> <TextView + android:id="@+id/error_text_view_footer_error_item" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_centerVertical="true" - android:layout_toStartOf="@id/retry_button_footer_progress_bar_item" - android:text="@string/load_data_failed" + android:layout_toStartOf="@id/retry_button_footer_error_item" android:textSize="18sp" /> <Button - android:id="@+id/retry_button_footer_progress_bar_item" + android:id="@+id/retry_button_footer_error_item" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" diff --git a/app/src/main/res/layout/item_subreddit_listing.xml b/app/src/main/res/layout/item_subreddit_listing.xml new file mode 100644 index 00000000..10d5055a --- /dev/null +++ b/app/src/main/res/layout/item_subreddit_listing.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/constraint_layout_item_subreddit_listing" + 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/subreddit_icon_gif_image_view_item_subreddit_listing" + android:layout_width="36dp" + android:layout_height="36dp" + android:layout_gravity="center_vertical" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + <TextView + android:id="@+id/subreddit_name_text_view_item_subreddit_listing" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginStart="32dp" + android:textColor="@android:color/black" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/subreddit_icon_gif_image_view_item_subreddit_listing" + app:layout_constraintTop_toTopOf="parent" /> + + <ImageView + android:id="@+id/subscribe_image_view_item_subreddit_listing" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + + android:src="@drawable/baseline_add_white_24" + android:tint="@color/colorPrimary" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground" + android:visibility="gone"/> + +</androidx.constraintlayout.widget.ConstraintLayout>
\ 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 a8058872..d286b264 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,8 +14,9 @@ <string name="tap_to_retry">Error loading image. Tap to retry.</string> <string name="load_posts_error">Error loading posts.\nTap to retry.</string> <string name="no_posts">No posts here.</string> + <string name="no_subreddits">No subreddits found.</string> - <string name="load_data_failed">Cannot load posts</string> + <string name="load_posts_failed">Error loading posts</string> <string name="load_comment_failed">Error loading comments</string> <string name="load_more_comment_failed">Error loading more comments</string> <string name="retry">Retry</string> @@ -56,9 +57,5 @@ <string name="app_label">Infinity</string> <string name="search_hint">Search anything</string> - <string name="title_activity_search">Search</string> - <string name="section_format">Hello World from section: %1$d</string> - <string name="tab_text_1">Tab 1</string> - <string name="tab_text_2">Tab 2</string> - <string name="tab_text_3">Tab 3</string> + </resources> |