aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2024-09-25 21:28:40 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2024-09-25 21:28:40 +0000
commite5b35e11e907a10bed08ff9f98c4a116253e34cb (patch)
tree52ea6850439413f0103552ff5ceaf5e7369b48bb /app/src/main/java
parentcfe178117d107113dd938dfedff3b91d1547ab34 (diff)
downloadinfinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.tar
infinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.tar.gz
infinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.tar.bz2
infinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.tar.lz
infinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.tar.xz
infinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.tar.zst
infinity-for-reddit-e5b35e11e907a10bed08ff9f98c4a116253e34cb.zip
Show GiphyGifInfoBottomSheetFragment before the Giphy gif selector.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/GiphyGifInfoBottomSheetFragment.java42
2 files changed, 45 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java
index 67d5cf3a..260ff43c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java
@@ -57,6 +57,7 @@ import ml.docilealligator.infinityforreddit.account.Account;
import ml.docilealligator.infinityforreddit.adapters.MarkdownBottomBarRecyclerViewAdapter;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.AccountChooserBottomSheetFragment;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.CopyTextBottomSheetFragment;
+import ml.docilealligator.infinityforreddit.bottomsheetfragments.GiphyGifInfoBottomSheetFragment;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.UploadedImagesBottomSheetFragment;
import ml.docilealligator.infinityforreddit.comment.Comment;
import ml.docilealligator.infinityforreddit.comment.SendComment;
@@ -313,7 +314,8 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
@Override
public void onSelectGiphyGif() {
- GiphyDialogFragment.Companion.newInstance().show(getSupportFragmentManager(), "giphy_dialog");
+ GiphyGifInfoBottomSheetFragment fragment = new GiphyGifInfoBottomSheetFragment();
+ fragment.show(getSupportFragmentManager(), fragment.getTag());
}
});
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/GiphyGifInfoBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/GiphyGifInfoBottomSheetFragment.java
new file mode 100644
index 00000000..60d5c330
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/GiphyGifInfoBottomSheetFragment.java
@@ -0,0 +1,42 @@
+package ml.docilealligator.infinityforreddit.bottomsheetfragments;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+
+import com.giphy.sdk.ui.views.GiphyDialogFragment;
+
+import ml.docilealligator.infinityforreddit.activities.BaseActivity;
+import ml.docilealligator.infinityforreddit.customviews.LandscapeExpandedRoundedBottomSheetDialogFragment;
+import ml.docilealligator.infinityforreddit.databinding.FragmentGiphyGifInfoBottomSheetBinding;
+
+public class GiphyGifInfoBottomSheetFragment extends LandscapeExpandedRoundedBottomSheetDialogFragment {
+
+ private BaseActivity activity;
+
+ public GiphyGifInfoBottomSheetFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ FragmentGiphyGifInfoBottomSheetBinding binding = FragmentGiphyGifInfoBottomSheetBinding.inflate(inflater, container, false);
+
+ binding.selectGiphyGifButtonUploadedImagesBottomSheetFragment.setOnClickListener(view -> {
+ GiphyDialogFragment.Companion.newInstance().show(activity.getSupportFragmentManager(), "giphy_dialog");
+ dismiss();
+ });
+
+ return binding.getRoot();
+ }
+
+ public void onAttach(@NonNull Context context) {
+ super.onAttach(context);
+ this.activity = (BaseActivity) context;
+ }
+} \ No newline at end of file