mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
adding a toggle for allowing deep zoomable images
This commit is contained in:
parent
b6b7f344c3
commit
458686865b
5 changed files with 41 additions and 1 deletions
|
@ -66,6 +66,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
setupKeepLastModified()
|
||||
setupShowInfoBubble()
|
||||
setupEnablePullToRefresh()
|
||||
setupAllowZoomingImages()
|
||||
setupOneFingerZoom()
|
||||
setupAllowInstantChange()
|
||||
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() {
|
||||
settings_one_finger_zoom.isChecked = config.oneFingerZoom
|
||||
settings_one_finger_zoom_holder.setOnClickListener {
|
||||
|
|
|
@ -376,4 +376,8 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
var showRecycleBinAtFolders: Boolean
|
||||
get() = prefs.getBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, true)
|
||||
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()
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ const val USE_RECYCLE_BIN = "use_recycle_bin"
|
|||
const val GROUP_BY = "group_by"
|
||||
const val EVER_SHOWN_FOLDERS = "ever_shown_folders"
|
||||
const val SHOW_RECYCLE_BIN_AT_FOLDERS = "show_recycle_bin_at_folders"
|
||||
const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images"
|
||||
|
||||
// slideshow
|
||||
const val SLIDESHOW_INTERVAL = "slideshow_interval"
|
||||
|
|
|
@ -596,6 +596,30 @@
|
|||
|
||||
</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
|
||||
android:id="@+id/settings_one_finger_zoom_holder"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -9,7 +9,7 @@ buildscript {
|
|||
}
|
||||
|
||||
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"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
Loading…
Reference in a new issue