aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-07-31 09:44:43 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-07-31 09:44:43 +0000
commit60ee29982247d1dd8160b043015640f4a660a175 (patch)
tree4d8ec328d13b254c8ebda24a6070274ba6c3231a /app
parent80b4869c6a17bb305b5a5c843e53a8f71e14b7d4 (diff)
downloadinfinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.tar
infinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.tar.gz
infinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.tar.bz2
infinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.tar.lz
infinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.tar.xz
infinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.tar.zst
infinity-for-reddit-60ee29982247d1dd8160b043015640f4a660a175.zip
Enable quick scale in ViewImageOrGifActivity and ViewRedditGalleryImageOrGifFragment.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageOrGifActivity.java3
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewRedditGalleryImageOrGifFragment.java3
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Post/PostDataSource.java5
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AdvancedPreferenceFragment.java2
-rw-r--r--app/src/main/res/values/strings.xml2
5 files changed, 6 insertions, 9 deletions
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<String, Post> {
@Override
public void loadInitial(@NonNull LoadInitialParams<String> params, @NonNull final LoadInitialCallback<String, Post> 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 @@
<string name="delete_all_sort_types_success">Delete all sort types successful</string>
<string name="delete_all_post_layouts_success">Delete all post layouts successful</string>
<string name="delete_all_themes_success">Delete all themes successful</string>
- <string name="delete_all_post_feed_scrolled_positions_success">Delete all post feed scrolled positions successful</string>
+ <string name="delete_all_front_page_scrolled_positions_success">Delete all scrolled positions in front page successful</string>
<string name="reset_all_settings_success">Reset all settings successful</string>
<string name="theme_preview">Theme Preview</string>