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 +- app/src/main/res/layout/item_post_gallery_type.xml | 28 +++++++++++++--- app/src/main/res/values/strings.xml | 34 ++++++++++--------- 5 files changed, 69 insertions(+), 34 deletions(-) (limited to 'app/src') 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 diff --git a/app/src/main/res/layout/item_post_gallery_type.xml b/app/src/main/res/layout/item_post_gallery_type.xml index 4ea4579c..a817cd40 100644 --- a/app/src/main/res/layout/item_post_gallery_type.xml +++ b/app/src/main/res/layout/item_post_gallery_type.xml @@ -196,11 +196,31 @@ - + android:visibility="gone"> + + + + + + Edit Multireddit Selected Subreddits Report - Image %1$,d/%2$d - Video %1$,d/%2$d + Image %1$d/%2$d + Video %1$d/%2$d Send PM - Image %1$,d/%2$d - Gif %1$,d/%2$d - Video %1$,d/%2$d + Image %1$d/%2$d + Gif %1$d/%2$d + Video %1$d/%2$d Crosspost Give Award r/all and r/popular @@ -201,7 +201,7 @@ The post needs a good title Hey where is the link? Please select an image first - Voting length: %1$,d days + Voting length: %1$d days Posting Could not post it Error processing image @@ -358,7 +358,7 @@ New Message Subreddit Award - %1$,d New Messages + %1$d New Messages Account Reddit @@ -382,9 +382,9 @@ Mute Autoplaying Videos Autoplay NSFW Videos Autoplay Videos Visible Area Offset (Portrait) - Start autoplaying videos when %1$,d%% of them are visible + Start autoplaying videos when %1$d%% of them are visible Autoplay Videos Visible Area Offset (Landscape) - Start autoplaying videos when %1$,d%% of them are visible + Start autoplaying videos when %1$d%% of them are visible Immersive Interface Does Not Apply to All Pages Ignore Navigation Bar in Immersive Interface @@ -636,7 +636,7 @@ Hide Text Post Content Hide Comment Awards Show Fewer Toolbar Options Starting From - Level %1$,d + Level %1$d Show Author Avatar Reddit User Agreement Always Show the Number of Child Comments @@ -688,15 +688,15 @@ Just Now 1 Minute - %1$,d Minutes + %1$d Minutes 1 Hour - %1$,d Hours + %1$d Hours Yesterday - %1$,d Days + %1$d Days 1 Month - %1$,d Months + %1$d Months 1 Year - %1$,d Years + %1$d Years Error getting multireddit data Cannot sync multireddits @@ -1077,7 +1077,7 @@ Give Award? Anonymous - Code: %1$,d/\n Message: %2$s + Code: %1$d/\n Message: %2$s Award given Failed @@ -1315,4 +1315,6 @@ Failed to load more posts.\nTap to retry. No more posts + %1$d/%2$d + -- cgit v1.2.3