aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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) {