mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
added one finger zooming
This commit is contained in:
parent
ebf3bb5a63
commit
1942140187
6 changed files with 35 additions and 1 deletions
|
@ -59,6 +59,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
setupShowInfoBubble()
|
||||
setupShowExtendedDetails()
|
||||
setupManageExtendedDetails()
|
||||
setupOneFingerZoom()
|
||||
updateTextColors(settings_holder)
|
||||
}
|
||||
|
||||
|
@ -312,4 +313,12 @@ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ class PhotoFragment : ViewPagerFragment() {
|
|||
view.subsampling_view.apply {
|
||||
maxScale = 10f
|
||||
beVisible()
|
||||
isQuickScaleEnabled = false
|
||||
isQuickScaleEnabled = context.config.oneFingerZoom
|
||||
setImage(ImageSource.uri(medium.path))
|
||||
orientation = if (orient == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(orient)
|
||||
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
||||
|
|
|
@ -168,6 +168,10 @@ 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(loop) = prefs.edit().putBoolean(ONE_FINGER_ZOOM, loop).apply()
|
||||
|
||||
private fun getDirectoryColumnsField(): String {
|
||||
val isPortrait = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
|
||||
return if (isPortrait) {
|
||||
|
|
|
@ -43,6 +43,7 @@ val VIEW_TYPE_FILES = "view_type_files"
|
|||
val SHOW_EXTENDED_DETAILS = "show_extended_details"
|
||||
val EXTENDED_DETAILS = "extended_details"
|
||||
val LAST_FILE_CLEANUP = "last_file_cleanup"
|
||||
val ONE_FINGER_ZOOM = "one_finger_zoom"
|
||||
|
||||
// slideshow
|
||||
val SLIDESHOW_INTERVAL = "slideshow_interval"
|
||||
|
|
|
@ -464,6 +464,25 @@
|
|||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/show_extended_details"/>
|
||||
</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:padding="@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:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/one_finger_zoom"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
|
||||
This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
|
||||
</string>
|
||||
<string name="one_finger_zoom">Toggle one finger zoom</string>
|
||||
|
||||
<!--
|
||||
Haven't found some strings? There's more at
|
||||
|
|
Loading…
Reference in a new issue