From 3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 28 Oct 2019 21:17:09 +0800 Subject: Use FlowLayout to host all the information of a post in item_post and item_post_detail. --- .../Adapter/CommentAndPostRecyclerViewAdapter.java | 11 -- .../Adapter/PostRecyclerViewAdapter.java | 11 -- .../Settings/AcknowledgementFragment.java | 3 + app/src/main/res/drawable/gold.xml | 4 +- app/src/main/res/layout/item_post.xml | 144 +++++++------------- app/src/main/res/layout/item_post_detail.xml | 146 +++++++-------------- 6 files changed, 107 insertions(+), 212 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index 825a3a1a..84585046 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -15,7 +15,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; @@ -359,7 +358,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter 0) { - ((PostDetailViewHolder) holder).mGildedImageView.setVisibility(View.VISIBLE); ((PostDetailViewHolder) holder).mGildedNumberTextView.setVisibility(View.VISIBLE); String gildedNumber = mActivity.getResources().getString(R.string.gilded_count, mPost.getGilded()); ((PostDetailViewHolder) holder).mGildedNumberTextView.setText(gildedNumber); @@ -373,10 +371,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter 0) { - ((DataViewHolder) holder).gildedImageView.setVisibility(View.VISIBLE); ((DataViewHolder) holder).gildedNumberTextView.setVisibility(View.VISIBLE); String gildedNumber = mContext.getResources().getString(R.string.gilded_count, gilded); ((DataViewHolder) holder).gildedNumberTextView.setText(gildedNumber); @@ -334,10 +333,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter + diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml index c09582f5..c702e529 100644 --- a/app/src/main/res/layout/item_post.xml +++ b/app/src/main/res/layout/item_post.xml @@ -94,10 +94,13 @@ android:textSize="?attr/content_font_default" android:ellipsize="end" /> - + android:padding="16dp" + app:flChildSpacing="16dp" + app:flChildSpacingForLastRow="align" + app:flRowSpacing="8dp"> - - - - - - - - - - - - - - @@ -226,7 +151,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginStart="16dp" android:textSize="?attr/font_12" android:textColor="@android:color/white" android:padding="4dp" @@ -237,7 +161,41 @@ app:lib_setRoundedView="true" app:lib_setShape="rectangle" /> - + + + + + + + + + - + android:padding="16dp" + app:flChildSpacing="16dp" + app:flChildSpacingForLastRow="align" + app:flRowSpacing="8dp"> - - - - - - - - - - - - - - @@ -219,7 +142,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginStart="16dp" android:padding="4dp" android:textSize="?attr/font_12" android:textColor="@android:color/white" @@ -230,7 +152,41 @@ app:lib_setRoundedView="true" app:lib_setShape="rectangle" /> - + + + + + + + + +