aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-09-17 00:44:48 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-09-17 00:44:48 +0000
commit3592dc29dabe1fbc41f4af5536e395987963c810 (patch)
tree0f7ad4c54fd819f553c917726e61957f8b2b74b9 /app/src/main/java/ml
parent4e036da000a6242d2f37a00f09f3c938c13e640e (diff)
downloadinfinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.tar
infinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.tar.gz
infinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.tar.bz2
infinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.tar.lz
infinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.tar.xz
infinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.tar.zst
infinity-for-reddit-3592dc29dabe1fbc41f4af5536e395987963c810.zip
Fixed android.view.DisplayListCanvas.throwIfCannotDraw in ViewPostDetailActivity. Fixed app crashes when pressing the comment button in ViewPostDetailActivity while the post is not loaded. Re-enable spalsh screen.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java50
3 files changed, 34 insertions, 19 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java
index 1cbc1466..28249f40 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java
@@ -741,7 +741,6 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
private void loadImage(PostDetailViewHolder holder) {
RequestBuilder imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
- .apply(new RequestOptions().override(mPost.getPreviewWidth(), mPost.getPreviewHeight()))
.listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
index 389dc1d5..f07c0f39 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
@@ -163,6 +163,8 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
@Override
protected void onCreate(Bundle savedInstanceState) {
+ setTheme(R.style.AppTheme_NoActionBarWithTransparentStatusBar);
+
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
index 27b31083..04e013fe 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
@@ -305,6 +305,9 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
if(mMenu != null) {
MenuItem saveItem = mMenu.findItem(R.id.action_save_view_post_detail_activity);
MenuItem hideItem = mMenu.findItem(R.id.action_hide_view_post_detail_activity);
+
+ mMenu.findItem(R.id.action_comment_view_post_detail_activity).setVisible(true);
+
if(mAccessToken != null) {
if(mPost.isSaved()) {
saveItem.setVisible(true);
@@ -431,6 +434,9 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
if(mMenu != null) {
MenuItem saveItem = mMenu.findItem(R.id.action_save_view_post_detail_activity);
MenuItem hideItem = mMenu.findItem(R.id.action_hide_view_post_detail_activity);
+
+ mMenu.findItem(R.id.action_comment_view_post_detail_activity).setVisible(true);
+
if(mAccessToken != null) {
if(post.isSaved()) {
saveItem.setVisible(true);
@@ -654,6 +660,9 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
if(mMenu != null) {
MenuItem saveItem = mMenu.findItem(R.id.action_save_view_post_detail_activity);
MenuItem hideItem = mMenu.findItem(R.id.action_hide_view_post_detail_activity);
+
+ mMenu.findItem(R.id.action_comment_view_post_detail_activity).setVisible(true);
+
if(mAccessToken != null) {
if(post.isSaved()) {
saveItem.setVisible(true);
@@ -906,6 +915,9 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
if(mPost != null) {
MenuItem saveItem = mMenu.findItem(R.id.action_save_view_post_detail_activity);
MenuItem hideItem = mMenu.findItem(R.id.action_hide_view_post_detail_activity);
+
+ mMenu.findItem(R.id.action_comment_view_post_detail_activity).setVisible(true);
+
if(mAccessToken != null) {
if(mPost.isSaved()) {
saveItem.setVisible(true);
@@ -964,27 +976,29 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
refresh(true, true);
return true;
case R.id.action_comment_view_post_detail_activity:
- if(mPost.isArchived()) {
- showMessage(R.string.archived_post_reply_unavailable);
- return true;
- }
+ if(mPost != null) {
+ if(mPost.isArchived()) {
+ showMessage(R.string.archived_post_reply_unavailable);
+ return true;
+ }
- if(mPost.isLocked()) {
- showMessage(R.string.locked_post_comment_unavailable);
- return true;
- }
+ if(mPost.isLocked()) {
+ showMessage(R.string.locked_post_comment_unavailable);
+ return true;
+ }
- if(mAccessToken == null) {
- showMessage(R.string.login_first);
- return true;
- }
+ if(mAccessToken == null) {
+ showMessage(R.string.login_first);
+ return true;
+ }
- Intent intent = new Intent(this, CommentActivity.class);
- intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_TEXT_KEY, mPost.getTitle());
- intent.putExtra(CommentActivity.EXTRA_PARENT_FULLNAME_KEY, mPost.getFullName());
- intent.putExtra(CommentActivity.EXTRA_PARENT_DEPTH_KEY, 0);
- intent.putExtra(CommentActivity.EXTRA_IS_REPLYING_KEY, false);
- startActivityForResult(intent, WRITE_COMMENT_REQUEST_CODE);
+ Intent intent = new Intent(this, CommentActivity.class);
+ intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_TEXT_KEY, mPost.getTitle());
+ intent.putExtra(CommentActivity.EXTRA_PARENT_FULLNAME_KEY, mPost.getFullName());
+ intent.putExtra(CommentActivity.EXTRA_PARENT_DEPTH_KEY, 0);
+ intent.putExtra(CommentActivity.EXTRA_IS_REPLYING_KEY, false);
+ startActivityForResult(intent, WRITE_COMMENT_REQUEST_CODE);
+ }
return true;
case R.id.action_save_view_post_detail_activity:
if(mPost != null && mAccessToken != null) {