diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5bfefa9e4..bc94bd5b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,19 @@
Changelog
==========
+Version 3.3.0 *(2018-01-23)*
+----------------------------
+
+ * Added optional one-finger drag zoom at fullscreen media (by gh123man)
+ * Allow opening the app even without any media files (by gh123man)
+ * Refresh media files in the background when Simple Camera creates a new photo/video
+ * Improve fullscreen media rotation by "Device Rotation"
+
+Version 3.2.4 *(2018-01-17)*
+----------------------------
+
+ * An F-droid build only, trying to add screenshots there
+
Version 3.2.3 *(2018-01-14)*
----------------------------
diff --git a/README.md b/README.md
index 9d5d26e5c..b804ef6d6 100644
--- a/README.md
+++ b/README.md
@@ -13,15 +13,17 @@ Contains no ads or unnecessary permissions. It is fully opensource, provides cus
This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
-
+
-
-
-
+
License
-------
- Copyright 2017 SimpleMobileTools
+ Copyright 2016-present SimpleMobileTools
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/app/build.gradle b/app/build.gradle
index e3a1c5dd1..205e7ff6a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,13 +4,14 @@ apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
+ buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.simplemobiletools.gallery"
minSdkVersion 16
targetSdkVersion 27
- versionCode 156
- versionName "3.2.3"
+ versionCode 158
+ versionName "3.3.0"
multiDexEnabled true
setProperty("archivesBaseName", "gallery")
}
@@ -42,7 +43,7 @@ ext {
}
dependencies {
- implementation 'com.simplemobiletools:commons:3.7.2'
+ implementation 'com.simplemobiletools:commons:3.8.11'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.google.code.gson:gson:2.8.2'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c49d7cf4d..8eead3683 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -207,5 +207,13 @@
+
+
+
+
+
+
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
index d8423670e..82d85fffd 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -127,7 +127,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_vertical_fastscroller.updateBubbleColors()
invalidateOptionsMenu()
directories_empty_text_label.setTextColor(config.textColor)
- directories_empty_text.setTextColor(config.primaryColor)
+ directories_empty_text.setTextColor(getAdjustedPrimaryColor())
if (mIsPasswordProtectionPending) {
handleAppPasswordProtection {
@@ -548,10 +548,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_horizontal_fastscroller.beVisibleIf(directories_grid.isVisible() && allowHorizontalScroll)
checkLastMediaChanged()
- if (dirs.hashCode() == mDirs.hashCode()) {
- return
- }
-
mDirs = dirs
runOnUiThread {
@@ -680,6 +676,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
add(Release(137, R.string.release_137))
add(Release(138, R.string.release_138))
add(Release(143, R.string.release_143))
+ add(Release(158, R.string.release_158))
checkWhatsNew(this, BuildConfig.VERSION_CODE)
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
index e8d13e7fb..e9b36642f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
@@ -59,7 +59,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private var mStoredScrollHorizontally = true
private var mStoredShowInfoBubble = true
private var mStoredTextColor = 0
- private var mLastDrawnHashCode = 0
private var mLatestMediaId = 0L
private var mLastMediaHandler = Handler()
private var mCurrAsyncTask: GetMediaAsynctask? = null
@@ -120,7 +119,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
tryloadGallery()
invalidateOptionsMenu()
media_empty_text_label.setTextColor(config.textColor)
- media_empty_text.setTextColor(config.primaryColor)
+ media_empty_text.setTextColor(getAdjustedPrimaryColor())
}
override fun onPause() {
@@ -603,11 +602,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
checkLastMediaChanged()
- if (media.hashCode() == mMedia.hashCode() && media.hashCode() == mLastDrawnHashCode) {
- return
- }
-
- mLastDrawnHashCode = media.hashCode()
mMedia = media
runOnUiThread {
setupAdapter()
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt
index ef52e77a2..602154896 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt
@@ -9,10 +9,7 @@ import android.view.Menu
import android.view.MenuItem
import android.view.View
import com.simplemobiletools.commons.dialogs.PropertiesDialog
-import com.simplemobiletools.commons.extensions.getFilenameFromUri
-import com.simplemobiletools.commons.extensions.getRealPathFromURI
-import com.simplemobiletools.commons.extensions.scanPath
-import com.simplemobiletools.commons.extensions.toast
+import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.REAL_FILE_PATH
@@ -21,14 +18,13 @@ import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.fragments.PhotoFragment
import com.simplemobiletools.gallery.fragments.VideoFragment
import com.simplemobiletools.gallery.fragments.ViewPagerFragment
-import com.simplemobiletools.gallery.helpers.IS_VIEW_INTENT
-import com.simplemobiletools.gallery.helpers.MEDIUM
-import com.simplemobiletools.gallery.helpers.PATH
+import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.fragment_holder.*
import java.io.File
open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentListener {
+
private var mMedium: Medium? = null
private var mIsFullScreen = false
private var mIsFromGallery = false
@@ -52,6 +48,14 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
}
}
+ override fun onResume() {
+ super.onResume()
+ supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background))
+ if (config.blackBackground) {
+ updateStatusbarColor(Color.BLACK)
+ }
+ }
+
private fun checkIntent(savedInstanceState: Bundle? = null) {
mUri = intent.data ?: return
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
@@ -78,7 +82,13 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
showSystemUI()
val bundle = Bundle()
val file = File(mUri.toString())
- mMedium = Medium(getFilenameFromUri(mUri!!), mUri.toString(), mIsVideo, 0, 0, file.length())
+ val type = when {
+ file.isImageFast() -> TYPE_IMAGE
+ file.isVideoFast() -> TYPE_VIDEO
+ else -> TYPE_GIF
+ }
+
+ mMedium = Medium(getFilenameFromUri(mUri!!), mUri.toString(), 0, 0, file.length(), type)
supportActionBar?.title = mMedium!!.name
bundle.putSerializable(MEDIUM, mMedium)
@@ -99,14 +109,6 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
}
}
- override fun onResume() {
- super.onResume()
- supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background))
- if (config.blackBackground) {
- updateStatusbarColor(Color.BLACK)
- }
- }
-
private fun sendViewPagerIntent(path: String) {
Intent(this, ViewPagerActivity::class.java).apply {
putExtra(IS_VIEW_INTENT, true)
@@ -157,4 +159,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
}
override fun videoEnded() = false
+
+ override fun goToPrevItem() {}
+
+ override fun goToNextItem() {}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
index ad9dc2043..4b08f6971 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
@@ -6,10 +6,7 @@ import android.os.Bundle
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.dialogs.SecurityDialog
-import com.simplemobiletools.commons.extensions.beVisibleIf
-import com.simplemobiletools.commons.extensions.handleHiddenFolderPasswordProtection
-import com.simplemobiletools.commons.extensions.updateTextColors
-import com.simplemobiletools.commons.extensions.useEnglishToggled
+import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PROTECTION_FINGERPRINT
import com.simplemobiletools.commons.helpers.SHOW_ALL_TABS
import com.simplemobiletools.commons.models.RadioItem
@@ -58,9 +55,18 @@ class SettingsActivity : SimpleActivity() {
setupKeepLastModified()
setupShowInfoBubble()
setupOneFingerZoom()
+ setupAllowInstantChange()
setupShowExtendedDetails()
setupManageExtendedDetails()
updateTextColors(settings_holder)
+ setupSectionColors()
+ }
+
+ private fun setupSectionColors() {
+ val adjustedPrimaryColor = getAdjustedPrimaryColor()
+ arrayListOf(visibility_label, videos_label, thumbnails_label, scrolling_label, fullscreen_media_label, security_label, file_operations_label).forEach {
+ it.setTextColor(adjustedPrimaryColor)
+ }
}
private fun setupCustomizeColors() {
@@ -281,6 +287,14 @@ class SettingsActivity : SimpleActivity() {
}
}
+ private fun setupAllowInstantChange() {
+ settings_allow_instant_change.isChecked = config.allowInstantChange
+ settings_allow_instant_change_holder.setOnClickListener {
+ settings_allow_instant_change.toggle()
+ config.allowInstantChange = settings_allow_instant_change.isChecked
+ }
+ }
+
private fun setupShowExtendedDetails() {
settings_show_extended_details.isChecked = config.showExtendedDetails
settings_show_extended_details_holder.setOnClickListener {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
index 348b78881..26104988a 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
@@ -12,7 +12,6 @@ import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.Matrix
import android.graphics.drawable.ColorDrawable
-import android.hardware.SensorManager
import android.media.ExifInterface
import android.net.Uri
import android.os.Build
@@ -21,7 +20,10 @@ import android.os.Handler
import android.provider.MediaStore
import android.support.v4.view.ViewPager
import android.util.DisplayMetrics
-import android.view.*
+import android.view.Menu
+import android.view.MenuItem
+import android.view.View
+import android.view.WindowManager
import android.view.animation.DecelerateInterpolator
import com.bumptech.glide.Glide
import com.simplemobiletools.commons.dialogs.PropertiesDialog
@@ -48,17 +50,14 @@ import java.io.*
import java.util.*
class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, ViewPagerFragment.FragmentListener {
- private var mOrientationEventListener: OrientationEventListener? = null
private var mPath = ""
private var mDirectory = ""
-
private var mIsFullScreen = false
private var mPos = -1
private var mShowAll = false
private var mIsSlideshowActive = false
private var mSkipConfirmationDialog = false
private var mRotationDegrees = 0f
- private var mLastHandledOrientation = 0
private var mPrevHashcode = 0
private var mSlideshowHandler = Handler()
@@ -125,7 +124,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
override fun onPause() {
super.onPause()
- mOrientationEventListener?.disable()
stopSlideshow()
storeStateVariables()
}
@@ -146,7 +144,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
private fun initViewPager() {
- setupOrientationEventListener()
measureScreen()
val uri = intent.data
if (uri != null) {
@@ -214,8 +211,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
view_pager.background = ColorDrawable(Color.BLACK)
}
- if (config.hideSystemUI)
+ if (config.hideSystemUI) {
fragmentClicked()
+ }
window.decorView.setOnSystemUiVisibilityChangeListener { visibility ->
mIsFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
@@ -231,35 +229,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LOCKED
}
- } else if (config.screenRotation == ROTATE_BY_DEVICE_ROTATION && mOrientationEventListener?.canDetectOrientation() == true) {
- mOrientationEventListener?.enable()
+ } else if (config.screenRotation == ROTATE_BY_DEVICE_ROTATION) {
+ requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR
} else if (config.screenRotation == ROTATE_BY_SYSTEM_SETTING) {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
}
}
- private fun setupOrientationEventListener() {
- mOrientationEventListener = object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) {
- override fun onOrientationChanged(orientation: Int) {
- val currOrient = when (orientation) {
- in 75..134 -> ORIENT_LANDSCAPE_RIGHT
- in 225..285 -> ORIENT_LANDSCAPE_LEFT
- else -> ORIENT_PORTRAIT
- }
-
- if (!mIsOrientationLocked && mLastHandledOrientation != currOrient) {
- mLastHandledOrientation = currOrient
-
- requestedOrientation = when (currOrient) {
- ORIENT_LANDSCAPE_LEFT -> ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
- ORIENT_LANDSCAPE_RIGHT -> ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
- else -> ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
- }
- }
- }
- }
- }
-
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_viewpager, menu)
val currentMedium = getCurrentMedium() ?: return true
@@ -458,7 +434,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
if (config.slideshowRandomOrder) {
- Collections.shuffle(mSlideshowMedia)
+ mSlideshowMedia.shuffle()
mPos = 0
} else {
mPath = getCurrentPath()
@@ -843,11 +819,20 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
override fun videoEnded(): Boolean {
- if (mIsSlideshowActive)
+ if (mIsSlideshowActive) {
swipeToNextMedium()
+ }
return mIsSlideshowActive
}
+ override fun goToPrevItem() {
+ view_pager.setCurrentItem(view_pager.currentItem - 1, false)
+ }
+
+ override fun goToNextItem() {
+ view_pager.setCurrentItem(view_pager.currentItem + 1, false)
+ }
+
private fun checkSystemUI() {
if (mIsFullScreen) {
hideSystemUI()
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
index e1e0def89..a334e344d 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -17,6 +17,9 @@ import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog
import com.simplemobiletools.gallery.dialogs.PickMediumDialog
import com.simplemobiletools.gallery.extensions.*
+import com.simplemobiletools.gallery.helpers.TYPE_GIF
+import com.simplemobiletools.gallery.helpers.TYPE_IMAGE
+import com.simplemobiletools.gallery.helpers.TYPE_VIDEO
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST
import com.simplemobiletools.gallery.models.AlbumCover
import com.simplemobiletools.gallery.models.Directory
@@ -35,6 +38,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList) {
- dirs = newDirs
- notifyDataSetChanged()
- finishActMode()
+ if (newDirs.hashCode() != currentDirectoriesHash) {
+ currentDirectoriesHash = newDirs.hashCode()
+ dirs = newDirs
+ notifyDataSetChanged()
+ finishActMode()
+ }
}
fun updateAnimateGifs(animateGifs: Boolean) {
@@ -334,7 +341,13 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList TYPE_IMAGE
+ directory.tmb.isVideoFast() -> TYPE_VIDEO
+ else -> TYPE_GIF
+ }
+
+ activity.loadImage(thumbnailType, directory.tmb, dir_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
dir_pin.beVisibleIf(pinnedFolders.contains(directory.path))
dir_sd_card.beVisibleIf(activity.isPathOnSD(directory.path))
photo_cnt.beVisibleIf(showMediaCount)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
index 66df85b70..e54fd102c 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
@@ -38,6 +38,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList,
private var visibleItemPaths = ArrayList()
private var loadImageInstantly = false
private var delayHandler = Handler(Looper.getMainLooper())
+ private var currentMediaHash = media.hashCode()
private var scrollHorizontally = config.scrollHorizontally
private var animateGifs = config.animateGifs
@@ -246,10 +247,13 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList,
}
fun updateMedia(newMedia: ArrayList) {
- media = newMedia
- enableInstantLoad()
- notifyDataSetChanged()
- finishActMode()
+ if (newMedia.hashCode() != currentMediaHash) {
+ currentMediaHash = newMedia.hashCode()
+ media = newMedia
+ enableInstantLoad()
+ notifyDataSetChanged()
+ finishActMode()
+ }
}
fun updateDisplayFilenames(displayFilenames: Boolean) {
@@ -282,20 +286,20 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList,
private fun setupView(view: View, medium: Medium) {
view.apply {
- play_outline.beVisibleIf(medium.video)
+ play_outline.beVisibleIf(medium.isVideo())
photo_name.beVisibleIf(displayFilenames || isListViewType)
photo_name.text = medium.name
photo_name.tag = medium.path
if (loadImageInstantly) {
- activity.loadImage(medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
+ activity.loadImage(medium.type, medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
} else {
medium_thumbnail.setImageDrawable(null)
medium_thumbnail.isHorizontalScrolling = scrollHorizontally
delayHandler.postDelayed({
val isVisible = visibleItemPaths.contains(medium.path)
if (isVisible) {
- activity.loadImage(medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
+ activity.loadImage(medium.type, medium.path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
}
}, IMAGE_LOAD_DELAY)
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt
index 0f5d7fee3..0317a1b36 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt
@@ -23,7 +23,7 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m
bundle.putSerializable(MEDIUM, medium)
val fragment: ViewPagerFragment
- fragment = if (medium.video) {
+ fragment = if (medium.isVideo()) {
VideoFragment()
} else {
PhotoFragment()
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt
index 61264f169..b94fd0aed 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt
@@ -35,7 +35,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
activity.setupDialogStuff(view, this, R.string.select_photo)
}
- val media = activity.getCachedMedia(path).filter { !it.video } as ArrayList
+ val media = activity.getCachedMedia(path).filter { !it.isVideo() } as ArrayList
if (media.isNotEmpty()) {
gotMedia(media)
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt
index 9d3cd9335..46a10186f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt
@@ -22,6 +22,9 @@ import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.dialogs.PickDirectoryDialog
import com.simplemobiletools.gallery.helpers.NOMEDIA
+import com.simplemobiletools.gallery.helpers.TYPE_GIF
+import com.simplemobiletools.gallery.helpers.TYPE_IMAGE
+import com.simplemobiletools.gallery.helpers.TYPE_VIDEO
import com.simplemobiletools.gallery.models.Directory
import com.simplemobiletools.gallery.models.Medium
import com.simplemobiletools.gallery.views.MySquareImageView
@@ -113,7 +116,7 @@ fun BaseSimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
}
}
- scanFile(file) {
+ applicationContext.scanFile(file) {
callback()
}
}
@@ -139,15 +142,15 @@ fun BaseSimpleActivity.toggleFileVisibility(oldFile: File, hide: Boolean, callba
}
}
-fun Activity.loadImage(path: String, target: MySquareImageView, horizontalScroll: Boolean, animateGifs: Boolean, cropThumbnails: Boolean) {
+fun Activity.loadImage(type: Int, path: String, target: MySquareImageView, horizontalScroll: Boolean, animateGifs: Boolean, cropThumbnails: Boolean) {
target.isHorizontalScrolling = horizontalScroll
- if (path.isImageFast() || path.isVideoFast()) {
- if (path.isPng()) {
+ if (type == TYPE_IMAGE || type == TYPE_VIDEO) {
+ if (type == TYPE_IMAGE && path.isPng()) {
loadPng(path, target, cropThumbnails)
} else {
loadJpg(path, target, cropThumbnails)
}
- } else if (path.isGif()) {
+ } else if (type == TYPE_GIF) {
try {
val gifDrawable = GifDrawable(path)
target.setImageDrawable(gifDrawable)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
index 7bdff57d6..4bbc7ef34 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -49,7 +49,12 @@ class PhotoFragment : ViewPagerFragment() {
lateinit var medium: Medium
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
- view = inflater.inflate(R.layout.pager_photo_item, container, false) as ViewGroup
+ view = (inflater.inflate(R.layout.pager_photo_item, container, false) as ViewGroup).apply {
+ subsampling_view.setOnClickListener { photoClicked() }
+ gif_view.setOnClickListener { photoClicked() }
+ instant_prev_item.setOnClickListener { listener?.goToPrevItem() }
+ instant_next_item.setOnClickListener { listener?.goToNextItem() }
+ }
if (!isFragmentVisible && activity is PhotoActivity) {
isFragmentVisible = true
@@ -88,11 +93,8 @@ class PhotoFragment : ViewPagerFragment() {
}
isFullscreen = activity!!.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN
- view.subsampling_view.setOnClickListener { photoClicked() }
- view.gif_view.setOnClickListener { photoClicked() }
loadImage()
checkExtendedDetails()
-
wasInit = true
return view
@@ -109,6 +111,10 @@ class PhotoFragment : ViewPagerFragment() {
if (wasInit && (context!!.config.showExtendedDetails != storedShowExtendedDetails || context!!.config.extendedDetails != storedExtendedDetails)) {
checkExtendedDetails()
}
+
+ val allowInstantChange = context!!.config.allowInstantChange
+ view.instant_prev_item.beVisibleIf(allowInstantChange)
+ view.instant_next_item.beVisibleIf(allowInstantChange)
}
override fun setMenuVisibility(menuVisible: Boolean) {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
index 7ee976475..8b3099e43 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -36,6 +36,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
private var mTimerHandler: Handler? = null
private var mSeekBar: SeekBar? = null
private var mTimeHolder: View? = null
+ private var mView: View? = null
private var mIsPlaying = false
private var mIsDragged = false
@@ -62,12 +63,15 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
private var mSlideInfoText = ""
private var mSlideInfoFadeHandler = Handler()
- lateinit var mView: View
lateinit var medium: Medium
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
- mView = inflater.inflate(R.layout.pager_video_item, container, false)
- mTimeHolder = mView.video_time_holder
+ mView = inflater.inflate(R.layout.pager_video_item, container, false).apply {
+ instant_prev_item.setOnClickListener { listener?.goToPrevItem() }
+ instant_next_item.setOnClickListener { listener?.goToNextItem() }
+ mTimeHolder = video_time_holder
+ }
+
medium = arguments!!.getSerializable(MEDIUM) as Medium
// setMenuVisibility is not called at VideoActivity (third party intent)
@@ -89,9 +93,16 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
override fun onResume() {
super.onResume()
- activity!!.updateTextColors(mView.video_holder)
- mView.video_volume_controller.beVisibleIf(context!!.config.allowVideoGestures)
- mView.video_brightness_controller.beVisibleIf(context!!.config.allowVideoGestures)
+ activity!!.updateTextColors(mView!!.video_holder)
+ val allowVideoGestures = context!!.config.allowVideoGestures
+ val allowInstantChange = context!!.config.allowInstantChange
+ mView!!.apply {
+ video_volume_controller.beVisibleIf(allowVideoGestures)
+ video_brightness_controller.beVisibleIf(allowVideoGestures)
+
+ instant_prev_item.beVisibleIf(allowInstantChange)
+ instant_next_item.beVisibleIf(allowInstantChange)
+ }
if (context!!.config.showExtendedDetails != mStoredShowExtendedDetails || context!!.config.extendedDetails != mStoredExtendedDetails) {
checkExtendedDetails()
@@ -116,19 +127,19 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
if (activity == null)
return
- mView.video_play_outline.setOnClickListener { togglePlayPause() }
+ mView!!.video_play_outline.setOnClickListener { togglePlayPause() }
- mSurfaceView = mView.video_surface
+ mSurfaceView = mView!!.video_surface
mSurfaceHolder = mSurfaceView!!.holder
mSurfaceHolder!!.addCallback(this)
mSurfaceView!!.setOnClickListener { toggleFullscreen() }
- mView.video_holder.setOnClickListener { toggleFullscreen() }
- mView.video_volume_controller.setOnTouchListener { v, event ->
+ mView!!.video_holder.setOnClickListener { toggleFullscreen() }
+ mView!!.video_volume_controller.setOnTouchListener { v, event ->
handleVolumeTouched(event)
true
}
- mView.video_brightness_controller.setOnTouchListener { v, event ->
+ mView!!.video_brightness_controller.setOnTouchListener { v, event ->
handleBrightnessTouched(event)
true
}
@@ -195,7 +206,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
val diffX = Math.abs(event.x - mTouchDownX)
val diffY = Math.abs(event.y - mTouchDownY)
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) {
- mView.video_holder.performClick()
+ mView!!.video_holder.performClick()
}
}
}
@@ -233,12 +244,12 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
val diffX = Math.abs(event.x - mTouchDownX)
val diffY = Math.abs(event.y - mTouchDownY)
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) {
- mView.video_holder.performClick()
+ mView!!.video_holder.performClick()
}
mTouchDownBrightness = mTempBrightness
}
}
- mView.video_holder
+ mView!!.video_holder
}
private fun getCurrentVolume() = context!!.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
@@ -254,14 +265,14 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
context!!.audioManager.setStreamVolume(stream, newVolume, 0)
val absolutePercent = ((newVolume / maxVolume.toFloat()) * 100).toInt()
- mView.slide_info.apply {
+ mView!!.slide_info.apply {
text = "$mSlideInfoText$absolutePercent%"
alpha = 1f
}
mSlideInfoFadeHandler.removeCallbacksAndMessages(null)
mSlideInfoFadeHandler.postDelayed({
- mView.slide_info.animate().alpha(0f)
+ mView!!.slide_info.animate().alpha(0f)
}, SLIDE_INFO_FADE_DELAY)
}
@@ -272,7 +283,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mTempBrightness = newBrightness.toInt()
val absolutePercent = ((newBrightness / maxBrightness) * 100).toInt()
- mView.slide_info.apply {
+ mView!!.slide_info.apply {
text = "$mSlideInfoText$absolutePercent%"
alpha = 1f
}
@@ -283,7 +294,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mSlideInfoFadeHandler.removeCallbacksAndMessages(null)
mSlideInfoFadeHandler.postDelayed({
- mView.slide_info.animate().alpha(0f)
+ mView!!.slide_info.animate().alpha(0f)
}, SLIDE_INFO_FADE_DELAY)
}
@@ -305,8 +316,8 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mTimeHolder!!.setPadding(left, top, right, bottom)
}
- mCurrTimeView = mView.video_curr_time
- mSeekBar = mView.video_seekbar
+ mCurrTimeView = mView!!.video_curr_time
+ mSeekBar = mView!!.video_seekbar
mSeekBar!!.setOnSeekBarChangeListener(this)
if (mIsFullscreen)
@@ -339,7 +350,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
private fun setupTimeHolder() {
mSeekBar!!.max = mDuration
- mView.video_duration.text = mDuration.getFormattedDuration()
+ mView!!.video_duration.text = mDuration.getFormattedDuration()
mTimerHandler = Handler()
setupTimer()
}
@@ -403,14 +414,14 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} else {
mPlayOnPrepare = true
}
- mView.video_play_outline.setImageDrawable(null)
+ mView!!.video_play_outline.setImageDrawable(null)
activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
private fun pauseVideo() {
mIsPlaying = false
mMediaPlayer?.pause()
- mView.video_play_outline.setImageDrawable(resources.getDrawable(R.drawable.img_play_outline_big))
+ mView?.video_play_outline?.setImageDrawable(resources.getDrawable(R.drawable.img_play_outline_big))
activity!!.window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
@@ -500,13 +511,15 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
override fun surfaceCreated(holder: SurfaceHolder) {
mSurfaceHolder = holder
- if (mIsFragmentVisible)
+ if (mIsFragmentVisible) {
initMediaPlayer()
+ }
}
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
- if (width != 0 && height != 0 && mSurfaceView != null)
+ if (width != 0 && height != 0 && mSurfaceView != null) {
setVideoSize()
+ }
}
override fun surfaceDestroyed(holder: SurfaceHolder) {
@@ -557,7 +570,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
private fun checkExtendedDetails() {
if (context!!.config.showExtendedDetails) {
- mView.video_details.apply {
+ mView!!.video_details.apply {
text = getMediumExtendedDetails(medium)
setTextColor(context.config.textColor)
beVisibleIf(text.isNotEmpty())
@@ -568,7 +581,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
}
}
} else {
- mView.video_details.beGone()
+ mView!!.video_details.beGone()
}
}
@@ -600,7 +613,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
override fun fullscreenToggled(isFullscreen: Boolean) {
mIsFullscreen = isFullscreen
checkFullscreen()
- mView.video_details.apply {
+ mView!!.video_details.apply {
if (isVisible()) {
animate().y(getExtendedDetailsY(height))
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt
index d4ddfa698..8cb977537 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt
@@ -16,6 +16,10 @@ abstract class ViewPagerFragment : Fragment() {
fun fragmentClicked()
fun videoEnded(): Boolean
+
+ fun goToPrevItem()
+
+ fun goToNextItem()
}
fun getMediumExtendedDetails(medium: Medium): String {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
index e294f6da1..e76e02c38 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
@@ -172,6 +172,10 @@ class Config(context: Context) : BaseConfig(context) {
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()
+
private fun getDirectoryColumnsField(): String {
val isPortrait = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
return if (isPortrait) {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
index cf5bd0fa3..1ef5d45b1 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
@@ -44,6 +44,7 @@ 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"
+val ALLOW_INSTANT_CHANGE = "allow_instant_change"
// slideshow
val SLIDESHOW_INTERVAL = "slideshow_interval"
@@ -101,3 +102,8 @@ val EXT_EXIF_PROPERTIES = 128
val EXT_DURATION = 256
val EXT_ARTIST = 512
val EXT_ALBUM = 1024
+
+// media types
+val TYPE_IMAGE = 1
+val TYPE_VIDEO = 2
+val TYPE_GIF = 3
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt
index e0e199df2..8f5eb9dec 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt
@@ -153,7 +153,13 @@ class MediaFetcher(val context: Context) {
val dateTaken = cur.getLongValue(MediaStore.Images.Media.DATE_TAKEN)
val dateModified = cur.getIntValue(MediaStore.Images.Media.DATE_MODIFIED) * 1000L
- val medium = Medium(filename, path, isVideo, dateModified, dateTaken, size)
+ val type = when {
+ isImage -> TYPE_IMAGE
+ isVideo -> TYPE_VIDEO
+ else -> TYPE_GIF
+ }
+
+ val medium = Medium(filename, path, dateModified, dateTaken, size, type)
curMedia.add(medium)
} catch (e: Exception) {
continue
@@ -255,7 +261,13 @@ class MediaFetcher(val context: Context) {
val dateTaken = file.lastModified()
val dateModified = file.lastModified()
- val medium = Medium(filename, file.absolutePath, isVideo, dateModified, dateTaken, size)
+ val type = when {
+ isImage -> TYPE_IMAGE
+ isVideo -> TYPE_VIDEO
+ else -> TYPE_GIF
+ }
+
+ val medium = Medium(filename, file.absolutePath, dateModified, dateTaken, size, type)
val isAlreadyAdded = curMedia.any { it.path == file.absolutePath }
if (!isAlreadyAdded) {
curMedia.add(medium)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt
index 1d113e4aa..fb9e7a213 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt
@@ -1,22 +1,26 @@
package com.simplemobiletools.gallery.models
-import com.simplemobiletools.commons.extensions.*
+import com.simplemobiletools.commons.extensions.formatDate
+import com.simplemobiletools.commons.extensions.formatSize
+import com.simplemobiletools.commons.extensions.getMimeTypeFromPath
+import com.simplemobiletools.commons.extensions.isDng
import com.simplemobiletools.commons.helpers.*
+import com.simplemobiletools.gallery.helpers.TYPE_GIF
+import com.simplemobiletools.gallery.helpers.TYPE_IMAGE
+import com.simplemobiletools.gallery.helpers.TYPE_VIDEO
import java.io.Serializable
-data class Medium(var name: String, var path: String, val video: Boolean, val modified: Long, val taken: Long, val size: Long) : Serializable, Comparable {
+data class Medium(var name: String, var path: String, val modified: Long, val taken: Long, val size: Long, val type: Int) : Serializable, Comparable {
companion object {
private val serialVersionUID = -6553149366975455L
var sorting: Int = 0
}
- fun isPng() = path.isPng()
+ fun isGif() = type == TYPE_GIF
- fun isGif() = path.isGif()
+ fun isImage() = type == TYPE_IMAGE
- fun isJpg() = path.endsWith(".jpg", true) || path.endsWith(".jpeg", true)
-
- fun isImage() = !isGif() && !video
+ fun isVideo() = type == TYPE_VIDEO
fun isDng() = path.isDng()
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt
new file mode 100644
index 000000000..589f98b45
--- /dev/null
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt
@@ -0,0 +1,16 @@
+package com.simplemobiletools.gallery.receivers
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import com.google.gson.Gson
+import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
+import com.simplemobiletools.gallery.extensions.config
+
+class RefreshMediaReceiver : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ GetDirectoriesAsynctask(context, false, false) {
+ context.config.directories = Gson().toJson(it)
+ }.execute()
+ }
+}
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
index 9dfdfacac..00563ba86 100644
--- a/app/src/main/res/layout/activity_settings.xml
+++ b/app/src/main/res/layout/activity_settings.xml
@@ -30,6 +30,44 @@
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ android:text="@string/show_media_count"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/dialog_manage_extended_details.xml b/app/src/main/res/layout/dialog_manage_extended_details.xml
index a31a684a6..129adf95e 100644
--- a/app/src/main/res/layout/dialog_manage_extended_details.xml
+++ b/app/src/main/res/layout/dialog_manage_extended_details.xml
@@ -82,7 +82,7 @@
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1px"
- android:background="@color/divider_weak"
+ android:background="@color/divider_grey"
android:importantForAccessibility="no"/>
+
+
+
+
diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml
index d0be9b3d2..c8ddbf676 100644
--- a/app/src/main/res/layout/pager_video_item.xml
+++ b/app/src/main/res/layout/pager_video_item.xml
@@ -25,6 +25,18 @@
android:layout_width="@dimen/video_side_slider_width"
android:layout_height="match_parent"/>
+
+
+
+
عرض تفاصيل موسعة على وسائط ملء الشاشة
إدارة المجلدات المستبعدة
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml
index 4fdbd20e9..6f1726843 100644
--- a/app/src/main/res/values-ca/strings.xml
+++ b/app/src/main/res/values-ca/strings.xml
@@ -131,7 +131,12 @@
Reemplaçar Compartir per Girar al menú de pantalla complerta
Mostrar detalls estesos sobre mitjans a pantalla complerta
Gestioneu els detalls ampliats
- Allow one finger zoom at fullscreen media
+ Permet fer zoom amb un sol dit a pantalla complerta
+ Permet canviar els mitjans de manera instantània fent clic als costats de la pantalla
+
+
+ Miniatures
+ Mitjans a pantalla completa
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index a21f7f1cc..59d2f5b5b 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -132,6 +132,11 @@
Show extended details over fullscreen media
Manage extended details
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index fe08c5670..0dbe9ba7c 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -132,6 +132,11 @@
Eigenschaften anzeigen im Vollbild
Eigenschaften auswählen
Erlaube Ein-Finger-Zoom im Vollbild
+ Wechsle sofort zwischen Medien beim Klicken auf eine Bildschirmseite
+
+
+ Thumbnails
+ Vollbild-Medien
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index bd2951f78..6b5bba3b3 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -131,7 +131,12 @@
Reemplazar Compartir con Girar en el menú de pantalla completa
Mostrar detalles extendidos sobre medios en pantalla completa
Administrar detalles ampliados
- Allow one finger zoom at fullscreen media
+ Permitir zoom con un dedo en pantalla completa
+ Permitir el cambio instantáneo de medios haciendo clic en los lados de la pantalla
+
+
+ Miniaturas
+ Medios a pantalla compelta
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index a30a45fc7..0ebfd563c 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -132,6 +132,11 @@
Show extended details over fullscreen media
Manage extended details
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 8397e54da..8bf9120cc 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -132,6 +132,11 @@
Afficher les détails supplémentaires par dessus le média en plein écran
Gérer les détails supplémentaires
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml
index f21816bec..d20147d76 100644
--- a/app/src/main/res/values-gl/strings.xml
+++ b/app/src/main/res/values-gl/strings.xml
@@ -7,7 +7,7 @@
(oculto)
Fixar cartafol
Soltar cartafol
- Pin to the top
+ Fixar arriba
Mostrar o contido de todos os cartafoles
Todos os cartafoles
Mudar a vista por cartafol
@@ -81,7 +81,7 @@
Editar con
- Simple fondo de pantalla
+ Simple Fondo
Establecer como fondo de pantalla
Fallou establecer fondo de pantalla
Establecer fondo de pantalla con:
@@ -131,7 +131,12 @@
Substituír Compartir con Rotar no menú de pantalla completa
Mostrar información pormenorizada sobre medios a pantalla completa
Xestionar información polo miúdo
- Allow one finger zoom at fullscreen media
+ Permitir zoom con un dedo a pantalla completa
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml
index 9eb2d8e13..c3fa34712 100644
--- a/app/src/main/res/values-hr/strings.xml
+++ b/app/src/main/res/values-hr/strings.xml
@@ -132,6 +132,11 @@
Prikaži detaljne informacije pri pregledu datoteka
Upravljaj detaljnim informacijama
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index ea1320d45..b170b2ae3 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -132,6 +132,11 @@
Show extended details over fullscreen media
Manage extended details
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index ec978160c..341c91f91 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -7,7 +7,7 @@
(nascosta)
Blocca cartella
Sblocca cartella
- Pin to the top
+ Fissa in alto
Mostra tutti i contenuti
Tutti i media
Visualizza a cartelle
@@ -131,7 +131,12 @@
Sostituisci Condividi con Ruota a schermo intero
Mostra informazioni estese su media a schermo intero
Gestisci le informazioni estese
- Allow one finger zoom at fullscreen media
+ Abilita zoom con un dito su media a schermo intero
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 6fb2c015a..4ec08d44e 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -132,6 +132,11 @@
Show extended details over fullscreen media
Manage extended details
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml
index d07e4c6a5..4e8b1eb70 100644
--- a/app/src/main/res/values-ko-rKR/strings.xml
+++ b/app/src/main/res/values-ko-rKR/strings.xml
@@ -132,6 +132,11 @@
전체화면 모드에서 세부정보 표시
확장된 세부정보 관리
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml
index df73c1423..e88d5fff1 100644
--- a/app/src/main/res/values-nb/strings.xml
+++ b/app/src/main/res/values-nb/strings.xml
@@ -131,7 +131,12 @@
Erstatt Del med Roter i meny ved mediavisning
Vis flere detaljer i mediavisningen
Velg detaljer
- Allow one finger zoom at fullscreen media
+ Tillat en-finger-zoom i mediavisningen
+ Tillat å skifte media øyeblikkelig ved å klikke på kanten av skjermen
+
+
+ Minibilder
+ Mediavisning
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index b7259b32f..321d551ff 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -116,22 +116,27 @@
Bestandsnamen tonen
Video\'s herhalen
GIF-bestanden afspelen in overzicht
- Maximale helderheid in volledige weergave
+ Maximale helderheid in volledig scherm
Miniatuurvoorbeelden bijsnijden
- Media in volledige weergave roteren volgens
+ Media in volledig scherm roteren volgens
Systeeminstelling
Oriëntatie van apparaat
Afmetingen van bestand
- Zwarte achtergrond en statusbalk bij volledige weergave
+ Zwarte achtergrond en statusbalk bij volledig scherm
Horizontaal scrollen
- Statusbalk automatisch verbergen in volledige weergave
+ Statusbalk automatisch verbergen in volledig scherm
Lege mappen verwijderen na leegmaken
Volume en helderheid aanpassen met verticale gebaren
Aantallen in mappen tonen
- Menu-item Draaien vastzetten in volledige weergave (in plaats van Delen)
- Uitgebreide informatie tonen in volledige weergave
+ Menu-item Draaien vastzetten in volledig scherm (in plaats van Delen)
+ Uitgebreide informatie tonen in volledig scherm
Uitgebreide informatie
- Allow one finger zoom at fullscreen media
+ Met één vinger zoomen in volledig scherm
+ Direct naar vorige/volgende door op de zijkanten van het scherm te tikken
+
+
+ Miniatuurvoorbeelden
+ Volledig scherm
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index f86a8195c..8ae734ff3 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -132,6 +132,11 @@
Dodatkowe szczegóły przy podglądzie pełnoekranowym
Zarządzaj dodatkowymi szczegółami
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 2ba181d63..f902c70b9 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -132,6 +132,11 @@
Exibir detalhes extendidos quando em tela cheia
Gerenciar detalhes extendidos
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index cb9013d1c..4fb410d4d 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -132,6 +132,11 @@
Mostrar detalhes se em ecrã completo
Gerir detalhes exibidos
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 5155df63d..6727ecc0d 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -132,6 +132,11 @@
Показывать детали файла
Выбрать детали файла
Масштабирование одним пальцем в полноэкранном режиме
+ Мгновенное переключение медиафайлов кликом по краю экрана
+
+
+ Миниатюры
+ Полноэкранное отображение медиафайлов
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index c99b6ecfc..879c506ab 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -131,7 +131,12 @@
Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu
Zobraziť rozšírené vlastnosti ponad celoobrazovkové médiá
Spravovať rozšírené vlastnosti
- Allow one finger zoom at fullscreen media
+ Povoliť približovanie jedným prstom v celoobrazovkovom režime
+ Povoliť instantné prepínanie médií kliknutím na okraj obrazovky
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 743b21321..3f16c064c 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -132,6 +132,11 @@
Visa utökad information över media i helskärmsläge
Hantera utökad information
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 32195d8be..d93037695 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -132,6 +132,11 @@
Show extended details over fullscreen media
Manage extended details
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index c08640744..2f2102a94 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -132,6 +132,11 @@
全屏浏览媒体时显示详细信息
要显示的详细信息项目
单指缩放
+ 通过单击屏幕边缘来切换媒体
+
+
+ 缩略图
+ 全屏显示媒体
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 91fc82f8d..b73db9377 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -132,6 +132,11 @@
全螢幕時顯示詳細資訊
管理詳細資訊
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 96b5c1cdf..79994945c 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -3,8 +3,4 @@
#454545
#BB000000
#66000000
-
-
- @color/theme_dark_text_color
- @color/theme_dark_background_color
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 58e7e8c8e..cca10a70f 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -9,5 +9,6 @@
24dp
50dp
150dp
+ 60dp
72dp
diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml
index 5475edd14..9a25897f3 100644
--- a/app/src/main/res/values/donottranslate.xml
+++ b/app/src/main/res/values/donottranslate.xml
@@ -2,6 +2,7 @@
+ Added optional one-finger drag zoom, disabled by default
Added new options to use english language on non-english devices, to password protect whole app and to lock screen orientation at fullscreen view
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 29d275ace..b5415b8b3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -116,7 +116,7 @@
Toggle filename visibility
Loop videos
Animate GIFs at thumbnails
- Max brightness when viewing media
+ Max brightness when viewing fullscreen media
Crop thumbnails into squares
Rotate fullscreen media by
System setting
@@ -132,6 +132,11 @@
Show extended details over fullscreen media
Manage extended details
Allow one finger zoom at fullscreen media
+ Allow instantly changing media by clicking on screen sides
+
+
+ Thumbnails
+ Fullscreen media
diff --git a/build.gradle b/build.gradle
index 89e92a15c..66c86d612 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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.2.0'
+ ext.kotlin_version = '1.2.21'
repositories {
jcenter()
diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt
new file mode 100644
index 000000000..340ab8d4e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/full_description.txt
@@ -0,0 +1,9 @@
+A simple tool usable for viewing photos and videos. Items can be sorted by date, size, name both ascending or descending, photos can be zoomed in. Media files are shown in multiple columns depending on the size of the display, you can change the column count by pinch gestures. They can be renamed, shared, deleted, copied, moved. Images can also be cropped, rotated, flipped or set as Wallpaper directly from the app.
+
+The Gallery is also offered for third party usage for previewing images / videos, adding attachments at email clients etc. It's perfect for everyday usage.
+
+The fingerprint permission is needed for locking either hidden item visibility, or the whole app.
+
+Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.
+
+This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
diff --git a/fastlane/metadata/android/en-US/images/featureGraphic.png b/fastlane/metadata/android/en-US/images/featureGraphic.png
new file mode 100644
index 000000000..b72439b3f
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/featureGraphic.png differ
diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png
new file mode 100644
index 000000000..5357a274f
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/app.jpg b/fastlane/metadata/android/en-US/images/phoneScreenshots/app.jpg
new file mode 100644
index 000000000..e03971236
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/app.jpg differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/app_2.jpg b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_2.jpg
new file mode 100644
index 000000000..3c79bf959
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_2.jpg differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/app_3.jpg b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_3.jpg
new file mode 100644
index 000000000..e9778473f
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_3.jpg differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/app_4.jpg b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_4.jpg
new file mode 100644
index 000000000..9cd10f484
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_4.jpg differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/app_5.jpg b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_5.jpg
new file mode 100644
index 000000000..315243832
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_5.jpg differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/app_6.jpg b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_6.jpg
new file mode 100644
index 000000000..a0f0752fe
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/app_6.jpg differ
diff --git a/screenshots/tablet-7.jpg b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/tablet-7.jpg
similarity index 100%
rename from screenshots/tablet-7.jpg
rename to fastlane/metadata/android/en-US/images/sevenInchScreenshots/tablet-7.jpg
diff --git a/screenshots/tablet-10.jpg b/fastlane/metadata/android/en-US/images/tenInchScreenshots/tablet-10.jpg
similarity index 100%
rename from screenshots/tablet-10.jpg
rename to fastlane/metadata/android/en-US/images/tenInchScreenshots/tablet-10.jpg
diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt
new file mode 100644
index 000000000..7780d17e5
--- /dev/null
+++ b/fastlane/metadata/android/en-US/short_description.txt
@@ -0,0 +1 @@
+A gallery for viewing photos and videos without ads.
diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt
new file mode 100644
index 000000000..178b5506d
--- /dev/null
+++ b/fastlane/metadata/android/en-US/title.txt
@@ -0,0 +1 @@
+Simple Gallery
diff --git a/screenshots/app.jpg b/screenshots/app.jpg
deleted file mode 100644
index 6ad6c5a78..000000000
Binary files a/screenshots/app.jpg and /dev/null differ
diff --git a/screenshots/app_2.jpg b/screenshots/app_2.jpg
deleted file mode 100644
index 9c3f1883c..000000000
Binary files a/screenshots/app_2.jpg and /dev/null differ
diff --git a/screenshots/app_3.jpg b/screenshots/app_3.jpg
deleted file mode 100644
index 4d8bd9a12..000000000
Binary files a/screenshots/app_3.jpg and /dev/null differ
diff --git a/screenshots/app_4.jpg b/screenshots/app_4.jpg
deleted file mode 100644
index 30c7aec25..000000000
Binary files a/screenshots/app_4.jpg and /dev/null differ
diff --git a/screenshots/app_5.jpg b/screenshots/app_5.jpg
deleted file mode 100644
index f4298c2fa..000000000
Binary files a/screenshots/app_5.jpg and /dev/null differ
diff --git a/screenshots/app_6.jpg b/screenshots/app_6.jpg
deleted file mode 100644
index 0507ca9db..000000000
Binary files a/screenshots/app_6.jpg and /dev/null differ