From b85ed3c867f0c3a2ca0d90e4c29d54ef38c976b5 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sun, 13 Nov 2022 01:16:27 +1100 Subject: Show the current image index in gallery in PostFragment. --- .../RedgifsAccessTokenAuthenticator.java | 1 - .../adapters/PostRecyclerViewAdapter.java | 38 +++++++++++++++------- .../customviews/SwipeLockFrameLayout.java | 2 +- 3 files changed, 27 insertions(+), 14 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedgifsAccessTokenAuthenticator.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedgifsAccessTokenAuthenticator.java index a4feec43..11fd245d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RedgifsAccessTokenAuthenticator.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedgifsAccessTokenAuthenticator.java @@ -1,7 +1,6 @@ package ml.docilealligator.infinityforreddit; import android.content.SharedPreferences; -import android.util.Log; import androidx.annotation.NonNull; 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 a1a4c5bd..81c4c441 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -11,9 +11,7 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; -import android.util.Log; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; @@ -863,7 +861,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter { @@ -3149,7 +3152,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter { swipeLocked = false; return false; }); - binding.bottomConstraintLayoutItemPostGalleryType.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View view, MotionEvent motionEvent) { - swipeLocked = false; - return false; - } + binding.bottomConstraintLayoutItemPostGalleryType.setOnTouchListener((view, motionEvent) -> { + swipeLocked = false; + return false; }); binding.noPreviewImageViewItemPostGalleryType.setOnClickListener(view -> { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/SwipeLockFrameLayout.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/SwipeLockFrameLayout.java index 97d29022..72d3e9b7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/SwipeLockFrameLayout.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/SwipeLockFrameLayout.java @@ -38,7 +38,7 @@ public class SwipeLockFrameLayout extends FrameLayout implements SwipeLockView { @Override public boolean onInterceptTouchEvent(MotionEvent ev) { updateSwipeLock(ev); - return true; + return false; } @SuppressLint("ClickableViewAccessibility") // we are just listening to touch events -- cgit v1.2.3