adding a toggle for allowing deep zoomable images

This commit is contained in:
tibbi 2018-08-08 16:37:38 +02:00
parent b6b7f344c3
commit 458686865b
5 changed files with 41 additions and 1 deletions

View file

@ -66,6 +66,7 @@ class SettingsActivity : SimpleActivity() {
setupKeepLastModified() setupKeepLastModified()
setupShowInfoBubble() setupShowInfoBubble()
setupEnablePullToRefresh() setupEnablePullToRefresh()
setupAllowZoomingImages()
setupOneFingerZoom() setupOneFingerZoom()
setupAllowInstantChange() setupAllowInstantChange()
setupShowExtendedDetails() setupShowExtendedDetails()
@ -334,6 +335,16 @@ class SettingsActivity : SimpleActivity() {
} }
} }
private fun setupAllowZoomingImages() {
settings_one_finger_zoom_holder.beVisibleIf(config.allowZoomingImages)
settings_allow_zooming_images.isChecked = config.allowZoomingImages
settings_allow_zooming_images_holder.setOnClickListener {
settings_allow_zooming_images.toggle()
config.allowZoomingImages = settings_allow_zooming_images.isChecked
settings_one_finger_zoom_holder.beVisibleIf(config.allowZoomingImages)
}
}
private fun setupOneFingerZoom() { private fun setupOneFingerZoom() {
settings_one_finger_zoom.isChecked = config.oneFingerZoom settings_one_finger_zoom.isChecked = config.oneFingerZoom
settings_one_finger_zoom_holder.setOnClickListener { settings_one_finger_zoom_holder.setOnClickListener {

View file

@ -376,4 +376,8 @@ class Config(context: Context) : BaseConfig(context) {
var showRecycleBinAtFolders: Boolean var showRecycleBinAtFolders: Boolean
get() = prefs.getBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, true) get() = prefs.getBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, true)
set(showRecycleBinAtFolders) = prefs.edit().putBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, showRecycleBinAtFolders).apply() set(showRecycleBinAtFolders) = prefs.edit().putBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, showRecycleBinAtFolders).apply()
var allowZoomingImages: Boolean
get() = prefs.getBoolean(ALLOW_ZOOMING_IMAGES, true)
set(allowZoomingImages) = prefs.edit().putBoolean(ALLOW_ZOOMING_IMAGES, allowZoomingImages).apply()
} }

View file

@ -58,6 +58,7 @@ const val USE_RECYCLE_BIN = "use_recycle_bin"
const val GROUP_BY = "group_by" const val GROUP_BY = "group_by"
const val EVER_SHOWN_FOLDERS = "ever_shown_folders" const val EVER_SHOWN_FOLDERS = "ever_shown_folders"
const val SHOW_RECYCLE_BIN_AT_FOLDERS = "show_recycle_bin_at_folders" const val SHOW_RECYCLE_BIN_AT_FOLDERS = "show_recycle_bin_at_folders"
const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images"
// slideshow // slideshow
const val SLIDESHOW_INTERVAL = "slideshow_interval" const val SLIDESHOW_INTERVAL = "slideshow_interval"

View file

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

View file

@ -9,7 +9,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong