do not allow disabling one finger zooming

This commit is contained in:
tibbi 2019-02-06 22:13:51 +01:00
parent bfaecc7eb5
commit 17e2e5ccfa
7 changed files with 3 additions and 48 deletions

View File

@ -75,7 +75,7 @@ dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.caverock:androidsvg-aar:1.3'
implementation 'com.github.tibbi:gestureviews:985ba285fb'
implementation 'com.github.tibbi:subsampling-scale-image-view:89c16d24c5'
implementation 'com.github.tibbi:subsampling-scale-image-view:40dc6ee2b1'
kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work
kapt 'androidx.room:room-compiler:2.0.0'

View File

@ -70,7 +70,6 @@ class SettingsActivity : SimpleActivity() {
setupEnablePullToRefresh()
setupAllowZoomingImages()
setupShowHighestQuality()
setupOneFingerZoom()
setupAllowOneToOneZoom()
setupAllowInstantChange()
setupShowExtendedDetails()
@ -402,7 +401,6 @@ class SettingsActivity : SimpleActivity() {
}
private fun updateDeepZoomToggleButtons() {
settings_one_finger_zoom_holder.beVisibleIf(config.allowZoomingImages)
settings_show_highest_quality_holder.beVisibleIf(config.allowZoomingImages)
settings_allow_one_to_one_zoom_holder.beVisibleIf(config.allowZoomingImages)
}
@ -415,14 +413,6 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupOneFingerZoom() {
settings_one_finger_zoom.isChecked = config.oneFingerZoom
settings_one_finger_zoom_holder.setOnClickListener {
settings_one_finger_zoom.toggle()
config.oneFingerZoom = settings_one_finger_zoom.isChecked
}
}
private fun setupAllowOneToOneZoom() {
settings_allow_one_to_one_zoom.isChecked = config.allowOneToOneZoom
settings_allow_one_to_one_zoom_holder.setOnClickListener {
@ -612,7 +602,6 @@ class SettingsActivity : SimpleActivity() {
put(SCREEN_ROTATION, config.screenRotation)
put(ALLOW_ZOOMING_IMAGES, config.allowZoomingImages)
put(SHOW_HIGHEST_QUALITY, config.showHighestQuality)
put(ONE_FINGER_ZOOM, config.oneFingerZoom)
put(ALLOW_ONE_TO_ONE_ZOOM, config.allowOneToOneZoom)
put(SHOW_EXTENDED_DETAILS, config.showExtendedDetails)
put(HIDE_EXTENDED_DETAILS, config.hideExtendedDetails)
@ -733,7 +722,6 @@ class SettingsActivity : SimpleActivity() {
SCREEN_ROTATION -> config.screenRotation = value.toInt()
ALLOW_ZOOMING_IMAGES -> config.allowZoomingImages = value.toBoolean()
SHOW_HIGHEST_QUALITY -> config.showHighestQuality = value.toBoolean()
ONE_FINGER_ZOOM -> config.oneFingerZoom = value.toBoolean()
ALLOW_ONE_TO_ONE_ZOOM -> config.allowOneToOneZoom = value.toBoolean()
SHOW_EXTENDED_DETAILS -> config.showExtendedDetails = value.toBoolean()
HIDE_EXTENDED_DETAILS -> config.hideExtendedDetails = value.toBoolean()

View File

@ -80,7 +80,6 @@ class PhotoFragment : ViewPagerFragment() {
private var mStoredHideExtendedDetails = false
private var mStoredAllowDeepZoomableImages = false
private var mStoredShowHighestQuality = false
private var mStoredAllowOneFingerZoom = false
private var mStoredExtendedDetails = 0
private lateinit var mView: ViewGroup
@ -199,8 +198,7 @@ class PhotoFragment : ViewPagerFragment() {
}
if (mWasInit) {
if (config.allowZoomingImages != mStoredAllowDeepZoomableImages || config.showHighestQuality != mStoredShowHighestQuality ||
config.oneFingerZoom != mStoredAllowOneFingerZoom) {
if (config.allowZoomingImages != mStoredAllowDeepZoomableImages || config.showHighestQuality != mStoredShowHighestQuality) {
mIsSubsamplingVisible = false
mView.subsampling_view.beGone()
loadImage()
@ -272,7 +270,6 @@ class PhotoFragment : ViewPagerFragment() {
mStoredHideExtendedDetails = hideExtendedDetails
mStoredAllowDeepZoomableImages = allowZoomingImages
mStoredShowHighestQuality = showHighestQuality
mStoredAllowOneFingerZoom = oneFingerZoom
mStoredExtendedDetails = extendedDetails
}
}
@ -456,7 +453,6 @@ class PhotoFragment : ViewPagerFragment() {
regionDecoderFactory = regionDecoder
maxScale = 10f
beVisible()
isQuickScaleEnabled = config.oneFingerZoom
isOneToOneZoomEnabled = config.allowOneToOneZoom
orientation = rotation + mCurrentRotationDegrees
setImage(path)

View File

@ -206,10 +206,6 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getInt(getDirectoryColumnsField(), getDefaultDirectoryColumnCount())
set(dirColumnCnt) = prefs.edit().putInt(getDirectoryColumnsField(), dirColumnCnt).apply()
var oneFingerZoom: Boolean
get() = prefs.getBoolean(ONE_FINGER_ZOOM, false)
set(oneFingerZoom) = prefs.edit().putBoolean(ONE_FINGER_ZOOM, oneFingerZoom).apply()
var allowInstantChange: Boolean
get() = prefs.getBoolean(ALLOW_INSTANT_CHANGE, false)
set(allowInstantChange) = prefs.edit().putBoolean(ALLOW_INSTANT_CHANGE, allowInstantChange).apply()

View File

@ -47,7 +47,6 @@ const val VIEW_TYPE_FILES = "view_type_files"
const val SHOW_EXTENDED_DETAILS = "show_extended_details"
const val EXTENDED_DETAILS = "extended_details"
const val HIDE_EXTENDED_DETAILS = "hide_extended_details"
const val ONE_FINGER_ZOOM = "one_finger_zoom"
const val ALLOW_INSTANT_CHANGE = "allow_instant_change"
const val DO_EXTRA_CHECK = "do_extra_check"
const val WAS_NEW_APP_SHOWN = "was_new_app_shown_clock"

View File

@ -819,30 +819,6 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_one_finger_zoom_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_one_finger_zoom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/one_finger_zoom"
app:switchPadding="@dimen/medium_margin"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_allow_one_to_one_zoom_holder"
android:layout_width="match_parent"

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.11'
ext.kotlin_version = '1.3.20'
repositories {
google()