mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Try fixing gallery images swipe gesture and Slidr gesture conflicts.
This commit is contained in:
parent
ef4ead0434
commit
df79433a6a
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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(
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user