aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-04-26 15:06:21 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-04-26 15:06:21 +0000
commitdf79433a6a387ff7b14f25aebdefe343c4dc58b6 (patch)
tree254819ec865e373eae5f0786cd1b364b07d9826a /app/src/main/java
parentef4ead043410cf638d33325fe6a250ddc94c6d02 (diff)
downloadinfinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.tar
infinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.tar.gz
infinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.tar.bz2
infinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.tar.lz
infinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.tar.xz
infinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.tar.zst
infinity-for-reddit-df79433a6a387ff7b14f25aebdefe343c4dc58b6.zip
Try fixing gallery images swipe gesture and Slidr gesture conflicts.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java10
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/customviews/slidr/widget/SliderPanel.java4
4 files changed, 17 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java
index 6c734576..34d932ab 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java
@@ -48,6 +48,7 @@ import ml.docilealligator.infinityforreddit.AppBarStateChangeListener;
import ml.docilealligator.infinityforreddit.CustomFontReceiver;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
+import ml.docilealligator.infinityforreddit.customviews.slidr.widget.SliderPanel;
import ml.docilealligator.infinityforreddit.font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.font.ContentFontStyle;
import ml.docilealligator.infinityforreddit.font.FontFamily;
@@ -70,6 +71,7 @@ public abstract class BaseActivity extends AppCompatActivity implements CustomFo
public Typeface typeface;
public Typeface titleTypeface;
public Typeface contentTypeface;
+ public SliderPanel sliderPanel;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java
index 28d6c177..fc2811e6 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java
@@ -121,7 +121,7 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec
applyCustomTheme();
if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) {
- Slidr.attach(this);
+ sliderPanel = Slidr.attach(this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
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 08c91772..66e6870f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -3292,6 +3292,16 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
adapter = new PostGalleryTypeImageRecyclerViewAdapter(mGlide, mActivity.typeface,
mSaveMemoryCenterInsideDownsampleStrategy, mColorAccent, mPrimaryTextColor, mScale);
galleryRecyclerView.setAdapter(adapter);
+ galleryRecyclerView.setOnTouchListener((v, motionEvent) -> {
+ mActivity.sliderPanel.requestDisallowInterceptTouchEvent(true);
+
+ switch (motionEvent.getAction() & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_UP:
+ mActivity.sliderPanel.requestDisallowInterceptTouchEvent(false);
+ }
+
+ return false;
+ });
new PagerSnapHelper().attachToRecyclerView(galleryRecyclerView);
galleryRecyclerView.setRecycledViewPool(mGalleryRecycledViewPool);
SwipeLockLinearLayoutManager layoutManager = new SwipeLockLinearLayoutManager(
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/slidr/widget/SliderPanel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/slidr/widget/SliderPanel.java
index fe8ea871..f23394f9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/slidr/widget/SliderPanel.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/slidr/widget/SliderPanel.java
@@ -48,6 +48,10 @@ public class SliderPanel extends FrameLayout {
init();
}
+ @Override
+ public boolean dispatchTouchEvent(MotionEvent ev) {
+ return super.dispatchTouchEvent(ev);
+ }
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {