aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java48
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java6
-rw-r--r--app/src/main/res/values/styles.xml1
4 files changed, 38 insertions, 23 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java
index 7d44eb31..3c67787b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostFragment.java
@@ -194,17 +194,19 @@ public class PostFragment extends Fragment {
getResources().getConfiguration().locale, new ParsePost.ParsePostListener() {
@Override
public void onParsePostSuccess(ArrayList<PostData> postData, String lastItem) {
- mPostData = postData;
- mLastItem = lastItem;
- mAdapter = new PostRecyclerViewAdapter(getActivity(), postData, mPaginationSynchronizer);
-
- mPostRecyclerView.setAdapter(mAdapter);
- mPostRecyclerView.addOnScrollListener(new PostPaginationScrollListener(
- getActivity(), mLinearLayoutManager, mAdapter, lastItem, postData,
- mPaginationSynchronizer, mSubredditName, mIsBestPost,
- mPaginationSynchronizer.isLoading(), mPaginationSynchronizer.isLoadSuccess(),
- getResources().getConfiguration().locale));
- mProgressBar.setVisibility(View.GONE);
+ if(isAdded() && getActivity() != null) {
+ mPostData = postData;
+ mLastItem = lastItem;
+ mAdapter = new PostRecyclerViewAdapter(getActivity(), postData, mPaginationSynchronizer);
+
+ mPostRecyclerView.setAdapter(mAdapter);
+ mPostRecyclerView.addOnScrollListener(new PostPaginationScrollListener(
+ getActivity(), mLinearLayoutManager, mAdapter, lastItem, postData,
+ mPaginationSynchronizer, mSubredditName, mIsBestPost,
+ mPaginationSynchronizer.isLoading(), mPaginationSynchronizer.isLoadSuccess(),
+ getResources().getConfiguration().locale));
+ mProgressBar.setVisibility(View.GONE);
+ }
}
@Override
@@ -264,17 +266,19 @@ public class PostFragment extends Fragment {
getResources().getConfiguration().locale, new ParsePost.ParsePostListener() {
@Override
public void onParsePostSuccess(ArrayList<PostData> postData, String lastItem) {
- mPostData = postData;
- mLastItem = lastItem;
- mAdapter = new PostRecyclerViewAdapter(getActivity(), postData, mPaginationSynchronizer);
-
- mPostRecyclerView.setAdapter(mAdapter);
- mPostRecyclerView.addOnScrollListener(new PostPaginationScrollListener(
- getActivity(), mLinearLayoutManager, mAdapter, lastItem, postData,
- mPaginationSynchronizer, mSubredditName, mIsBestPost,
- mPaginationSynchronizer.isLoading(), mPaginationSynchronizer.isLoadSuccess(),
- getResources().getConfiguration().locale));
- mProgressBar.setVisibility(View.GONE);
+ if(isAdded() && getActivity() != null) {
+ mPostData = postData;
+ mLastItem = lastItem;
+ mAdapter = new PostRecyclerViewAdapter(getActivity(), postData, mPaginationSynchronizer);
+
+ mPostRecyclerView.setAdapter(mAdapter);
+ mPostRecyclerView.addOnScrollListener(new PostPaginationScrollListener(
+ getActivity(), mLinearLayoutManager, mAdapter, lastItem, postData,
+ mPaginationSynchronizer, mSubredditName, mIsBestPost,
+ mPaginationSynchronizer.isLoading(), mPaginationSynchronizer.isLoadSuccess(),
+ getResources().getConfiguration().locale));
+ mProgressBar.setVisibility(View.GONE);
+ }
}
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java
index 031fc88a..af75b8b2 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewImageActivity.java
@@ -434,4 +434,10 @@ public class ViewImageActivity extends AppCompatActivity {
}
});
}
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ overridePendingTransition(0, 0);
+ }
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java
index 407f8eff..46423d50 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewVideoActivity.java
@@ -403,4 +403,10 @@ public class ViewVideoActivity extends AppCompatActivity {
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
}
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ overridePendingTransition(0, 0);
+ }
}
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index b22e23e3..38b86b13 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -33,7 +33,6 @@
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
- <item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
</resources>