From 60ee29982247d1dd8160b043015640f4a660a175 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 31 Jul 2020 17:44:43 +0800 Subject: Enable quick scale in ViewImageOrGifActivity and ViewRedditGalleryImageOrGifFragment. --- .../infinityforreddit/Activity/ViewImageOrGifActivity.java | 3 +-- .../Fragment/ViewRedditGalleryImageOrGifFragment.java | 3 +-- .../ml/docilealligator/infinityforreddit/Post/PostDataSource.java | 5 ++--- .../infinityforreddit/Settings/AdvancedPreferenceFragment.java | 2 +- app/src/main/res/values/strings.xml | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageOrGifActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageOrGifActivity.java index 9152c1be..fe1a0e9c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageOrGifActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageOrGifActivity.java @@ -213,7 +213,6 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa if (view != null) { view.setMinimumDpi(80); - view.setQuickScaleEnabled(true); view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() { @Override @@ -225,7 +224,7 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa public void onImageLoaded() { view.setDoubleTapZoomDpi(70); view.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED); - view.setQuickScaleEnabled(false); + view.setQuickScaleEnabled(true); } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewRedditGalleryImageOrGifFragment.java index 015e57c7..97c60653 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewRedditGalleryImageOrGifFragment.java @@ -131,7 +131,6 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { if (view != null) { view.setMinimumDpi(80); - view.setQuickScaleEnabled(true); view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() { @Override @@ -143,7 +142,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { public void onImageLoaded() { view.setDoubleTapZoomDpi(70); view.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED); - view.setQuickScaleEnabled(false); + view.setQuickScaleEnabled(true); } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Post/PostDataSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Post/PostDataSource.java index 2b18ef2a..54a80624 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Post/PostDataSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Post/PostDataSource.java @@ -174,11 +174,10 @@ public class PostDataSource extends PageKeyedDataSource { @Override public void loadInitial(@NonNull LoadInitialParams params, @NonNull final LoadInitialCallback callback) { initialLoadStateLiveData.postValue(NetworkState.LOADING); - - boolean savePostFeedScrolledPosition = sharedPreferences.getBoolean(SharedPreferencesUtils.SAVE_FRONT_PAGE_SCROLLED_POSITION, true); - String accountNameForCache = accountName == null ? SharedPreferencesUtils.FRONT_PAGE_SCROLLED_POSITION_ANONYMOUS : accountName; switch (postType) { case TYPE_FRONT_PAGE: + boolean savePostFeedScrolledPosition = sharedPreferences.getBoolean(SharedPreferencesUtils.SAVE_FRONT_PAGE_SCROLLED_POSITION, true); + String accountNameForCache = accountName == null ? SharedPreferencesUtils.FRONT_PAGE_SCROLLED_POSITION_ANONYMOUS : accountName; if (savePostFeedScrolledPosition) { loadBestPostsInitial(callback, postFeedScrolledPositionSharedPreferences.getString(accountNameForCache + SharedPreferencesUtils.FRONT_PAGE_SCROLLED_POSITION_FRONT_PAGE_BASE, null)); } else { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AdvancedPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AdvancedPreferenceFragment.java index 4548a344..4268b28f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AdvancedPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AdvancedPreferenceFragment.java @@ -153,7 +153,7 @@ public class AdvancedPreferenceFragment extends PreferenceFragmentCompat { .setPositiveButton(R.string.yes, (dialogInterface, i) -> { postFeedScrolledPositionSharedPreferences.edit().clear().apply(); - Toast.makeText(activity, R.string.delete_all_post_feed_scrolled_positions_success, Toast.LENGTH_SHORT).show(); + Toast.makeText(activity, R.string.delete_all_front_page_scrolled_positions_success, Toast.LENGTH_SHORT).show(); }) .setNegativeButton(R.string.no, null) .show(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 244e6739..dd8ea536 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -779,7 +779,7 @@ Delete all sort types successful Delete all post layouts successful Delete all themes successful - Delete all post feed scrolled positions successful + Delete all scrolled positions in front page successful Reset all settings successful Theme Preview -- cgit v1.2.3