diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-12-02 05:57:53 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-12-02 05:57:53 +0000 |
commit | 71661e94f06f0edc939d2bb170ae019fe9cfca0d (patch) | |
tree | 18b13554d28942600979fd7e661dc63df0208ca3 /app/src/main/java | |
parent | 1b2602ac3ac95ab556062ca4d9f336675d26459d (diff) | |
download | infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.tar infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.tar.gz infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.tar.bz2 infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.tar.lz infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.tar.xz infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.tar.zst infinity-for-reddit-71661e94f06f0edc939d2bb170ae019fe9cfca0d.zip |
Maybe fixed IllegaStateException for ShareLinkBottomSheetFragment and CopyTextBottomSheetFragment.
Diffstat (limited to '')
2 files changed, 9 insertions, 12 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java index 6a4dc4db..7c57517d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java @@ -229,8 +229,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy private Drawable mCommentIcon; private float mScale; - private ShareLinkBottomSheetFragment mShareLinkBottomSheetFragment; - private CopyTextBottomSheetFragment mCopyTextBottomSheetFragment; private ExoCreator mExoCreator; public CommentAndPostRecyclerViewAdapter(AppCompatActivity activity, CustomThemeWrapper customThemeWrapper, @@ -322,8 +320,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy Bundle bundle = new Bundle(); bundle.putString(CopyTextBottomSheetFragment.EXTRA_RAW_TEXT, mPost.getSelfTextPlain()); bundle.putString(CopyTextBottomSheetFragment.EXTRA_MARKDOWN, mPost.getSelfText()); - mCopyTextBottomSheetFragment.setArguments(bundle); - mCopyTextBottomSheetFragment.show(mActivity.getSupportFragmentManager(), mCopyTextBottomSheetFragment.getTag()); + CopyTextBottomSheetFragment copyTextBottomSheetFragment = new CopyTextBottomSheetFragment(); + copyTextBottomSheetFragment.setArguments(bundle); + copyTextBottomSheetFragment.show(mActivity.getSupportFragmentManager(), copyTextBottomSheetFragment.getTag()); return true; }); } @@ -554,8 +553,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy DrawableCompat.setTint(mCommentIcon, mPostIconAndInfoColor); } - mShareLinkBottomSheetFragment = new ShareLinkBottomSheetFragment(); - mCopyTextBottomSheetFragment = new CopyTextBottomSheetFragment(); mExoCreator = exoCreator; } @@ -2391,8 +2388,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy break; } } - mShareLinkBottomSheetFragment.setArguments(bundle); - mShareLinkBottomSheetFragment.show(mActivity.getSupportFragmentManager(), mShareLinkBottomSheetFragment.getTag()); + ShareLinkBottomSheetFragment shareLinkBottomSheetFragment = new ShareLinkBottomSheetFragment(); + shareLinkBottomSheetFragment.setArguments(bundle); + shareLinkBottomSheetFragment.show(mActivity.getSupportFragmentManager(), shareLinkBottomSheetFragment.getTag()); }); if (mVoteButtonsOnTheRight) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 52e25fe5..226d8618 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -193,7 +193,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView private NetworkState networkState; private ExoCreator mExoCreator; private Callback mCallback; - private ShareLinkBottomSheetFragment mShareLinkBottomSheetFragment; public PostRecyclerViewAdapter(AppCompatActivity activity, Retrofit oauthRetrofit, Retrofit retrofit, Retrofit gfycatRetrofit, Retrofit redgifsRetrofit, @@ -297,7 +296,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView mUserDao = redditDataRoomDatabase.userDao(); mExoCreator = exoCreator; mCallback = callback; - mShareLinkBottomSheetFragment = new ShareLinkBottomSheetFragment(); } } @@ -1117,8 +1115,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView break; } } - mShareLinkBottomSheetFragment.setArguments(bundle); - mShareLinkBottomSheetFragment.show(mActivity.getSupportFragmentManager(), mShareLinkBottomSheetFragment.getTag()); + ShareLinkBottomSheetFragment shareLinkBottomSheetFragment = new ShareLinkBottomSheetFragment(); + shareLinkBottomSheetFragment.setArguments(bundle); + shareLinkBottomSheetFragment.show(mActivity.getSupportFragmentManager(), shareLinkBottomSheetFragment.getTag()); } @Override |