aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2018-11-08 06:13:17 +0000
committerAlex Ning <chineseperson5@gmail.com>2018-11-08 06:13:17 +0000
commit4373d3aa55845160fc81940af10755e7745b11b5 (patch)
tree21e6e61486d61f4b0230b929563c2c20469af887
parent6e5a0e7ef37ab148123a2fed2e50f84978e1f45a (diff)
downloadinfinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.tar
infinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.tar.gz
infinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.tar.bz2
infinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.tar.lz
infinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.tar.xz
infinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.tar.zst
infinity-for-reddit-4373d3aa55845160fc81940af10755e7745b11b5.zip
Minor layout tweaks.
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java12
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java5
-rw-r--r--app/src/main/res/layout/item_post.xml8
5 files changed, 13 insertions, 17 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java
index 5dcb673d..a5b9bf30 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java
@@ -270,9 +270,9 @@ class ParsePost {
url, url, permalink, score, postType, voteType,
gilded, nsfw, stickied, isCrosspost));
} else {
- //Link post
+ //CP No Preview Link post
Log.i("CP no preview link", Integer.toString(i));
- int postType = PostData.LINK_TYPE;
+ int postType = PostData.NO_PREVIEW_LINK_TYPE;
PostData linkPostData = new PostData(id, fullName, subredditNamePrefixed, formattedPostTime,
title, previewUrl, url, permalink, score, postType,
voteType, gilded, nsfw, stickied, isCrosspost);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java
index d6dc175f..3afd6ece 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java
@@ -191,7 +191,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
public void onResponse(Call<String> call, retrofit2.Response<String> response) {
if(getActivity() != null) {
if(response.isSuccessful()) {
- Log.i("response", "success");
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("response", response.body());
clipboard.setPrimaryClip(clip);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
index b750595d..1bda1e61 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
@@ -482,12 +482,12 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
- ((DataViewHolder) holder).errorLinearLayout.setVisibility(View.VISIBLE);
- ((DataViewHolder)holder).errorLinearLayout.setOnClickListener(new View.OnClickListener() {
+ ((DataViewHolder) holder).errorRelativeLayout.setVisibility(View.VISIBLE);
+ ((DataViewHolder)holder).errorRelativeLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
((DataViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
- ((DataViewHolder) holder).errorLinearLayout.setVisibility(View.GONE);
+ ((DataViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
loadImage(holder, postData);
}
});
@@ -496,7 +496,7 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
- ((DataViewHolder) holder).errorLinearLayout.setVisibility(View.GONE);
+ ((DataViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
return false;
}
@@ -537,7 +537,7 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
@BindView(R.id.image_view_wrapper_item_best_post) RelativeLayout relativeLayout;
@BindView(R.id.progress_bar_best_post_item) ProgressBar progressBar;
@BindView(R.id.image_view_best_post_item) AspectRatioImageView imageView;
- @BindView(R.id.load_image_error_linear_layout_best_post_item) LinearLayout errorLinearLayout;
+ @BindView(R.id.load_image_error_relative_layout_best_post_item) RelativeLayout errorRelativeLayout;
@BindView(R.id.image_view_no_preview_link_best_post_item) ImageView noPreviewLinkImageView;
@BindView(R.id.plus_button_item_best_post) ImageView upvoteButton;
@BindView(R.id.score_text_view_item_best_post) TextView scoreTextView;
@@ -574,7 +574,7 @@ class PostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
((DataViewHolder) holder).nsfwTextView.setVisibility(View.GONE);
((DataViewHolder) holder).progressBar.setVisibility(View.GONE);
((DataViewHolder) holder).imageView.setVisibility(View.GONE);
- ((DataViewHolder) holder).errorLinearLayout.setVisibility(View.GONE);
+ ((DataViewHolder) holder).errorRelativeLayout.setVisibility(View.GONE);
((DataViewHolder) holder).noPreviewLinkImageView.setVisibility(View.GONE);
((DataViewHolder) holder).upvoteButton.clearColorFilter();
((DataViewHolder) holder).downvoteButton.clearColorFilter();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java
index 42c7f74f..5d5fba7f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java
@@ -100,11 +100,6 @@ public class ViewImageActivity extends AppCompatActivity {
final Spannable text = new SpannableString(title);
setTitle(text);
- /*final RelativeLayout mRelativeLayout = findViewById(R.id.parent_relative_layout_view_image_activity);
- mImageView = findViewById(R.id.image_view_view_image_activity);
- mProgressBar = findViewById(R.id.progress_bar_view_image_activity);
- mLoadErrorLinearLayout = findViewById(R.id.load_image_error_linear_layout_view_image_activity);*/
-
mLoadErrorLinearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index cd200590..a2a99cce 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -151,12 +151,14 @@
android:id="@+id/image_view_best_post_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
android:scaleType="fitStart" />
- <LinearLayout
- android:id="@+id/load_image_error_linear_layout_best_post_item"
+ <RelativeLayout
+ android:id="@+id/load_image_error_relative_layout_best_post_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_centerInParent="true"
android:visibility="gone">
<TextView
@@ -167,7 +169,7 @@
android:gravity="center"
android:text="@string/tap_to_retry" />
- </LinearLayout>
+ </RelativeLayout>
</RelativeLayout>