aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-10-28 13:17:09 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-10-28 13:17:09 +0000
commit3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e (patch)
tree59ae7eb6da709afd0899a3493f671b84351f2c4a /app/src/main/java
parent8d5bf2c6466c518523ed1068092c09c74d857654 (diff)
downloadinfinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.gz
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.bz2
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.lz
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.xz
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.zst
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.zip
Use FlowLayout to host all the information of a post in item_post and item_post_detail.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java11
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java11
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AcknowledgementFragment.java3
3 files changed, 3 insertions, 22 deletions
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<Recy
((PostDetailViewHolder) holder).mPostTimeTextView.setText(mPost.getPostTime());
if (mPost.getGilded() > 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<Recy
((PostDetailViewHolder) holder).mLockedImageView.setVisibility(View.VISIBLE);
}
- if (mPost.isSpoiler() || mPost.getFlair() != null) {
- ((PostDetailViewHolder) holder).spoilerFlairlinearLayout.setVisibility(View.VISIBLE);
- }
-
if (mPost.isSpoiler()) {
((PostDetailViewHolder) holder).spoilerTextView.setVisibility(View.VISIBLE);
}
@@ -1392,7 +1386,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
((PostDetailViewHolder) holder).mUpvoteButton.clearColorFilter();
((PostDetailViewHolder) holder).mScoreTextView.setTextColor(ContextCompat.getColor(mActivity, R.color.defaultTextColor));
((PostDetailViewHolder) holder).mDownvoteButton.clearColorFilter();
- ((PostDetailViewHolder) holder).spoilerFlairlinearLayout.setVisibility(View.GONE);
((PostDetailViewHolder) holder).flairTextView.setVisibility(View.GONE);
((PostDetailViewHolder) holder).spoilerTextView.setVisibility(View.GONE);
((PostDetailViewHolder) holder).mNSFWTextView.setVisibility(View.GONE);
@@ -1448,8 +1441,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
TextView mContentMarkdownView;
@BindView(R.id.type_text_view_item_post_detail)
CustomTextView mTypeTextView;
- @BindView(R.id.gilded_image_view_item_post_detail)
- ImageView mGildedImageView;
@BindView(R.id.gilded_number_text_view_item_post_detail)
TextView mGildedNumberTextView;
@BindView(R.id.crosspost_image_view_item_post_detail)
@@ -1460,8 +1451,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
ImageView mLockedImageView;
@BindView(R.id.nsfw_text_view_item_post_detail)
CustomTextView mNSFWTextView;
- @BindView(R.id.spoiler_flair_linear_layout_item_post_detail)
- LinearLayout spoilerFlairlinearLayout;
@BindView(R.id.spoiler_custom_text_view_item_post_detail)
CustomTextView spoilerTextView;
@BindView(R.id.flair_custom_text_view_item_post_detail)
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
index f59cfff5..04827aea 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java
@@ -311,7 +311,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
((DataViewHolder) holder).scoreTextView.setText(Integer.toString(post.getScore() + post.getVoteType()));
if (gilded > 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<Post, RecyclerView
((DataViewHolder) holder).nsfwTextView.setVisibility(View.VISIBLE);
}
- if (spoiler || flair != null) {
- ((DataViewHolder) holder).spoilerFlairLinearLayout.setVisibility(View.VISIBLE);
- }
-
if (spoiler) {
((DataViewHolder) holder).spoilerTextView.setVisibility(View.VISIBLE);
}
@@ -776,13 +771,11 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
mGlide.clear(((DataViewHolder) holder).iconGifImageView);
((DataViewHolder) holder).stickiedPostImageView.setVisibility(View.GONE);
((DataViewHolder) holder).relativeLayout.setVisibility(View.GONE);
- ((DataViewHolder) holder).gildedImageView.setVisibility(View.GONE);
((DataViewHolder) holder).gildedNumberTextView.setVisibility(View.GONE);
((DataViewHolder) holder).crosspostImageView.setVisibility(View.GONE);
((DataViewHolder) holder).archivedImageView.setVisibility(View.GONE);
((DataViewHolder) holder).lockedImageView.setVisibility(View.GONE);
((DataViewHolder) holder).nsfwTextView.setVisibility(View.GONE);
- ((DataViewHolder) holder).spoilerFlairLinearLayout.setVisibility(View.GONE);
((DataViewHolder) holder).spoilerTextView.setVisibility(View.GONE);
((DataViewHolder) holder).flairTextView.setVisibility(View.GONE);
((DataViewHolder) holder).linkTextView.setVisibility(View.GONE);
@@ -820,8 +813,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
TextView titleTextView;
@BindView(R.id.type_text_view_item_post)
CustomTextView typeTextView;
- @BindView(R.id.gilded_image_view_item_post)
- ImageView gildedImageView;
@BindView(R.id.gilded_number_text_view_item_post)
TextView gildedNumberTextView;
@BindView(R.id.archived_image_view_item_post)
@@ -832,8 +823,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
ImageView crosspostImageView;
@BindView(R.id.nsfw_text_view_item_post)
CustomTextView nsfwTextView;
- @BindView(R.id.spoiler_flair_linear_layout_item_post)
- LinearLayout spoilerFlairLinearLayout;
@BindView(R.id.spoiler_custom_text_view_item_post)
CustomTextView spoilerTextView;
@BindView(R.id.flair_custom_text_view_item_post)
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AcknowledgementFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AcknowledgementFragment.java
index 5a79fc8f..cb348c68 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AcknowledgementFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AcknowledgementFragment.java
@@ -97,6 +97,9 @@ public class AcknowledgementFragment extends Fragment {
acknowledgements.add(new Acknowledgement("Android-State",
"A utility library for Android to save objects in a Bundle without any boilerplate",
Uri.parse("https://github.com/evernote/android-state")));
+ acknowledgements.add(new Acknowledgement("FlowLayout",
+ "A FlowLayout for Android, which allows child views flow to next row when there is no enough space.",
+ Uri.parse("https://github.com/nex3z/FlowLayout")));
AcknowledgementRecyclerViewAdapter adapter = new AcknowledgementRecyclerViewAdapter(activity, acknowledgements);
recyclerView.setLayoutManager(new LinearLayoutManager(activity));