mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +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()
|
setupShowInfoBubble()
|
||||||
setupShowExtendedDetails()
|
setupShowExtendedDetails()
|
||||||
setupManageExtendedDetails()
|
setupManageExtendedDetails()
|
||||||
|
setupOneFingerZoom()
|
||||||
updateTextColors(settings_holder)
|
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 {
|
view.subsampling_view.apply {
|
||||||
maxScale = 10f
|
maxScale = 10f
|
||||||
beVisible()
|
beVisible()
|
||||||
isQuickScaleEnabled = false
|
isQuickScaleEnabled = context.config.oneFingerZoom
|
||||||
setImage(ImageSource.uri(medium.path))
|
setImage(ImageSource.uri(medium.path))
|
||||||
orientation = if (orient == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(orient)
|
orientation = if (orient == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(orient)
|
||||||
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
||||||
|
|
|
@ -168,6 +168,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||||
get() = prefs.getInt(getDirectoryColumnsField(), getDefaultDirectoryColumnCount())
|
get() = prefs.getInt(getDirectoryColumnsField(), getDefaultDirectoryColumnCount())
|
||||||
set(dirColumnCnt) = prefs.edit().putInt(getDirectoryColumnsField(), dirColumnCnt).apply()
|
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 {
|
private fun getDirectoryColumnsField(): String {
|
||||||
val isPortrait = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
|
val isPortrait = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
|
||||||
return if (isPortrait) {
|
return if (isPortrait) {
|
||||||
|
|
|
@ -43,6 +43,7 @@ val VIEW_TYPE_FILES = "view_type_files"
|
||||||
val SHOW_EXTENDED_DETAILS = "show_extended_details"
|
val SHOW_EXTENDED_DETAILS = "show_extended_details"
|
||||||
val EXTENDED_DETAILS = "extended_details"
|
val EXTENDED_DETAILS = "extended_details"
|
||||||
val LAST_FILE_CLEANUP = "last_file_cleanup"
|
val LAST_FILE_CLEANUP = "last_file_cleanup"
|
||||||
|
val ONE_FINGER_ZOOM = "one_finger_zoom"
|
||||||
|
|
||||||
// slideshow
|
// slideshow
|
||||||
val SLIDESHOW_INTERVAL = "slideshow_interval"
|
val SLIDESHOW_INTERVAL = "slideshow_interval"
|
||||||
|
|
|
@ -464,6 +464,25 @@
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
android:paddingLeft="@dimen/medium_margin"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:text="@string/show_extended_details"/>
|
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>
|
</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
|
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>
|
||||||
|
<string name="one_finger_zoom">Toggle one finger zoom</string>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Haven't found some strings? There's more at
|
Haven't found some strings? There's more at
|
||||||
|
|
Loading…
Reference in a new issue