From 78a76e785337d7db95340723b735f0906b4b4bdc Mon Sep 17 00:00:00 2001
From: Pzqqt <821026875@qq.com>
Date: Sat, 13 Oct 2018 23:23:32 +0800
Subject: [PATCH 01/62] Update strings.xml
---
app/src/main/res/values-zh-rCN/strings.xml | 48 +++++++++++-----------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 9cd3d2a65..b7a446090 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -24,13 +24,13 @@
亮度
锁定方向
解锁方向
- Change orientation
- Force portrait
- Force landscape
- Use default orientation
- Fix Date Taken value
- Fixing…
- Dates fixed successfully
+ 改变方向
+ 强制竖屏
+ 强制横屏
+ 默认
+ 修复拍摄日期
+ 正在修复…
+ 日期修复成功
要显示的媒体文件
@@ -88,7 +88,7 @@
水平翻转
垂直翻转
编辑方式
- Free
+ 自由
简约壁纸
@@ -154,25 +154,25 @@
要显示的详细信息项目
单指缩放
通过单击屏幕边缘来切换媒体
- Allow deep zooming images
+ 允许深度放大图像
当状态栏隐藏时隐藏扩展详情
额外检查以避免显示无效的文件
- 在屏幕底部显示一些操作按钮
- Show the Recycle Bin at the folders screen
- Deep zoomable images
- Show images in the highest possible quality
- Show the Recycle Bin as the last item on the main screen
+ 显示底栏
+ 在文件夹界面显示回收站
+ 深度放大图像
+ 以最高质量显示图像
+ 在主屏幕界面的最后一项显示回收站
缩略图
全屏显示媒体
扩展详情
- Bottom actions
+ 底栏选项
- Manage visible bottom actions
- Toggle favorite
- Toggle file visibility
+ 管理底栏选项
+ 收藏
+ 隐藏文件
如何把简约图库设置为设备的默认图库?
@@ -197,12 +197,12 @@
当然,通过长按图片缩略图并选择编辑,或在全屏视图中选择编辑来打开编辑器。你可以通过拖动图片边角来剪裁图像。
我能将媒体文件缩略图分组吗?
当然,只需在缩略图视图中使用\"分组依据\"菜单项即可。您可以依据多个条件对文件进行分组,包括拍摄日期。如果您使用了\"显示所有文件夹内容\"功能,则可以按文件夹对它们进行分组。
- Sorting by Date Taken doesn\'t seem to work properly, how can I fix it?
- It is most likely caused by the files being copied from somewhere. You can fix it by selecting the file thumbnails and selecting \"Fix Date Taken value\".
- I see some color banding on the images. How can I improve the quality?
- The current solution for displaying images works fine in the vast majority of cases, but if you want even better image quality, you can enable the \"Show images in the highest possible quality\" at the app settings, in the \"Deep zoomable images\" section.
- I have hidden a file/folder. How can I unhide it?
- You can either press the \"Temporarily show hidden items\" menu item at the main screen, or toggle \"Show hidden items\" in the app settings to see the hidden item. If you want to unhide it, just long press it and select \"Unhide\". Folders are hidden by adding a hidden \".nomedia\" file into them, you can delete the file with any file manager too.
+ 按拍摄日期排序似乎有异常,我该如何解决?
+ 很可能是因为图片是从某处复制过来的。您可以长按文件缩略图并选择\"修复拍摄日期\"来修复它。
+ 我看到图像上有一些色带。如何提高提高质量?
+ 目前显示图像的方案在绝大多数情况下都能正常工作,如果您想要更好的图像质量,您可以在设置中启用\"以最高质量显示图像\"。
+ 我隐藏了某个文件/文件夹。如何取消隐藏?
+ 您可以点击主界面上的\"暂时显示隐藏的项目\"选项,或在设置中开启\"显示隐藏的项目\"。 如果你想取消隐藏它,长按它并选择\"取消隐藏\"即可。 我们是通过向文件夹中添加\".nomedia\"文件来隐藏文件夹的,使用文件管理器删除该文件也可以取消隐藏。
From 78bcf8adb8e7a892fa1ecf20f75027482d9199bc Mon Sep 17 00:00:00 2001
From: tibbi
Date: Tue, 16 Oct 2018 23:56:05 +0200
Subject: [PATCH 02/62] updating Commons, min Android version to 5 + adapter
changes
---
app/build.gradle | 6 +-
.../gallery/activities/MainActivity.kt | 3 +-
.../gallery/activities/MediaActivity.kt | 2 +-
.../gallery/activities/PanoramaActivity.kt | 8 +-
.../activities/SetWallpaperActivity.kt | 3 +-
.../gallery/activities/ViewPagerActivity.kt | 33 ++--
.../gallery/adapters/DirectoryAdapter.kt | 150 ++++++++----------
.../gallery/adapters/FiltersAdapter.kt | 21 ++-
.../gallery/adapters/ManageFoldersAdapter.kt | 31 ++--
.../adapters/ManageHiddenFoldersAdapter.kt | 35 ++--
.../gallery/adapters/MediaAdapter.kt | 117 +++++++-------
.../gallery/adapters/MyPagerAdapter.kt | 2 +-
.../gallery/extensions/Activity.kt | 6 +-
.../gallery/extensions/Context.kt | 4 +-
.../gallery/fragments/PhotoFragment.kt | 22 +--
.../gallery/fragments/VideoFragment.kt | 43 ++---
.../interfaces/FilterAdapterListener.kt | 9 --
app/src/main/res/values-v21/styles.xml | 7 -
app/src/main/res/values/styles.xml | 1 +
build.gradle | 2 +-
20 files changed, 209 insertions(+), 296 deletions(-)
delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/FilterAdapterListener.kt
delete mode 100644 app/src/main/res/values-v21/styles.xml
diff --git a/app/build.gradle b/app/build.gradle
index 1141d8232..50299afc5 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -9,7 +9,7 @@ android {
defaultConfig {
applicationId "com.simplemobiletools.gallery"
- minSdkVersion 16
+ minSdkVersion 21
targetSdkVersion 28
versionCode 201
versionName "4.6.5"
@@ -43,7 +43,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:4.9.1'
+ implementation 'com.simplemobiletools:commons:5.1.2'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
@@ -65,7 +65,7 @@ dependencies {
implementation 'com.github.tibbi:subsampling-scale-image-view:v3.10.1-fork'
// implementation 'com.github.chrisbanes:PhotoView:2.1.4'
- implementation 'com.github.tibbi:PhotoView:2.1.4-fork'
+ implementation 'com.github.tibbi:PhotoView:2.2.0-fork'
}
Properties props = new Properties()
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 4590512cb..ce4c12e27 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -12,7 +12,6 @@ import android.view.MenuItem
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.Toast
-import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
import com.simplemobiletools.commons.dialogs.FilePickerDialog
@@ -966,7 +965,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
private fun checkLastMediaChanged() {
- if (isActivityDestroyed()) {
+ if (isDestroyed) {
return
}
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 1dd2514b6..0d37b2013 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
@@ -398,7 +398,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
}
private fun checkLastMediaChanged() {
- if (isActivityDestroyed()) {
+ if (isDestroyed) {
return
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt
index e1131e92f..e13f4e055 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt
@@ -1,11 +1,9 @@
package com.simplemobiletools.gallery.activities
-import android.annotation.TargetApi
import android.content.res.Configuration
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
-import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.Window
@@ -17,7 +15,6 @@ import com.simplemobiletools.commons.extensions.beVisible
import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
-import com.simplemobiletools.commons.helpers.isLollipopPlus
import com.simplemobiletools.commons.helpers.isPiePlus
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.extensions.*
@@ -65,7 +62,6 @@ open class PanoramaActivity : SimpleActivity() {
}
}
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onResume() {
super.onResume()
panorama_view.resumeRendering()
@@ -74,9 +70,7 @@ open class PanoramaActivity : SimpleActivity() {
updateStatusbarColor(Color.BLACK)
}
- if (isLollipopPlus()) {
- window.statusBarColor = resources.getColor(R.color.circle_black_background)
- }
+ window.statusBarColor = resources.getColor(R.color.circle_black_background)
}
override fun onPause() {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt
index 5f02df853..8fd8dcfb5 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt
@@ -10,7 +10,6 @@ import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
-import com.simplemobiletools.commons.extensions.isActivityDestroyed
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.isNougatPlus
import com.simplemobiletools.commons.models.RadioItem
@@ -113,7 +112,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete
@SuppressLint("NewApi")
override fun onCropImageComplete(view: CropImageView?, result: CropImageView.CropResult) {
- if (isActivityDestroyed())
+ if (isDestroyed)
return
if (result.error == null) {
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 9a318db83..03cd4a0fa 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
@@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.activities
import android.animation.Animator
import android.animation.ValueAnimator
-import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.app.Activity
import android.content.Intent
@@ -20,13 +19,13 @@ import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.provider.MediaStore
-import androidx.viewpager.widget.ViewPager
import android.util.DisplayMetrics
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.view.WindowManager
import android.view.animation.DecelerateInterpolator
+import androidx.viewpager.widget.ViewPager
import com.bumptech.glide.Glide
import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog
@@ -103,7 +102,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
initFavorites()
}
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onResume() {
super.onResume()
if (!hasPermission(PERMISSION_WRITE_STORAGE)) {
@@ -112,9 +110,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
if (config.bottomActions) {
- if (isLollipopPlus()) {
- window.navigationBarColor = Color.TRANSPARENT
- }
+ window.navigationBarColor = Color.TRANSPARENT
} else {
setTranslucentNavigation()
}
@@ -135,9 +131,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
supportActionBar?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
- if (isLollipopPlus()) {
- window.statusBarColor = Color.TRANSPARENT
- }
+ window.statusBarColor = Color.TRANSPARENT
}
override fun onPause() {
@@ -225,7 +219,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
supportActionBar?.title = mPath.getFilenameFromPath()
view_pager.onGlobalLayout {
- if (!isActivityDestroyed()) {
+ if (!isDestroyed) {
if (mMediaFiles.isNotEmpty()) {
gotMedia(mMediaFiles as ArrayList)
}
@@ -365,7 +359,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun updatePagerItems(media: MutableList) {
val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, media)
- if (!isActivityDestroyed()) {
+ if (!isDestroyed) {
view_pager.apply {
adapter = pagerAdapter
currentItem = mPos
@@ -384,7 +378,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun startSlideshow() {
if (getMediaForSlideshow()) {
view_pager.onGlobalLayout {
- if (!isActivityDestroyed()) {
+ if (!isDestroyed) {
hideSystemUI(true)
mSlideshowInterval = config.slideshowInterval
mSlideshowMoveBackwards = config.slideshowMoveBackwards
@@ -474,7 +468,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
if (mIsSlideshowActive) {
if (getCurrentMedium()!!.isImage() || getCurrentMedium()!!.isGIF()) {
mSlideshowHandler.postDelayed({
- if (mIsSlideshowActive && !isActivityDestroyed()) {
+ if (mIsSlideshowActive && !isDestroyed) {
swipeToNextMedium()
}
}, mSlideshowInterval * 1000L)
@@ -980,18 +974,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
initBottomActionsLayout()
}
- @SuppressLint("NewApi")
private fun measureScreen() {
val metrics = DisplayMetrics()
- if (isJellyBean1Plus()) {
- windowManager.defaultDisplay.getRealMetrics(metrics)
- screenWidth = metrics.widthPixels
- screenHeight = metrics.heightPixels
- } else {
- windowManager.defaultDisplay.getMetrics(metrics)
- screenWidth = metrics.widthPixels
- screenHeight = metrics.heightPixels
- }
+ windowManager.defaultDisplay.getRealMetrics(metrics)
+ screenWidth = metrics.widthPixels
+ screenHeight = metrics.heightPixels
}
private fun refreshViewPager() {
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 12b095d18..f03a9e92c 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -1,6 +1,5 @@
package com.simplemobiletools.gallery.adapters
-import android.util.SparseArray
import android.view.Menu
import android.view.View
import android.view.ViewGroup
@@ -26,8 +25,6 @@ import com.simplemobiletools.gallery.models.AlbumCover
import com.simplemobiletools.gallery.models.Directory
import kotlinx.android.synthetic.main.directory_item_list.view.*
import java.io.File
-import java.util.*
-import kotlin.collections.ArrayList
class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList, val listener: DirectoryOperationsListener?, recyclerView: MyRecyclerView,
val isPickIntent: Boolean, fastScroller: FastScroller? = null, itemClick: (Any) -> Unit) :
@@ -48,14 +45,6 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList
+ holder.bindView(dir, true, !isPickIntent) { itemView, adapterPosition ->
setupView(itemView, dir)
}
- bindViewHolder(holder, position, view)
+ bindViewHolder(holder)
}
override fun getItemCount() = dirs.size
@@ -90,7 +79,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList()
- val cnt = viewHolders.size()
- for (i in 0..cnt) {
- if (affectedPositions.contains(i)) {
- continue
- }
-
- val view = viewHolders.get(i, null)
- val newIndex = i - selectedPositions.count { it <= i }
- newViewHolders.put(newIndex, view)
- }
- viewHolders = newViewHolders
currentDirectoriesHash = newDirs.hashCode()
dirs = newDirs
@@ -330,9 +311,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList()
val showHidden = activity.config.shouldShowHidden
- selectedPositions.forEach {
- val path = dirs[it].path
- if (path.startsWith(OTG_PATH)) {
- paths.addAll(getOTGFilePaths(path, showHidden))
- } else if (path != FAVORITES) {
- File(path).listFiles()?.filter {
+ getSelectedPaths().forEach {
+ if (it.startsWith(OTG_PATH)) {
+ paths.addAll(getOTGFilePaths(it, showHidden))
+ } else if (it != FAVORITES) {
+ File(it).listFiles()?.filter {
!activity.getIsPathDirectory(it.absolutePath) && it.isMediaFile() && (showHidden || !it.name.startsWith('.'))
}?.mapTo(paths) { it.absolutePath }
}
@@ -378,9 +358,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList(selectedPositions.size)
- val removeFolders = ArrayList(selectedPositions.size)
-
var SAFPath = ""
- selectedPositions.forEach {
- if (dirs.size > it) {
- val path = dirs[it].path
- if (activity.needsStupidWritePermissions(path) && config.treeUri.isEmpty()) {
- SAFPath = path
- }
+ val selectedDirs = getSelectedItems()
+ selectedDirs.forEach {
+ val path = it.path
+ if (activity.needsStupidWritePermissions(path) && config.treeUri.isEmpty()) {
+ SAFPath = path
}
}
activity.handleSAFDialog(SAFPath) {
- selectedPositions.sortedDescending().forEach {
- val directory = dirs.getOrNull(it)
- if (directory != null) {
- if (directory.areFavorites() || directory.isRecycleBin()) {
- if (directory.isRecycleBin()) {
- tryEmptyRecycleBin(false)
- } else {
- Thread {
- activity.galleryDB.MediumDao().clearFavorites()
- listener?.refreshItems()
- }.start()
- }
-
- if (selectedPositions.size == 1) {
- finishActMode()
- } else {
- selectedPositions.remove(it)
- toggleItemSelection(false, it)
- }
+ val foldersToDelete = ArrayList(selectedKeys.size)
+ selectedDirs.forEach {
+ if (it.areFavorites() || it.isRecycleBin()) {
+ if (it.isRecycleBin()) {
+ tryEmptyRecycleBin(false)
} else {
- folders.add(File(directory.path))
- removeFolders.add(directory)
+ Thread {
+ activity.galleryDB.MediumDao().clearFavorites()
+ listener?.refreshItems()
+ }.start()
}
+
+ if (selectedKeys.size == 1) {
+ finishActMode()
+ }
+ } else {
+ foldersToDelete.add(File(it.path))
}
}
- listener?.deleteFolders(folders)
+ listener?.deleteFolders(foldersToDelete)
}
}
private fun changeAlbumCover(useDefault: Boolean) {
- if (selectedPositions.size != 1)
+ if (selectedKeys.size != 1)
return
- val path = dirs[selectedPositions.first()].path
+ val path = getFirstSelectedItemPath() ?: return
if (useDefault) {
val albumCovers = getAlbumCoversWithout(path)
@@ -480,15 +450,15 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList {
- val paths = HashSet(selectedPositions.size)
- selectedPositions.forEach {
- (dirs.getOrNull(it))?.apply {
- paths.add(path)
- }
- }
- return paths
- }
+ private fun getSelectedItems() = dirs.filter { selectedKeys.contains(it.path.hashCode()) } as ArrayList
+
+ private fun getSelectedPaths() = getSelectedItems().map { it.path } as ArrayList
+
+ private fun getFirstSelectedItem() = getItemWithKey(selectedKeys.first())
+
+ private fun getFirstSelectedItemPath() = getFirstSelectedItem()?.path
+
+ private fun getItemWithKey(key: Int): Directory? = dirs.firstOrNull { it.path.hashCode() == key }
fun updateDirs(newDirs: ArrayList) {
val directories = newDirs.clone() as ArrayList
@@ -516,6 +486,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList TYPE_IMAGES
}
+ dir_check?.beVisibleIf(isSelected)
+ if (isSelected) {
+ dir_check.background?.applyColorFilter(primaryColor)
+ }
+
activity.loadImage(thumbnailType, directory.tmb, dir_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
dir_pin.beVisibleIf(pinnedFolders.contains(directory.path))
dir_location.beVisibleIf(directory.location != LOCAITON_INTERNAL)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt
index 046abda1f..db8aa9c7d 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/FiltersAdapter.kt
@@ -1,37 +1,34 @@
package com.simplemobiletools.gallery.adapters
import android.content.Context
-import android.graphics.drawable.Drawable
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.gallery.R
-import com.simplemobiletools.gallery.interfaces.FilterAdapterListener
import com.simplemobiletools.gallery.models.FilterItem
import kotlinx.android.synthetic.main.editor_filter_item.view.*
import java.util.*
-class FiltersAdapter(val context: Context, val filterItems: ArrayList, val itemClick: (Int) -> Unit) : RecyclerView.Adapter(),
- FilterAdapterListener {
+class FiltersAdapter(val context: Context, val filterItems: ArrayList, val itemClick: (Int) -> Unit) : RecyclerView.Adapter() {
private var currentSelection = filterItems.first()
private var strokeBackground = context.resources.getDrawable(R.drawable.stroke_background)
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
- holder.bindView(filterItems[position], strokeBackground)
+ holder.bindView(filterItems[position])
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.editor_filter_item, parent, false)
- return ViewHolder(view, this)
+ return ViewHolder(view)
}
override fun getItemCount() = filterItems.size
- override fun getCurrentFilter() = currentSelection
+ fun getCurrentFilter() = currentSelection
- override fun setCurrentFilter(position: Int) {
+ private fun setCurrentFilter(position: Int) {
val filterItem = filterItems.getOrNull(position) ?: return
if (currentSelection != filterItem) {
currentSelection = filterItem
@@ -40,19 +37,19 @@ class FiltersAdapter(val context: Context, val filterItems: ArrayList removeSelection()
@@ -41,20 +35,27 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<
override fun getIsItemSelectable(position: Int) = true
+ override fun getItemSelectionKey(position: Int) = folders.getOrNull(position)?.hashCode()
+
+ override fun getItemKeyPosition(key: Int) = folders.indexOfFirst { it.hashCode() == key }
+
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_manage_folder, parent)
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val folder = folders[position]
- val view = holder.bindView(folder, true, true) { itemView, adapterPosition ->
+ holder.bindView(folder, true, true) { itemView, adapterPosition ->
setupView(itemView, folder)
}
- bindViewHolder(holder, position, view)
+ bindViewHolder(holder)
}
override fun getItemCount() = folders.size
+ private fun getSelectedItems() = folders.filter { selectedKeys.contains(it.hashCode()) } as ArrayList
+
private fun setupView(view: View, folder: String) {
view.apply {
+ manage_folder_holder?.isSelected = selectedKeys.contains(folder.hashCode())
manage_folder_title.apply {
text = folder
setTextColor(config.textColor)
@@ -63,20 +64,20 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<
}
private fun removeSelection() {
- val removeFolders = ArrayList(selectedPositions.size)
+ val removeFolders = ArrayList(selectedKeys.size)
+ val positions = getSelectedItemPositions()
- selectedPositions.sortedDescending().forEach {
- val folder = folders[it]
- removeFolders.add(folder)
+ getSelectedItems().forEach {
+ removeFolders.add(it)
if (isShowingExcludedFolders) {
- config.removeExcludedFolder(folder)
+ config.removeExcludedFolder(it)
} else {
- config.removeIncludedFolder(folder)
+ config.removeIncludedFolder(it)
}
}
folders.removeAll(removeFolders)
- removeSelectedItems()
+ removeSelectedItems(positions)
if (folders.isEmpty()) {
listener?.refreshItems()
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageHiddenFoldersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageHiddenFoldersAdapter.kt
index 101b12764..95e2c053f 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageHiddenFoldersAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageHiddenFoldersAdapter.kt
@@ -27,12 +27,6 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra
override fun prepareActionMode(menu: Menu) {}
- override fun prepareItemSelection(viewHolder: ViewHolder) {}
-
- override fun markViewHolderSelection(select: Boolean, viewHolder: ViewHolder?) {
- viewHolder?.itemView?.manage_folder_holder?.isSelected = select
- }
-
override fun actionItemPressed(id: Int) {
when (id) {
R.id.cab_unhide -> tryUnhideFolders()
@@ -43,20 +37,27 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra
override fun getIsItemSelectable(position: Int) = true
+ override fun getItemSelectionKey(position: Int) = folders.getOrNull(position)?.hashCode()
+
+ override fun getItemKeyPosition(key: Int) = folders.indexOfFirst { it.hashCode() == key }
+
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_manage_folder, parent)
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val folder = folders[position]
- val view = holder.bindView(folder, true, true) { itemView, adapterPosition ->
+ holder.bindView(folder, true, true) { itemView, adapterPosition ->
setupView(itemView, folder)
}
- bindViewHolder(holder, position, view)
+ bindViewHolder(holder)
}
override fun getItemCount() = folders.size
+ private fun getSelectedItems() = folders.filter { selectedKeys.contains(it.hashCode()) } as ArrayList
+
private fun setupView(view: View, folder: String) {
view.apply {
+ manage_folder_holder?.isSelected = selectedKeys.contains(folder.hashCode())
manage_folder_title.apply {
text = folder
setTextColor(config.textColor)
@@ -65,12 +66,12 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra
}
private fun tryUnhideFolders() {
- val removeFolders = ArrayList(selectedPositions.size)
+ val removeFolders = ArrayList(selectedKeys.size)
val sdCardPaths = ArrayList()
- selectedPositions.forEach {
- if (activity.isPathOnSD(folders[it])) {
- sdCardPaths.add(folders[it])
+ getSelectedItems().forEach {
+ if (activity.isPathOnSD(it)) {
+ sdCardPaths.add(it)
}
}
@@ -84,14 +85,14 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra
}
private fun unhideFolders(removeFolders: ArrayList) {
- selectedPositions.sortedDescending().forEach {
- val folder = folders[it]
- removeFolders.add(folder)
- activity.removeNoMedia(folder)
+ val position = getSelectedItemPositions()
+ getSelectedItems().forEach {
+ removeFolders.add(it)
+ activity.removeNoMedia(it)
}
folders.removeAll(removeFolders)
- removeSelectedItems()
+ removeSelectedItems(position)
if (folders.isEmpty()) {
listener?.refreshItems()
}
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 d88895b59..06ef2b350 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
@@ -61,14 +61,6 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList
+ holder.bindView(tmbItem, tmbItem is Medium, allowLongPress) { itemView, adapterPosition ->
if (tmbItem is Medium) {
setupThumbnail(itemView, tmbItem)
} else {
setupSection(itemView, tmbItem as ThumbnailSection)
}
}
- bindViewHolder(holder, position, view)
+ bindViewHolder(holder)
}
override fun getItemCount() = media.size
@@ -112,9 +104,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 0
+ findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedKeys.size > 0
findItem(R.id.cab_restore_recycle_bin_files).isVisible = getSelectedPaths().all { it.startsWith(activity.filesDir.absolutePath) }
checkHideBtnVisibility(this)
@@ -123,7 +115,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList copyMoveTo(true)
R.id.cab_move_to -> copyMoveTo(false)
R.id.cab_select_all -> selectAll()
- R.id.cab_open_with -> activity.openPath(getCurrentPath(), true)
+ R.id.cab_open_with -> openPath()
R.id.cab_fix_date_taken -> fixDateTaken()
- R.id.cab_set_as -> activity.setAs(getCurrentPath())
+ R.id.cab_set_as -> setAs()
R.id.cab_delete -> checkDeleteConfirmation()
}
}
@@ -152,9 +144,13 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 0 && !isInRecycleBin
menu.findItem(R.id.cab_unhide).isVisible = hiddenCnt > 0 && !isInRecycleBin
}
@@ -185,7 +181,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 1) {
+ if (selectedKeys.size == 1 && selectedKeys.first() != -1) {
+ activity.shareMediumPath(getSelectedItems().first().path)
+ } else if (selectedKeys.size > 1) {
activity.shareMediaPaths(getSelectedPaths())
}
}
@@ -345,7 +353,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList(selectedPositions.size)
- val removeMedia = ArrayList(selectedPositions.size)
-
- if (media.size <= selectedPositions.first()) {
- finishActMode()
- return
- }
-
- val SAFPath = (media[selectedPositions.first()] as Medium).path
+ val SAFPath = getFirstSelectedItemPath() ?: return
activity.handleSAFDialog(SAFPath) {
- selectedPositions.sortedDescending().forEach {
- val thumbnailItem = media.getOrNull(it)
- if (thumbnailItem is Medium) {
- fileDirItems.add(FileDirItem(thumbnailItem.path, thumbnailItem.name))
- removeMedia.add(thumbnailItem)
- }
+ val fileDirItems = ArrayList(selectedKeys.size)
+ val removeMedia = ArrayList(selectedKeys.size)
+ val position = getSelectedItemPositions()
+
+ getSelectedItems().forEach {
+ fileDirItems.add(FileDirItem(it.path, it.name))
+ removeMedia.add(it)
}
media.removeAll(removeMedia)
listener?.tryDeleteFiles(fileDirItems)
- removeSelectedItems()
+ removeSelectedItems(position)
}
}
- private fun getSelectedMedia(): List {
- val selectedMedia = ArrayList(selectedPositions.size)
- selectedPositions.forEach {
- (media.getOrNull(it) as? Medium)?.apply {
- selectedMedia.add(this)
- }
- }
- return selectedMedia
- }
+ private fun getSelectedItems() = media.filter { selectedKeys.contains((it as? Medium)?.path?.hashCode()) } as ArrayList
- private fun getSelectedPaths() = getSelectedMedia().map { it.path } as ArrayList
+ private fun getSelectedPaths() = getSelectedItems().map { it.path } as ArrayList
+
+ private fun getFirstSelectedItemPath() = getItemWithKey(selectedKeys.first())?.path
+
+ private fun getItemWithKey(key: Int): Medium? = media.firstOrNull { (it as? Medium)?.path?.hashCode() == key } as? Medium
fun updateMedia(newMedia: ArrayList) {
val thumbnailItems = newMedia.clone() as ArrayList
@@ -437,12 +432,18 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList= Build.VERSION_CODES.JELLY_BEAN_MR1)
- windowManager.defaultDisplay.getRealSize(size)
+ windowManager.defaultDisplay.getRealSize(size)
return size
}
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 1da94e93e..f0581f9ce 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -1,6 +1,5 @@
package com.simplemobiletools.gallery.fragments
-import android.annotation.SuppressLint
import android.content.Intent
import android.content.res.Configuration
import android.graphics.Bitmap
@@ -29,8 +28,6 @@ import com.davemorrissey.labs.subscaleview.ImageSource
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.OTG_PATH
-import com.simplemobiletools.commons.helpers.isJellyBean1Plus
-import com.simplemobiletools.commons.helpers.isLollipopPlus
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.PanoramaActivity
import com.simplemobiletools.gallery.activities.PhotoActivity
@@ -208,18 +205,11 @@ class PhotoFragment : ViewPagerFragment() {
}
}
- @SuppressLint("NewApi")
private fun measureScreen() {
val metrics = DisplayMetrics()
- if (isJellyBean1Plus()) {
- activity!!.windowManager.defaultDisplay.getRealMetrics(metrics)
- ViewPagerActivity.screenWidth = metrics.widthPixels
- ViewPagerActivity.screenHeight = metrics.heightPixels
- } else {
- activity!!.windowManager.defaultDisplay.getMetrics(metrics)
- ViewPagerActivity.screenWidth = metrics.widthPixels
- ViewPagerActivity.screenHeight = metrics.heightPixels
- }
+ activity!!.windowManager.defaultDisplay.getRealMetrics(metrics)
+ ViewPagerActivity.screenWidth = metrics.widthPixels
+ ViewPagerActivity.screenHeight = metrics.heightPixels
}
private fun photoFragmentVisibilityChanged(isVisible: Boolean) {
@@ -280,7 +270,7 @@ class PhotoFragment : ViewPagerFragment() {
}
private fun loadSVG() {
- Glide.with(this)
+ Glide.with(context!!)
.`as`(PictureDrawable::class.java)
.listener(SvgSoftwareLayerSetter())
.load(medium.path)
@@ -440,7 +430,7 @@ class PhotoFragment : ViewPagerFragment() {
false
}
- view.panorama_outline.beVisibleIf(isPanorama && isLollipopPlus())
+ view.panorama_outline.beVisibleIf(isPanorama)
}
private fun getImageOrientation(): Int {
@@ -514,7 +504,7 @@ class PhotoFragment : ViewPagerFragment() {
override fun onDestroyView() {
super.onDestroyView()
- if (activity?.isActivityDestroyed() == false) {
+ if (activity?.isDestroyed == false) {
view.subsampling_view.recycle()
}
loadZoomableViewHandler.removeCallbacksAndMessages(null)
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 470a061e0..751b98e4e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -1,13 +1,11 @@
package com.simplemobiletools.gallery.fragments
-import android.annotation.TargetApi
import android.content.res.Configuration
import android.graphics.Point
import android.graphics.SurfaceTexture
import android.media.AudioManager
import android.media.MediaMetadataRetriever
import android.net.Uri
-import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.util.DisplayMetrics
@@ -28,7 +26,6 @@ import com.google.android.exoplayer2.upstream.DataSpec
import com.google.android.exoplayer2.upstream.FileDataSource
import com.google.android.exoplayer2.video.VideoListener
import com.simplemobiletools.commons.extensions.*
-import com.simplemobiletools.commons.helpers.isJellyBean1Plus
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
@@ -312,27 +309,21 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
}
private fun hasNavBar(): Boolean {
- return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
- val display = context!!.windowManager.defaultDisplay
+ val display = context!!.windowManager.defaultDisplay
- val realDisplayMetrics = DisplayMetrics()
- display.getRealMetrics(realDisplayMetrics)
+ val realDisplayMetrics = DisplayMetrics()
+ display.getRealMetrics(realDisplayMetrics)
- val realHeight = realDisplayMetrics.heightPixels
- val realWidth = realDisplayMetrics.widthPixels
+ val realHeight = realDisplayMetrics.heightPixels
+ val realWidth = realDisplayMetrics.widthPixels
- val displayMetrics = DisplayMetrics()
- display.getMetrics(displayMetrics)
+ val displayMetrics = DisplayMetrics()
+ display.getMetrics(displayMetrics)
- val displayHeight = displayMetrics.heightPixels
- val displayWidth = displayMetrics.widthPixels
+ val displayHeight = displayMetrics.heightPixels
+ val displayWidth = displayMetrics.widthPixels
- realWidth - displayWidth > 0 || realHeight - displayHeight > 0
- } else {
- val hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey()
- val hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK)
- !hasMenuKey && !hasBackKey
- }
+ return realWidth - displayWidth > 0 || realHeight - displayHeight > 0
}
private fun setupTimeHolder() {
@@ -514,7 +505,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
}.start()
}
- @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private fun setVideoSize() {
if (activity == null || mTextureView == null)
return
@@ -524,15 +514,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
val screenWidth: Int
val screenHeight: Int
- if (isJellyBean1Plus()) {
- val realMetrics = DisplayMetrics()
- display.getRealMetrics(realMetrics)
- screenWidth = realMetrics.widthPixels
- screenHeight = realMetrics.heightPixels
- } else {
- screenWidth = display.width
- screenHeight = display.height
- }
+ val realMetrics = DisplayMetrics()
+ display.getRealMetrics(realMetrics)
+ screenWidth = realMetrics.widthPixels
+ screenHeight = realMetrics.heightPixels
val screenProportion = screenWidth.toFloat() / screenHeight.toFloat()
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/FilterAdapterListener.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/FilterAdapterListener.kt
deleted file mode 100644
index 379e9e964..000000000
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/FilterAdapterListener.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.simplemobiletools.gallery.interfaces
-
-import com.simplemobiletools.gallery.models.FilterItem
-
-interface FilterAdapterListener {
- fun getCurrentFilter(): FilterItem
-
- fun setCurrentFilter(position: Int)
-}
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
deleted file mode 100644
index 7f1ac50b0..000000000
--- a/app/src/main/res/values-v21/styles.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 9bb53721a..fdde24e05 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -4,6 +4,7 @@
diff --git a/build.gradle b/build.gradle
index 5aab4c3d6..0b0dbc07b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -9,7 +9,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.0'
+ classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
From 776f99ddeaca72e657bd10bb1c9ef3213d74e2f5 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Wed, 17 Oct 2018 10:23:03 +0200
Subject: [PATCH 03/62] fix #990, update ExoPlayer to 2.9.0
---
app/build.gradle | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/app/build.gradle b/app/build.gradle
index 50299afc5..459a7f339 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -40,6 +40,11 @@ android {
checkReleaseBuilds false
abortOnError false
}
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
}
dependencies {
@@ -49,7 +54,7 @@ dependencies {
implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
- implementation 'com.google.android.exoplayer:exoplayer-core:2.8.4'
+ implementation 'com.google.android.exoplayer:exoplayer-core:2.9.0'
implementation 'com.google.vr:sdk-panowidget:1.170.0'
implementation 'org.apache.sanselan:sanselan:0.97-incubator'
implementation 'info.androidhive:imagefilters:1.0.7'
From 6e9f41567eb867bf9bc52f28bc1de19ec1504f0e Mon Sep 17 00:00:00 2001
From: tibbi
Date: Wed, 17 Oct 2018 11:34:05 +0200
Subject: [PATCH 04/62] update commons to 5.1.3
---
app/build.gradle | 2 +-
app/src/main/res/values/strings.xml | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 459a7f339..d17e23261 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.2'
+ implementation 'com.simplemobiletools:commons:5.1.3'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c7c603683..922d1cc58 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -163,7 +163,6 @@
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
-
Thumbnails
Fullscreen media
From f19615820410529872571c34700f2a0595b012a8 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Wed, 17 Oct 2018 11:48:44 +0200
Subject: [PATCH 05/62] catch exceptions thrown at clearing the recycle bin
---
.../com/simplemobiletools/gallery/activities/MainActivity.kt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 ce4c12e27..280f51940 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -992,7 +992,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
config.lastBinCheck = System.currentTimeMillis()
Handler().postDelayed({
Thread {
- mMediumDao.deleteOldRecycleBinItems(System.currentTimeMillis() - MONTH_MILLISECONDS)
+ try {
+ mMediumDao.deleteOldRecycleBinItems(System.currentTimeMillis() - MONTH_MILLISECONDS)
+ } catch (e: Exception) {
+ }
}.start()
}, 3000L)
}
From 66cd5dad3ee34eaa79f3701411eea8f5308af668 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Wed, 17 Oct 2018 11:57:04 +0200
Subject: [PATCH 06/62] make sure the directories and distinct before sorting
---
.../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 280f51940..6a4dc9887 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -833,8 +833,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
private fun showSortedDirs(dirs: ArrayList) {
- var sortedDirs = getSortedDirectories(dirs)
- sortedDirs = sortedDirs.distinctBy { it.path.getDistinctPath() } as ArrayList
+ var sortedDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList
+ sortedDirs = getSortedDirectories(sortedDirs)
runOnUiThread {
(directories_grid.adapter as? DirectoryAdapter)?.updateDirs(sortedDirs)
From af8133b8b2f95b2ad9de77789047a8d71306f384 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Wed, 17 Oct 2018 12:19:01 +0200
Subject: [PATCH 07/62] fix #983, add an option for showing the Recycle Bin as
the last folder
---
.../gallery/activities/MainActivity.kt | 2 +-
.../gallery/activities/SettingsActivity.kt | 21 ++++++++++++----
.../gallery/extensions/Context.kt | 10 +++++++-
.../gallery/helpers/Config.kt | 7 ++++++
.../gallery/helpers/Constants.kt | 1 +
app/src/main/res/layout/activity_settings.xml | 24 +++++++++++++++++++
6 files changed, 59 insertions(+), 6 deletions(-)
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 6a4dc9887..ac11c3169 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -768,7 +768,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
val foldersToScan = mediaFetcher.getFoldersToScan()
foldersToScan.add(FAVORITES)
- if (config.showRecycleBinAtFolders) {
+ if (config.useRecycleBin && config.showRecycleBinAtFolders) {
foldersToScan.add(RECYCLE_BIN)
} else {
foldersToScan.remove(RECYCLE_BIN)
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 d6086baaf..9adc2cbb7 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
@@ -18,10 +18,7 @@ import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.emptyTheRecycleBin
import com.simplemobiletools.gallery.extensions.galleryDB
import com.simplemobiletools.gallery.extensions.showRecycleBinEmptyingDialog
-import com.simplemobiletools.gallery.helpers.DEFAULT_BOTTOM_ACTIONS
-import com.simplemobiletools.gallery.helpers.ROTATE_BY_ASPECT_RATIO
-import com.simplemobiletools.gallery.helpers.ROTATE_BY_DEVICE_ROTATION
-import com.simplemobiletools.gallery.helpers.ROTATE_BY_SYSTEM_SETTING
+import com.simplemobiletools.gallery.helpers.*
import kotlinx.android.synthetic.main.activity_settings.*
import java.util.*
@@ -77,6 +74,7 @@ class SettingsActivity : SimpleActivity() {
setupManageBottomActions()
setupUseRecycleBin()
setupShowRecycleBin()
+ setupShowRecycleBinLast()
setupEmptyRecycleBin()
updateTextColors(settings_holder)
setupSectionColors()
@@ -459,11 +457,14 @@ class SettingsActivity : SimpleActivity() {
private fun setupUseRecycleBin() {
settings_empty_recycle_bin_holder.beVisibleIf(config.useRecycleBin)
settings_show_recycle_bin_holder.beVisibleIf(config.useRecycleBin)
+ settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders)
settings_use_recycle_bin.isChecked = config.useRecycleBin
settings_use_recycle_bin_holder.setOnClickListener {
settings_use_recycle_bin.toggle()
config.useRecycleBin = settings_use_recycle_bin.isChecked
settings_empty_recycle_bin_holder.beVisibleIf(config.useRecycleBin)
+ settings_show_recycle_bin_holder.beVisibleIf(config.useRecycleBin)
+ settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders)
}
}
@@ -472,6 +473,18 @@ class SettingsActivity : SimpleActivity() {
settings_show_recycle_bin_holder.setOnClickListener {
settings_show_recycle_bin.toggle()
config.showRecycleBinAtFolders = settings_show_recycle_bin.isChecked
+ settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders)
+ }
+ }
+
+ private fun setupShowRecycleBinLast() {
+ settings_show_recycle_bin_last.isChecked = config.showRecycleBinLast
+ settings_show_recycle_bin_last_holder.setOnClickListener {
+ settings_show_recycle_bin_last.toggle()
+ config.showRecycleBinLast = settings_show_recycle_bin_last.isChecked
+ if (config.showRecycleBinLast) {
+ config.removePinnedFolders(setOf(RECYCLE_BIN))
+ }
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt
index 45808d5a0..a00548a84 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt
@@ -123,6 +123,14 @@ fun Context.movePinnedDirectoriesToFront(dirs: ArrayList): ArrayList<
dirs.add(0, newFolder)
}
}
+
+ if (config.useRecycleBin && config.showRecycleBinAtFolders && config.showRecycleBinLast) {
+ val binIndex = dirs.indexOfFirst { it.isRecycleBin() }
+ if (binIndex != -1) {
+ val bin = dirs.removeAt(binIndex)
+ dirs.add(bin)
+ }
+ }
return dirs
}
@@ -334,7 +342,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
ArrayList()
}
- if (!config.showRecycleBinAtFolders) {
+ if (!config.showRecycleBinAtFolders || !config.useRecycleBin) {
directories.removeAll { it.isRecycleBin() }
}
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 11474c421..7333a1dd6 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
@@ -89,6 +89,9 @@ class Config(context: Context) : BaseConfig(context) {
val currPinnedFolders = HashSet(pinnedFolders)
currPinnedFolders.addAll(paths)
pinnedFolders = currPinnedFolders
+ if (paths.contains(RECYCLE_BIN)) {
+ showRecycleBinLast = false
+ }
}
fun removePinnedFolders(paths: Set) {
@@ -392,4 +395,8 @@ class Config(context: Context) : BaseConfig(context) {
var showHighestQuality: Boolean
get() = prefs.getBoolean(SHOW_HIGHEST_QUALITY, false)
set(showHighestQuality) = prefs.edit().putBoolean(SHOW_HIGHEST_QUALITY, showHighestQuality).apply()
+
+ var showRecycleBinLast: Boolean
+ get() = prefs.getBoolean(SHOW_RECYCLE_BIN_LAST, false)
+ set(showRecycleBinLast) = prefs.edit().putBoolean(SHOW_RECYCLE_BIN_LAST, showRecycleBinLast).apply()
}
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 0db9f3129..8c0c7b15d 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
@@ -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 SHOW_RECYCLE_BIN_LAST = "show_recycle_bin_last"
const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images"
const val WAS_SVG_SHOWING_HANDLED = "was_svg_showing_handled"
const val LAST_BIN_CHECK = "last_bin_check"
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
index 41400e1cd..b631f301e 100644
--- a/app/src/main/res/layout/activity_settings.xml
+++ b/app/src/main/res/layout/activity_settings.xml
@@ -1141,6 +1141,30 @@
+
+
+
+
+
+
Date: Wed, 17 Oct 2018 14:04:52 +0200
Subject: [PATCH 08/62] adding a Search item for searching folders
---
app/src/main/AndroidManifest.xml | 8 ++
.../gallery/activities/MainActivity.kt | 74 +++++++++++++++++--
app/src/main/res/menu/menu_main.xml | 6 ++
3 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 85395342a..da9c7ea86 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -32,6 +32,14 @@
android:name=".activities.MainActivity"
android:resizeableActivity="true">
+
+
+
+
+
+
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 ac11c3169..2609148ae 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -1,7 +1,9 @@
package com.simplemobiletools.gallery.activities
import android.app.Activity
+import android.app.SearchManager
import android.content.ClipData
+import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
@@ -12,6 +14,8 @@ import android.view.MenuItem
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.Toast
+import androidx.appcompat.widget.SearchView
+import androidx.core.view.MenuItemCompat
import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
import com.simplemobiletools.commons.dialogs.FilePickerDialog
@@ -60,11 +64,14 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private var mIsPasswordProtectionPending = false
private var mWasProtectionHandled = false
private var mShouldStopFetching = false
+ private var mIsSearchOpen = false
private var mLatestMediaId = 0L
private var mLatestMediaDateId = 0L
private var mLastMediaHandler = Handler()
private var mTempShowHiddenHandler = Handler()
private var mZoomListener: MyRecyclerView.MyZoomListener? = null
+ private var mSearchMenuItem: MenuItem? = null
+ private var mDirs = ArrayList()
private var mStoredAnimateGifs = true
private var mStoredCropThumbnails = true
@@ -213,6 +220,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
override fun onStop() {
super.onStop()
+ mSearchMenuItem?.collapseActionView()
+
if (config.temporarilyShowHidden || config.tempSkipDeleteConfirmation) {
mTempShowHiddenHandler.postDelayed({
config.temporarilyShowHidden = false
@@ -244,8 +253,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
findItem(R.id.reduce_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt > 1
}
}
+
menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
+ setupSearch(menu)
return true
}
@@ -292,6 +303,55 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
}
+ private fun setupSearch(menu: Menu) {
+ val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
+ mSearchMenuItem = menu.findItem(R.id.search)
+ (mSearchMenuItem?.actionView as? SearchView)?.apply {
+ setSearchableInfo(searchManager.getSearchableInfo(componentName))
+ isSubmitButtonEnabled = false
+ setOnQueryTextListener(object : SearchView.OnQueryTextListener {
+ override fun onQueryTextSubmit(query: String) = false
+
+ override fun onQueryTextChange(newText: String): Boolean {
+ if (mIsSearchOpen) {
+ searchQueryChanged(newText)
+ }
+ return true
+ }
+ })
+ }
+
+ MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, object : MenuItemCompat.OnActionExpandListener {
+ override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
+ mIsSearchOpen = true
+ directories_refresh_layout.isEnabled = false
+ return true
+ }
+
+ // this triggers on device rotation too, avoid doing anything
+ override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
+ if (mIsSearchOpen) {
+ mIsSearchOpen = false
+ directories_refresh_layout.isEnabled = config.enablePullToRefresh
+ searchQueryChanged("")
+ }
+ return true
+ }
+ })
+ }
+
+ private fun searchQueryChanged(text: String) {
+ Thread {
+ val filtered = getUniqueSortedDirs(mDirs).filter { it.name.contains(text, true) } as ArrayList
+ filtered.sortBy { !it.name.startsWith(text, true) }
+
+ runOnUiThread {
+ getRecyclerAdapter()?.updateDirs(filtered)
+ measureRecyclerViewContent(filtered)
+ }
+ }.start()
+ }
+
private fun removeTempFolder() {
if (config.tempFolderPath.isNotEmpty()) {
val newFolder = File(config.tempFolderPath)
@@ -824,6 +884,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
} catch (e: Exception) {
config.everShownFolders = HashSet()
}
+ mDirs = dirs
}
private fun checkPlaceholderVisibility(dirs: ArrayList) {
@@ -833,14 +894,17 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
private fun showSortedDirs(dirs: ArrayList) {
- var sortedDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList
- sortedDirs = getSortedDirectories(sortedDirs)
-
+ val updatedDirs = getUniqueSortedDirs(dirs)
runOnUiThread {
- (directories_grid.adapter as? DirectoryAdapter)?.updateDirs(sortedDirs)
+ (directories_grid.adapter as? DirectoryAdapter)?.updateDirs(updatedDirs)
}
}
+ private fun getUniqueSortedDirs(dirs: ArrayList): ArrayList {
+ val sortedDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList
+ return getSortedDirectories(sortedDirs)
+ }
+
private fun createDirectoryFromMedia(path: String, curMedia: ArrayList, albumCovers: ArrayList, hiddenString: String,
includedFolders: MutableSet, isSortingAscending: Boolean): Directory {
var thumbnail = curMedia.firstOrNull { getDoesFilePathExist(it.path) }?.path ?: ""
@@ -884,7 +948,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
directories_grid.adapter = this
}
} else {
- (currAdapter as DirectoryAdapter).updateDirs(dirs)
+ showSortedDirs(dirs)
}
getRecyclerAdapter()?.dirs?.apply {
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
index b1a4035e7..5d6ee89c7 100644
--- a/app/src/main/res/menu/menu_main.xml
+++ b/app/src/main/res/menu/menu_main.xml
@@ -1,6 +1,12 @@
+
+
+
+
From 13c00c1b17fbd77e75ce61f70ae9ac0b635377a3 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Fri, 19 Oct 2018 23:56:53 +0200
Subject: [PATCH 24/62] adding a "Show Hidden" button to every filepicker, when
appropriate
---
app/build.gradle | 2 +-
.../gallery/activities/ExcludedFoldersActivity.kt | 4 ++--
.../gallery/activities/HiddenFoldersActivity.kt | 2 +-
.../gallery/activities/IncludedFoldersActivity.kt | 4 ++--
.../com/simplemobiletools/gallery/activities/MainActivity.kt | 2 +-
.../simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt | 5 +++--
.../com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt | 2 +-
7 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index fa496afab..fc23a8c8d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.4'
+ implementation 'com.simplemobiletools:commons:5.1.6'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ExcludedFoldersActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ExcludedFoldersActivity.kt
index d59f0b7f4..4d3a1883a 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ExcludedFoldersActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ExcludedFoldersActivity.kt
@@ -20,7 +20,7 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun updateFolders() {
val folders = ArrayList()
- config.excludedFolders.mapTo(folders, { it })
+ config.excludedFolders.mapTo(folders) { it }
manage_folders_placeholder.apply {
text = getString(R.string.excluded_activity_placeholder)
beVisibleIf(folders.isEmpty())
@@ -49,7 +49,7 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun addFolder() {
- FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden) {
+ FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden, false, true) {
config.lastFilepickerPath = it
config.addExcludedFolder(it)
updateFolders()
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/HiddenFoldersActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/HiddenFoldersActivity.kt
index 598e153be..c46135c98 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/HiddenFoldersActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/HiddenFoldersActivity.kt
@@ -53,7 +53,7 @@ class HiddenFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun addFolder() {
- FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden) {
+ FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden, false, true) {
config.lastFilepickerPath = it
Thread {
addNoMedia(it) {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt
index ede3ab8d8..4a4d1339e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/IncludedFoldersActivity.kt
@@ -21,7 +21,7 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun updateFolders() {
val folders = ArrayList()
- config.includedFolders.mapTo(folders, { it })
+ config.includedFolders.mapTo(folders) { it }
manage_folders_placeholder.apply {
text = getString(R.string.included_activity_placeholder)
beVisibleIf(folders.isEmpty())
@@ -50,7 +50,7 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun addFolder() {
- FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden) {
+ FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden, false, true) {
config.lastFilepickerPath = it
config.addIncludedFolder(it)
updateFolders()
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 6ccdcb897..02603f098 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -604,7 +604,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
private fun createNewFolder() {
- FilePickerDialog(this, internalStoragePath, false, config.shouldShowHidden) {
+ FilePickerDialog(this, internalStoragePath, false, config.shouldShowHidden, false, true) {
CreateNewFolderDialog(this, it) {
config.tempFolderPath = it
Thread {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt
index 9aa0fa625..dae7ed654 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt
@@ -21,6 +21,7 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
var shownDirectories = ArrayList()
var view = activity.layoutInflater.inflate(R.layout.dialog_directory_picker, null)
var isGridViewType = activity.config.viewTypeFolders == VIEW_TYPE_GRID
+ var showHidden = activity.config.shouldShowHidden
init {
(view.directories_grid.layoutManager as MyGridLayoutManager).apply {
@@ -38,6 +39,7 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
view.directories_show_hidden.setOnClickListener {
activity.handleHiddenFolderPasswordProtection {
view.directories_show_hidden.beGone()
+ showHidden = true
fetchDirectories(true)
}
}
@@ -58,8 +60,7 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
}
private fun showOtherFolder() {
- val showHidden = activity.config.shouldShowHidden
- FilePickerDialog(activity, sourcePath, false, showHidden, true) {
+ FilePickerDialog(activity, sourcePath, false, showHidden, true, true) {
callback(it)
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt
index 9bb1f2ea9..35dc95274 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt
@@ -32,7 +32,7 @@ class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appen
save_as_name.setText(name)
save_as_path.setOnClickListener {
- FilePickerDialog(activity, realPath, false, false, true) {
+ FilePickerDialog(activity, realPath, false, false, true, true) {
save_as_path.text = activity.humanizePath(it)
realPath = it
}
From de6ab917e39684c8fc58074723f4bffe43497d28 Mon Sep 17 00:00:00 2001
From: holdmoon <44316847+holdmoon@users.noreply.github.com>
Date: Sat, 20 Oct 2018 20:19:16 +0900
Subject: [PATCH 25/62] Update strings.xml
Update Translation
---
app/src/main/res/values-ja/strings.xml | 40 +++++++++++++-------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index ceba51c02..06d7b544a 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -132,36 +132,36 @@
拡張子
- ビデオを自動再生する
+ ビデオを自動再生
ファイル名の表示を切り替え
- ビデオを繰り返し再生する
- アニメーションGIFのサムネイルを動かす
- メディア再生時に明るさを最大にする
+ ビデオを繰り返し再生
+ アニメーションGIFを動かす
+ 再生時には明るさを最大にする
サムネイルを正方形に切り取る
- メディア再生時のフルスクリーン表示切り替え
+ フルスクリーン再生の表示切り替え
システム設定に従う
端末の向きに従う
メディアの縦横比に従う
- 表示の背景色とステータスバーの背景色を黒にする
+ メディア表示の背景色を黒にする
サムネイル画面を横方向にスクロール
- フルスクリーン時にシステムUIを非表示にする
- フォルダが空になったらフォルダも削除する
- 垂直のジェスチャーで写真の明るさを制御する
- 音量と明るさを縦のジェスチャーで変更する
- フォルダ内のメディアの数を表示する
+ 全画面ではシステムUIを非表示
+ 空になったフォルダは削除する
+ 垂直の動作で写真の明るさを制御
+ 音量と明るさを縦の動作で変更
+ フォルダ内のメディア数を表示する
フルスクリーン時の「共有」を「回転」に置き換える
フルスクリーンに詳細を重ねて表示する
詳細表示を管理する
- メディアを指ひとつでズーム可能にする
- 画面の端を押してメディアをスライドする
- Allow deep zooming images
+ メディアを指だけでズームする
+ 端を押してメディアをスライド
+ 深いズームを許可
ステータスバーが非表示の時は詳細を隠す
- 無効なファイルを見せない調整を行う
- 画面下部にアクションボタンを表示する
- フォルダ画面にごみ箱を表示する
- Deep zoomable images
- Show images in the highest possible quality
- Show the Recycle Bin as the last item on the main screen
+ 無効なファイルは見せない
+ 画面の下にはアクションを表示
+ フォルダ画面にごみ箱を表示
+ 画像のズームを深くする
+ 可能な限り高品質で画像を表示
+ ごみ箱をメイン画面の最後に表示
サムネイル設定
From 4c9cef04f4ce10999762070f98af6bc5fef9b8fa Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sat, 20 Oct 2018 16:12:20 +0200
Subject: [PATCH 26/62] fix slideshow swiping direction
---
.../gallery/activities/ViewPagerActivity.kt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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 03cd4a0fa..444097363 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt
@@ -428,7 +428,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val dragOffset = dragPosition - oldDragPosition
oldDragPosition = dragPosition
try {
- view_pager.fakeDragBy(dragOffset * (if (forward) 1f else -1f))
+ view_pager.fakeDragBy(dragOffset * (if (forward) -1f else 1f))
} catch (e: Exception) {
stopSlideshow()
}
@@ -444,9 +444,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun slideshowEnded(forward: Boolean) {
if (config.loopSlideshow) {
if (forward) {
- view_pager.setCurrentItem(0, false)
- } else {
view_pager.setCurrentItem(view_pager.adapter!!.count - 1, false)
+ } else {
+ view_pager.setCurrentItem(0, false)
}
} else {
stopSlideshow()
From 7beff9a6921c5ec23f865c5096f842efc989b528 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sat, 20 Oct 2018 16:35:12 +0200
Subject: [PATCH 27/62] optimize some things at the directory and media adapter
---
.../gallery/adapters/DirectoryAdapter.kt | 16 +++++------
.../gallery/adapters/MediaAdapter.kt | 28 +++++++++++--------
2 files changed, 25 insertions(+), 19 deletions(-)
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 f03a9e92c..df6e1798b 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -61,11 +61,11 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList) {
var hiddenCnt = 0
var unhiddenCnt = 0
- getSelectedPaths().forEach {
+ selectedPaths.forEach {
if (File(it).doesThisOrParentHaveNoMedia()) {
hiddenCnt++
} else {
@@ -132,11 +132,11 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList 0
}
- private fun checkPinBtnVisibility(menu: Menu) {
+ private fun checkPinBtnVisibility(menu: Menu, selectedPaths: ArrayList) {
val pinnedFolders = config.pinnedFolders
var pinnedCnt = 0
var unpinnedCnt = 0
- getSelectedPaths().forEach {
+ selectedPaths.forEach {
if (pinnedFolders.contains(it)) {
pinnedCnt++
} else {
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 06ef2b350..da0cc5526 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
@@ -103,14 +103,20 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList
menu.apply {
- findItem(R.id.cab_rename).isVisible = isOneItemSelected() && getSelectedItems().firstOrNull()?.getIsInRecycleBin() == false
+ findItem(R.id.cab_rename).isVisible = isOneItemSelected() && selectedItems.firstOrNull()?.getIsInRecycleBin() == false
findItem(R.id.cab_open_with).isVisible = isOneItemSelected()
findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedKeys.size > 0
- findItem(R.id.cab_restore_recycle_bin_files).isVisible = getSelectedPaths().all { it.startsWith(activity.filesDir.absolutePath) }
+ findItem(R.id.cab_restore_recycle_bin_files).isVisible = selectedPaths.all { it.startsWith(activity.filesDir.absolutePath) }
- checkHideBtnVisibility(this)
- checkFavoriteBtnVisibility(this)
+ checkHideBtnVisibility(this, selectedItems)
+ checkFavoriteBtnVisibility(this, selectedItems)
}
}
@@ -152,8 +158,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList) {
var hiddenCnt = 0
var unhiddenCnt = 0
- getSelectedItems().forEach {
+ selectedItems.forEach {
if (it.isHidden()) {
hiddenCnt++
} else {
@@ -173,15 +179,15 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 0 && !isInRecycleBin
menu.findItem(R.id.cab_unhide).isVisible = hiddenCnt > 0 && !isInRecycleBin
}
- private fun checkFavoriteBtnVisibility(menu: Menu) {
+ private fun checkFavoriteBtnVisibility(menu: Menu, selectedItems: ArrayList) {
var favoriteCnt = 0
var nonFavoriteCnt = 0
- getSelectedItems().forEach {
+ selectedItems.forEach {
if (it.isFavorite) {
favoriteCnt++
} else {
From 7e6362cbfbff2eca5b5c32e31cc2adc75e570cfe Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sat, 20 Oct 2018 19:18:30 +0200
Subject: [PATCH 28/62] adding some recyclerview related performance
optimizations
---
app/build.gradle | 2 +-
.../gallery/adapters/DirectoryAdapter.kt | 9 +++++----
.../simplemobiletools/gallery/adapters/MediaAdapter.kt | 5 +++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index fc23a8c8d..8092c114a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.6'
+ implementation 'com.simplemobiletools:commons:5.1.10'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
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 df6e1798b..eead88bda 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -66,12 +66,13 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList
menu.apply {
- findItem(R.id.cab_rename).isVisible = isOneItemSelected() && selectedItems.firstOrNull()?.getIsInRecycleBin() == false
- findItem(R.id.cab_open_with).isVisible = isOneItemSelected()
+ findItem(R.id.cab_rename).isVisible = isOneItemSelected && selectedItems.firstOrNull()?.getIsInRecycleBin() == false
+ findItem(R.id.cab_open_with).isVisible = isOneItemSelected
findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedKeys.size > 0
findItem(R.id.cab_restore_recycle_bin_files).isVisible = selectedPaths.all { it.startsWith(activity.filesDir.absolutePath) }
From 9d3848b2ab7f7662582c41cae9af2366878bbad5 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sat, 20 Oct 2018 20:00:16 +0200
Subject: [PATCH 29/62] change the way folders are updated after Pinning change
---
.../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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 eead88bda..c1daa3a09 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -317,10 +317,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList
Date: Sat, 20 Oct 2018 20:12:02 +0200
Subject: [PATCH 30/62] optimize the way some actionmenu button visibility is
determined
---
.../gallery/adapters/DirectoryAdapter.kt | 28 +++--------------
.../gallery/adapters/MediaAdapter.kt | 30 ++++---------------
2 files changed, 9 insertions(+), 49 deletions(-)
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 c1daa3a09..784e2e65e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -119,34 +119,14 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList) {
- var hiddenCnt = 0
- var unhiddenCnt = 0
- selectedPaths.forEach {
- if (File(it).doesThisOrParentHaveNoMedia()) {
- hiddenCnt++
- } else {
- unhiddenCnt++
- }
- }
-
- menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0
- menu.findItem(R.id.cab_unhide).isVisible = hiddenCnt > 0
+ menu.findItem(R.id.cab_hide).isVisible = selectedPaths.any { !File(it).doesThisOrParentHaveNoMedia() }
+ menu.findItem(R.id.cab_unhide).isVisible = selectedPaths.any { File(it).doesThisOrParentHaveNoMedia() }
}
private fun checkPinBtnVisibility(menu: Menu, selectedPaths: ArrayList) {
val pinnedFolders = config.pinnedFolders
- var pinnedCnt = 0
- var unpinnedCnt = 0
- selectedPaths.forEach {
- if (pinnedFolders.contains(it)) {
- pinnedCnt++
- } else {
- unpinnedCnt++
- }
- }
-
- menu.findItem(R.id.cab_pin).isVisible = unpinnedCnt > 0
- menu.findItem(R.id.cab_unpin).isVisible = pinnedCnt > 0
+ menu.findItem(R.id.cab_pin).isVisible = selectedPaths.any { !pinnedFolders.contains(it) }
+ menu.findItem(R.id.cab_unpin).isVisible = selectedPaths.any { pinnedFolders.contains(it) }
}
private fun showProperties() {
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 03511c29f..ed43c8dcb 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
@@ -113,7 +113,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 0
+ findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedKeys.isNotEmpty()
findItem(R.id.cab_restore_recycle_bin_files).isVisible = selectedPaths.all { it.startsWith(activity.filesDir.absolutePath) }
checkHideBtnVisibility(this, selectedItems)
@@ -170,34 +170,14 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList) {
- var hiddenCnt = 0
- var unhiddenCnt = 0
- selectedItems.forEach {
- if (it.isHidden()) {
- hiddenCnt++
- } else {
- unhiddenCnt++
- }
- }
-
val isInRecycleBin = selectedItems.firstOrNull()?.getIsInRecycleBin() == true
- menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0 && !isInRecycleBin
- menu.findItem(R.id.cab_unhide).isVisible = hiddenCnt > 0 && !isInRecycleBin
+ menu.findItem(R.id.cab_hide).isVisible = !isInRecycleBin && selectedItems.any { !it.isHidden() }
+ menu.findItem(R.id.cab_unhide).isVisible = !isInRecycleBin && selectedItems.any { it.isHidden() }
}
private fun checkFavoriteBtnVisibility(menu: Menu, selectedItems: ArrayList) {
- var favoriteCnt = 0
- var nonFavoriteCnt = 0
- selectedItems.forEach {
- if (it.isFavorite) {
- favoriteCnt++
- } else {
- nonFavoriteCnt++
- }
- }
-
- menu.findItem(R.id.cab_add_to_favorites).isVisible = nonFavoriteCnt > 0
- menu.findItem(R.id.cab_remove_from_favorites).isVisible = favoriteCnt > 0
+ menu.findItem(R.id.cab_add_to_favorites).isVisible = selectedItems.any { !it.isFavorite }
+ menu.findItem(R.id.cab_remove_from_favorites).isVisible = selectedItems.any { it.isFavorite }
}
private fun confirmSelection() {
From 1ad517a813749132193da81ffaababb6c0483647 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 11:25:09 +0200
Subject: [PATCH 31/62] update commons to 5.1.12
---
app/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/build.gradle b/app/build.gradle
index 8092c114a..e7f656397 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.10'
+ implementation 'com.simplemobiletools:commons:5.1.12'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
From 7bc48bee0b6a78683dc9477abc296b7e7e9d17a4 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 13:08:46 +0200
Subject: [PATCH 32/62] add some initial handling for 360 videos
---
.../gallery/fragments/VideoFragment.kt | 124 ++++++++++--------
.../gallery/helpers/MediaSideScroll.kt | 16 +--
app/src/main/res/layout/pager_video_item.xml | 32 +++--
3 files changed, 98 insertions(+), 74 deletions(-)
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 8fd0fc7d8..aedb8a284 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -3,7 +3,6 @@ package com.simplemobiletools.gallery.fragments
import android.content.res.Configuration
import android.graphics.Point
import android.graphics.SurfaceTexture
-import android.media.AudioManager
import android.media.MediaMetadataRetriever
import android.net.Uri
import android.os.Bundle
@@ -44,7 +43,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private var mTextureView: TextureView? = null
private var mCurrTimeView: TextView? = null
private var mSeekBar: SeekBar? = null
- private var mTimeHolder: View? = null
private var mView: View? = null
private var mExoPlayer: SimpleExoPlayer? = null
private var mVideoSize = Point(0, 0)
@@ -57,6 +55,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private var mIsFragmentVisible = false
private var mWasFragmentInit = false
private var mIsExoPlayerInitialized = false
+ private var mIsPanorama = false
private var mCurrTime = 0
private var mDuration = 0
@@ -65,8 +64,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private var mStoredBottomActions = true
private var mStoredExtendedDetails = 0
- private lateinit var brightnessSideScroll: MediaSideScroll
- private lateinit var volumeSideScroll: MediaSideScroll
+ private lateinit var mTimeHolder: View
+ private lateinit var mBrightnessSideScroll: MediaSideScroll
+ private lateinit var mVolumeSideScroll: MediaSideScroll
lateinit var medium: Medium
@@ -74,11 +74,21 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mView = inflater.inflate(R.layout.pager_video_item, container, false).apply {
instant_prev_item.setOnClickListener { listener?.goToPrevItem() }
instant_next_item.setOnClickListener { listener?.goToNextItem() }
+ video_curr_time.setOnClickListener { skip(false) }
+ video_duration.setOnClickListener { skip(true) }
+ video_holder.setOnClickListener { toggleFullscreen() }
+
+ // adding an empty click listener just to avoid ripple animation at toggling fullscreen
+ video_seekbar.setOnClickListener { }
+
mTimeHolder = video_time_holder
+ mBrightnessSideScroll = video_brightness_controller
+ mVolumeSideScroll = video_volume_controller
}
storeStateVariables()
medium = arguments!!.getSerializable(MEDIUM) as Medium
+ Glide.with(context!!).load(medium.path).into(mView!!.video_preview)
// setMenuVisibility is not called at VideoActivity (third party intent)
if (!mIsFragmentVisible && activity is VideoActivity) {
@@ -86,49 +96,58 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
}
mIsFullscreen = activity!!.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN
-
- setupPlayer()
- if (savedInstanceState != null) {
- mCurrTime = savedInstanceState.getInt(PROGRESS)
- }
-
- checkFullscreen()
- mWasFragmentInit = true
-
- mView!!.apply {
- brightnessSideScroll = video_brightness_controller
- brightnessSideScroll.initialize(activity!!, slide_info, true, container) { x, y ->
- video_holder.performClick()
- }
-
- volumeSideScroll = video_volume_controller
- volumeSideScroll.initialize(activity!!, slide_info, false, container) { x, y ->
- video_holder.performClick()
- }
-
- video_curr_time.setOnClickListener { skip(false) }
- video_duration.setOnClickListener { skip(true) }
- Glide.with(context!!).load(medium.path).into(video_preview)
- }
-
- mExoPlayer = ExoPlayerFactory.newSimpleInstance(context, DefaultTrackSelector())
- mExoPlayer!!.seekParameters = SeekParameters.CLOSEST_SYNC
- initExoPlayerListeners()
-
+ initTimeHolder()
medium.path.getVideoResolution()?.apply {
mVideoSize.x = x
mVideoSize.y = y
- setVideoSize()
+ mIsPanorama = x == y * 2
+ if (mIsPanorama) {
+ mView!!.apply {
+ panorama_outline.beVisible()
+ video_play_outline.beGone()
+ mVolumeSideScroll.beGone()
+ mBrightnessSideScroll.beGone()
+ Glide.with(context!!).load(medium.path).into(video_preview)
+ }
+ }
+ }
+
+ if (!mIsPanorama) {
+ setupPlayer()
+ if (savedInstanceState != null) {
+ mCurrTime = savedInstanceState.getInt(PROGRESS)
+ }
+
+ checkFullscreen()
+ mWasFragmentInit = true
+
+ mExoPlayer = ExoPlayerFactory.newSimpleInstance(context, DefaultTrackSelector())
+ mExoPlayer!!.seekParameters = SeekParameters.CLOSEST_SYNC
+ initExoPlayerListeners()
+
+ if (mVideoSize.x != 0 && mVideoSize.y != 0) {
+ setVideoSize()
+ }
+
+ mView!!.apply {
+ mBrightnessSideScroll.initialize(activity!!, slide_info, true, container) { x, y ->
+ video_holder.performClick()
+ }
+
+ mVolumeSideScroll.initialize(activity!!, slide_info, false, container) { x, y ->
+ video_holder.performClick()
+ }
+
+ video_surface.onGlobalLayout {
+ if (mIsFragmentVisible && context?.config?.autoplayVideos == true) {
+ playVideo()
+ }
+ }
+ }
}
setupVideoDuration()
- mView!!.video_surface.onGlobalLayout {
- if (mIsFragmentVisible && context?.config?.autoplayVideos == true) {
- playVideo()
- }
- }
-
return mView
}
@@ -139,8 +158,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
val allowVideoGestures = config.allowVideoGestures
val allowInstantChange = config.allowInstantChange
mView!!.apply {
- video_volume_controller.beVisibleIf(allowVideoGestures)
- video_brightness_controller.beVisibleIf(allowVideoGestures)
+ video_volume_controller.beVisibleIf(allowVideoGestures && !mIsPanorama)
+ video_brightness_controller.beVisibleIf(allowVideoGestures && !mIsPanorama)
instant_prev_item.beVisibleIf(allowInstantChange)
instant_next_item.beVisibleIf(allowInstantChange)
@@ -154,7 +173,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
initTimeHolder()
}
- mView!!.video_time_holder.setBackgroundResource(if (config.bottomActions) 0 else R.drawable.gradient_background)
+ mTimeHolder.setBackgroundResource(if (config.bottomActions) 0 else R.drawable.gradient_background)
storeStateVariables()
}
@@ -208,9 +227,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mTextureView = mView!!.video_surface
mTextureView!!.setOnClickListener { toggleFullscreen() }
mTextureView!!.surfaceTextureListener = this
- mView!!.video_holder.setOnClickListener { toggleFullscreen() }
- initTimeHolder()
checkExtendedDetails()
}
@@ -227,7 +244,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
val factory = DataSource.Factory { fileDataSource }
val audioSource = ExtractorMediaSource(fileDataSource.uri, factory, DefaultExtractorsFactory(), null, null)
- mExoPlayer!!.audioStreamType = AudioManager.STREAM_MUSIC
+ mExoPlayer!!.audioStreamType = C.STREAM_TYPE_MUSIC
mExoPlayer!!.prepare(audioSource)
}
@@ -297,15 +314,12 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
bottom += resources.getDimension(R.dimen.bottom_actions_height).toInt()
}
- mTimeHolder!!.setPadding(left, top, right, bottom)
+ mTimeHolder.setPadding(left, top, right, bottom)
mCurrTimeView = mView!!.video_curr_time
mSeekBar = mView!!.video_seekbar
mSeekBar!!.setOnSeekBarChangeListener(this)
-
- if (mIsFullscreen) {
- mTimeHolder!!.beInvisible()
- }
+ mTimeHolder.beInvisibleIf(mIsFullscreen)
}
private fun hasNavBar(): Boolean {
@@ -367,7 +381,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
AnimationUtils.loadAnimation(activity, anim).apply {
duration = 150
fillAfter = true
- mTimeHolder?.startAnimation(this)
+ mTimeHolder.startAnimation(this)
}
}
@@ -431,7 +445,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0
private fun setProgress(seconds: Int) {
- mExoPlayer!!.seekTo(seconds * 1000L)
+ mExoPlayer?.seekTo(seconds * 1000L)
mSeekBar!!.progress = seconds
mCurrTimeView!!.text = seconds.getFormattedDuration()
}
@@ -555,7 +569,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
}
private fun skip(forward: Boolean) {
- if (mExoPlayer == null) {
+ if (mExoPlayer == null || mIsPanorama) {
return
}
@@ -613,7 +627,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private fun getExtendedDetailsY(height: Int): Float {
val smallMargin = resources.getDimension(R.dimen.small_margin)
- val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else mTimeHolder!!.height
+ val fullscreenOffset = smallMargin + if (mIsFullscreen) 0 else mTimeHolder.height
return context!!.realScreenSize.y.toFloat() - height - fullscreenOffset
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt
index 91c5f0a3c..5c012cade 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt
@@ -30,8 +30,8 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co
private var mSlideInfoText = ""
private var mSlideInfoFadeHandler = Handler()
private var mParentView: ViewGroup? = null
+ private var activity: Activity? = null
- private lateinit var activity: Activity
private lateinit var slideInfoView: TextView
private lateinit var callback: (Float, Float) -> Unit
@@ -55,7 +55,7 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co
}
override fun onTouchEvent(event: MotionEvent): Boolean {
- if (mPassTouches) {
+ if (mPassTouches && activity == null) {
return false
}
@@ -112,11 +112,11 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co
return true
}
- private fun getCurrentVolume() = activity.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
+ private fun getCurrentVolume() = activity!!.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
private fun getCurrentBrightness(): Int {
return try {
- Settings.System.getInt(activity.contentResolver, Settings.System.SCREEN_BRIGHTNESS)
+ Settings.System.getInt(activity!!.contentResolver, Settings.System.SCREEN_BRIGHTNESS)
} catch (e: Settings.SettingNotFoundException) {
70
}
@@ -132,11 +132,11 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co
private fun volumePercentChanged(percent: Int) {
val stream = AudioManager.STREAM_MUSIC
- val maxVolume = activity.audioManager.getStreamMaxVolume(stream)
+ val maxVolume = activity!!.audioManager.getStreamMaxVolume(stream)
val percentPerPoint = 100 / maxVolume
val addPoints = percent / percentPerPoint
val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownValue + addPoints))
- activity.audioManager.setStreamVolume(stream, newVolume, 0)
+ activity!!.audioManager.setStreamVolume(stream, newVolume, 0)
val absolutePercent = ((newVolume / maxVolume.toFloat()) * 100).toInt()
showValue(absolutePercent)
@@ -156,9 +156,9 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co
val absolutePercent = ((newBrightness / maxBrightness) * 100).toInt()
showValue(absolutePercent)
- val attributes = activity.window.attributes
+ val attributes = activity!!.window.attributes
attributes.screenBrightness = absolutePercent / 100f
- activity.window.attributes = attributes
+ activity!!.window.attributes = attributes
mSlideInfoFadeHandler.removeCallbacksAndMessages(null)
mSlideInfoFadeHandler.postDelayed({
diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml
index 435f4ce1a..02a888779 100644
--- a/app/src/main/res/layout/pager_video_item.xml
+++ b/app/src/main/res/layout/pager_video_item.xml
@@ -60,13 +60,23 @@
android:alpha="0"
android:background="@drawable/black_rounded_background"
android:gravity="center"
- android:paddingBottom="@dimen/medium_margin"
android:paddingLeft="@dimen/activity_margin"
- android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin"
+ android:paddingRight="@dimen/activity_margin"
+ android:paddingBottom="@dimen/medium_margin"
android:textColor="@android:color/white"
android:textSize="@dimen/extra_big_text_size"/>
+
+
+ android:layout_toLeftOf="@+id/video_duration"
+ android:layout_toEndOf="@+id/video_curr_time"
+ android:layout_toRightOf="@+id/video_curr_time"
+ android:paddingTop="@dimen/activity_margin"
+ android:paddingBottom="@dimen/activity_margin"/>
Date: Sun, 21 Oct 2018 13:14:56 +0200
Subject: [PATCH 33/62] rename Panorama activity to PanoramaPhoto
---
app/src/main/AndroidManifest.xml | 2 +-
.../{PanoramaActivity.kt => PanoramaPhotoActivity.kt} | 2 +-
.../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
rename app/src/main/kotlin/com/simplemobiletools/gallery/activities/{PanoramaActivity.kt => PanoramaPhotoActivity.kt} (99%)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index da9c7ea86..90fe663e1 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -123,7 +123,7 @@
android:configChanges="orientation|keyboardHidden|screenSize"/>
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
similarity index 99%
rename from app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt
rename to app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
index e13f4e055..c1cb9b55e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
@@ -21,7 +21,7 @@ import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.PATH
import kotlinx.android.synthetic.main.activity_panorama.*
-open class PanoramaActivity : SimpleActivity() {
+open class PanoramaPhotoActivity : SimpleActivity() {
private val CARDBOARD_DISPLAY_MODE = 3
private var isFullScreen = false
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 c074cbb24..4382df7dd 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -29,7 +29,7 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.OTG_PATH
import com.simplemobiletools.gallery.R
-import com.simplemobiletools.gallery.activities.PanoramaActivity
+import com.simplemobiletools.gallery.activities.PanoramaPhotoActivity
import com.simplemobiletools.gallery.activities.PhotoActivity
import com.simplemobiletools.gallery.activities.ViewPagerActivity
import com.simplemobiletools.gallery.extensions.*
@@ -341,7 +341,7 @@ class PhotoFragment : ViewPagerFragment() {
}
private fun openPanorama() {
- Intent(context, PanoramaActivity::class.java).apply {
+ Intent(context, PanoramaPhotoActivity::class.java).apply {
putExtra(PATH, medium.path)
startActivity(this)
}
From cb4d86461ec623f9206de84b4d84f33c53c52e03 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 17:57:55 +0200
Subject: [PATCH 34/62] adding some PanoramaVideo implementation
---
app/build.gradle | 1 +
app/src/main/AndroidManifest.xml | 5 +
.../activities/PanoramaPhotoActivity.kt | 15 +-
.../activities/PanoramaVideoActivity.kt | 153 ++++++++++++++++++
.../gallery/fragments/VideoFragment.kt | 11 ++
...norama.xml => activity_panorama_photo.xml} | 4 +-
.../res/layout/activity_panorama_video.xml | 23 +++
7 files changed, 203 insertions(+), 9 deletions(-)
create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
rename app/src/main/res/layout/{activity_panorama.xml => activity_panorama_photo.xml} (100%)
create mode 100644 app/src/main/res/layout/activity_panorama_video.xml
diff --git a/app/build.gradle b/app/build.gradle
index e7f656397..a60229b8b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -56,6 +56,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.0'
implementation 'com.google.vr:sdk-panowidget:1.170.0'
+ implementation 'com.google.vr:sdk-videowidget:1.170.0'
implementation 'org.apache.sanselan:sanselan:0.97-incubator'
implementation 'info.androidhive:imagefilters:1.0.7'
implementation 'com.squareup.picasso:picasso:2.71828'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 90fe663e1..86ed4b512 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -127,6 +127,11 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullScreenTheme"/>
+
+
+ isFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
+ toggleButtonVisibility()
+ }
+ }
+
+ override fun onConfigurationChanged(newConfig: Configuration?) {
+ super.onConfigurationChanged(newConfig)
+ setupButtonMargins()
+ }
+
+ private fun setupButtonMargins() {
+ (explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
+ }
+
+ private fun toggleButtonVisibility() {
+ explore.animate().alpha(if (isFullScreen) 0f else 1f)
+ explore.isClickable = !isFullScreen
+ }
+
+ private fun handleClick() {
+ isFullScreen = !isFullScreen
+ toggleButtonVisibility()
+ if (isFullScreen) {
+ hideSystemUI(false)
+ } else {
+ showSystemUI(false)
+ }
+ }
+}
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 aedb8a284..d6fddb039 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -1,5 +1,6 @@
package com.simplemobiletools.gallery.fragments
+import android.content.Intent
import android.content.res.Configuration
import android.graphics.Point
import android.graphics.SurfaceTexture
@@ -26,10 +27,12 @@ import com.google.android.exoplayer2.upstream.FileDataSource
import com.google.android.exoplayer2.video.VideoListener
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.gallery.R
+import com.simplemobiletools.gallery.activities.PanoramaVideoActivity
import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.MEDIUM
import com.simplemobiletools.gallery.helpers.MediaSideScroll
+import com.simplemobiletools.gallery.helpers.PATH
import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.pager_video_item.view.*
import java.io.File
@@ -77,6 +80,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
video_curr_time.setOnClickListener { skip(false) }
video_duration.setOnClickListener { skip(true) }
video_holder.setOnClickListener { toggleFullscreen() }
+ panorama_outline.setOnClickListener { openPanorama() }
// adding an empty click listener just to avoid ripple animation at toggling fullscreen
video_seekbar.setOnClickListener { }
@@ -611,6 +615,13 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mIsDragged = false
}
+ private fun openPanorama() {
+ Intent(context, PanoramaVideoActivity::class.java).apply {
+ putExtra(PATH, medium.path)
+ startActivity(this)
+ }
+ }
+
override fun fullscreenToggled(isFullscreen: Boolean) {
mIsFullscreen = isFullscreen
checkFullscreen()
diff --git a/app/src/main/res/layout/activity_panorama.xml b/app/src/main/res/layout/activity_panorama_photo.xml
similarity index 100%
rename from app/src/main/res/layout/activity_panorama.xml
rename to app/src/main/res/layout/activity_panorama_photo.xml
index ab146f09e..ff13ef97c 100644
--- a/app/src/main/res/layout/activity_panorama.xml
+++ b/app/src/main/res/layout/activity_panorama_photo.xml
@@ -16,8 +16,8 @@
android:id="@+id/cardboard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
+ android:layout_alignParentBottom="true"
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_cardboard"/>
@@ -25,8 +25,8 @@
android:id="@+id/explore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
+ android:layout_alignParentBottom="true"
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_explore"/>
diff --git a/app/src/main/res/layout/activity_panorama_video.xml b/app/src/main/res/layout/activity_panorama_video.xml
new file mode 100644
index 000000000..7708f6412
--- /dev/null
+++ b/app/src/main/res/layout/activity_panorama_video.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
From 5d419ea88ad1064eca129952c6d145cd0fe72a5e Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 18:28:13 +0200
Subject: [PATCH 35/62] hide the video play/pause button faster
---
.../gallery/fragments/VideoFragment.kt | 18 +++++++-----------
.../gallery/helpers/Constants.kt | 2 ++
2 files changed, 9 insertions(+), 11 deletions(-)
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 d6fddb039..ef35bc1fe 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -30,9 +30,7 @@ import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.PanoramaVideoActivity
import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
-import com.simplemobiletools.gallery.helpers.MEDIUM
-import com.simplemobiletools.gallery.helpers.MediaSideScroll
-import com.simplemobiletools.gallery.helpers.PATH
+import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.pager_video_item.view.*
import java.io.File
@@ -40,8 +38,6 @@ import java.io.File
class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, SeekBar.OnSeekBarChangeListener {
private val PROGRESS = "progress"
private val MIN_SKIP_LENGTH = 2000
- private val HIDE_PAUSE_DELAY = 2000L
- private val PLAY_PAUSE_VISIBLE_ALPHA = 0.8f
private var mTextureView: TextureView? = null
private var mCurrTimeView: TextView? = null
@@ -50,7 +46,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private var mExoPlayer: SimpleExoPlayer? = null
private var mVideoSize = Point(0, 0)
private var mTimerHandler = Handler()
- private var mHidePauseHandler = Handler()
+ private var mHidePlayPauseHandler = Handler()
private var mIsPlaying = false
private var mIsDragged = false
@@ -394,7 +390,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
return
mIsPlaying = !mIsPlaying
- mHidePauseHandler.removeCallbacksAndMessages(null)
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
if (mIsPlaying) {
playVideo()
} else {
@@ -440,10 +436,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
}
private fun schedulePlayPauseFadeOut() {
- mHidePauseHandler.removeCallbacksAndMessages(null)
- mHidePauseHandler.postDelayed({
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ mHidePlayPauseHandler.postDelayed({
mView!!.video_play_outline.animate().alpha(0f).start()
- }, HIDE_PAUSE_DELAY)
+ }, HIDE_PLAY_PAUSE_DELAY)
}
private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0
@@ -499,7 +495,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
releaseExoPlayer()
mSeekBar?.progress = 0
mTimerHandler.removeCallbacksAndMessages(null)
- mHidePauseHandler.removeCallbacksAndMessages(null)
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
mTextureView = null
}
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 8c0c7b15d..79a0b37f7 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
@@ -86,6 +86,8 @@ const val SHOW_TEMP_HIDDEN_DURATION = 300000L
const val CLICK_MAX_DURATION = 150
const val DRAG_THRESHOLD = 8
const val MONTH_MILLISECONDS = MONTH_SECONDS * 1000L
+const val HIDE_PLAY_PAUSE_DELAY = 500L
+const val PLAY_PAUSE_VISIBLE_ALPHA = 0.8f
const val DIRECTORY = "directory"
const val MEDIUM = "medium"
From 64180c0af1ae19b4ebd92853bbc7f0a612f62b14 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 18:42:15 +0200
Subject: [PATCH 36/62] implement vr video play/pause
---
.../activities/PanoramaVideoActivity.kt | 46 +++++++++++++++++++
.../gallery/fragments/VideoFragment.kt | 2 +
.../res/layout/activity_panorama_video.xml | 9 ++++
3 files changed, 57 insertions(+)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
index 5a9ebee26..9380531b4 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
@@ -4,6 +4,7 @@ import android.content.res.Configuration
import android.graphics.Color
import android.net.Uri
import android.os.Bundle
+import android.os.Handler
import android.view.View
import android.view.Window
import android.view.WindowManager
@@ -19,7 +20,9 @@ import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.hideSystemUI
import com.simplemobiletools.gallery.extensions.navigationBarHeight
import com.simplemobiletools.gallery.extensions.showSystemUI
+import com.simplemobiletools.gallery.helpers.HIDE_PLAY_PAUSE_DELAY
import com.simplemobiletools.gallery.helpers.PATH
+import com.simplemobiletools.gallery.helpers.PLAY_PAUSE_VISIBLE_ALPHA
import kotlinx.android.synthetic.main.activity_panorama_video.*
import java.io.File
@@ -27,6 +30,9 @@ open class PanoramaVideoActivity : SimpleActivity() {
private var isFullScreen = false
private var isExploreEnabled = true
private var isRendering = false
+ private var isPlaying = true
+
+ private var mHidePlayPauseHandler = Handler()
public override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false
@@ -80,6 +86,10 @@ open class PanoramaVideoActivity : SimpleActivity() {
if (isRendering) {
vr_video_view.shutdown()
}
+
+ if (!isChangingConfigurations) {
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ }
}
private fun checkIntent() {
@@ -98,6 +108,7 @@ open class PanoramaVideoActivity : SimpleActivity() {
vr_video_view.apply {
loadVideo(Uri.fromFile(File(path)), options)
+ schedulePlayPauseFadeOut()
setFlingingEnabled(true)
setPureTouchTracking(true)
@@ -117,6 +128,10 @@ open class PanoramaVideoActivity : SimpleActivity() {
}
})
}
+
+ video_play_outline.setOnClickListener {
+ togglePlayPause()
+ }
} catch (e: Exception) {
showErrorToast(e)
}
@@ -132,6 +147,37 @@ open class PanoramaVideoActivity : SimpleActivity() {
setupButtonMargins()
}
+ private fun togglePlayPause() {
+ isPlaying = !isPlaying
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
+ schedulePlayPauseFadeOut()
+ if (isPlaying) {
+ playVideo()
+ } else {
+ pauseVideo()
+ }
+ }
+
+ private fun playVideo() {
+ vr_video_view.playVideo()
+ video_play_outline.setImageResource(R.drawable.ic_pause)
+ window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ }
+
+ private fun pauseVideo() {
+ vr_video_view.pauseVideo()
+ video_play_outline.setImageResource(R.drawable.ic_play)
+ window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
+ }
+
+ private fun schedulePlayPauseFadeOut() {
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ mHidePlayPauseHandler.postDelayed({
+ video_play_outline.animate().alpha(0f).start()
+ }, HIDE_PLAY_PAUSE_DELAY)
+ }
+
private fun setupButtonMargins() {
(explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
}
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 ef35bc1fe..c1976644b 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -32,6 +32,7 @@ import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
+import kotlinx.android.synthetic.main.activity_panorama_video.*
import kotlinx.android.synthetic.main.pager_video_item.view.*
import java.io.File
@@ -415,6 +416,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mIsPlaying = true
mExoPlayer?.playWhenReady = true
mView!!.video_play_outline.setImageResource(R.drawable.ic_pause)
+ video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
schedulePlayPauseFadeOut()
}
diff --git a/app/src/main/res/layout/activity_panorama_video.xml b/app/src/main/res/layout/activity_panorama_video.xml
index 7708f6412..e5c970568 100644
--- a/app/src/main/res/layout/activity_panorama_video.xml
+++ b/app/src/main/res/layout/activity_panorama_video.xml
@@ -20,4 +20,13 @@
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_explore"/>
+
+
From 9fd3acd93fab42c792adaa55a177cee2c62dedf1 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 19:29:45 +0200
Subject: [PATCH 37/62] moving the bottom video time holder views in a separate
layout file
---
.../gallery/fragments/VideoFragment.kt | 4 +-
.../res/layout/bottom_video_time_holder.xml | 51 +++++++++++++++++++
app/src/main/res/layout/pager_video_item.xml | 49 +-----------------
3 files changed, 54 insertions(+), 50 deletions(-)
create mode 100644 app/src/main/res/layout/bottom_video_time_holder.xml
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 c1976644b..436262a3e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -32,7 +32,7 @@ import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
-import kotlinx.android.synthetic.main.activity_panorama_video.*
+import kotlinx.android.synthetic.main.bottom_video_time_holder.view.*
import kotlinx.android.synthetic.main.pager_video_item.view.*
import java.io.File
@@ -416,7 +416,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mIsPlaying = true
mExoPlayer?.playWhenReady = true
mView!!.video_play_outline.setImageResource(R.drawable.ic_pause)
- video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
+ mView!!.video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
schedulePlayPauseFadeOut()
}
diff --git a/app/src/main/res/layout/bottom_video_time_holder.xml b/app/src/main/res/layout/bottom_video_time_holder.xml
new file mode 100644
index 000000000..780b71837
--- /dev/null
+++ b/app/src/main/res/layout/bottom_video_time_holder.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml
index 02a888779..b321f29f2 100644
--- a/app/src/main/res/layout/pager_video_item.xml
+++ b/app/src/main/res/layout/pager_video_item.xml
@@ -91,52 +91,5 @@
android:visibility="gone"
tools:text="My video\nAnother line"/>
-
-
-
-
-
-
-
-
-
+
From 0cb212947c6949bdbf5c2349bded5c82db4440a1 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 20:51:32 +0200
Subject: [PATCH 38/62] adding a seekbar to the panorama video view
---
.../activities/PanoramaVideoActivity.kt | 151 +++++++++++++++---
.../gallery/fragments/VideoFragment.kt | 8 +-
.../res/layout/activity_panorama_video.xml | 4 +-
3 files changed, 136 insertions(+), 27 deletions(-)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
index 9380531b4..6187d08ed 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
@@ -8,9 +8,13 @@ import android.os.Handler
import android.view.View
import android.view.Window
import android.view.WindowManager
+import android.view.animation.AnimationUtils
import android.widget.RelativeLayout
+import android.widget.SeekBar
import com.google.vr.sdk.widgets.video.VrVideoEventListener
import com.google.vr.sdk.widgets.video.VrVideoView
+import com.simplemobiletools.commons.extensions.getFormattedDuration
+import com.simplemobiletools.commons.extensions.onGlobalLayout
import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
@@ -24,15 +28,21 @@ import com.simplemobiletools.gallery.helpers.HIDE_PLAY_PAUSE_DELAY
import com.simplemobiletools.gallery.helpers.PATH
import com.simplemobiletools.gallery.helpers.PLAY_PAUSE_VISIBLE_ALPHA
import kotlinx.android.synthetic.main.activity_panorama_video.*
+import kotlinx.android.synthetic.main.bottom_video_time_holder.*
import java.io.File
-open class PanoramaVideoActivity : SimpleActivity() {
- private var isFullScreen = false
- private var isExploreEnabled = true
- private var isRendering = false
- private var isPlaying = true
+open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
+ private var mIsFullscreen = false
+ private var mIsExploreEnabled = true
+ private var mIsRendering = false
+ private var mIsPlaying = false
+ private var mIsDragged = false
+ private var mPlayOnReady = false
+ private var mDuration = 0
+ private var mCurrTime = 0
private var mHidePlayPauseHandler = Handler()
+ private var mTimerHandler = Handler()
public override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false
@@ -49,9 +59,9 @@ open class PanoramaVideoActivity : SimpleActivity() {
setupButtonMargins()
explore.setOnClickListener {
- isExploreEnabled = !isExploreEnabled
- vr_video_view.setPureTouchTracking(isExploreEnabled)
- explore.setImageResource(if (isExploreEnabled) R.drawable.ic_explore else R.drawable.ic_explore_off)
+ mIsExploreEnabled = !mIsExploreEnabled
+ vr_video_view.setPureTouchTracking(mIsExploreEnabled)
+ explore.setImageResource(if (mIsExploreEnabled) R.drawable.ic_explore else R.drawable.ic_explore_off)
}
handlePermission(PERMISSION_WRITE_STORAGE) {
@@ -67,7 +77,7 @@ open class PanoramaVideoActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
vr_video_view.resumeRendering()
- isRendering = true
+ mIsRendering = true
if (config.blackBackground) {
updateStatusbarColor(Color.BLACK)
}
@@ -78,17 +88,18 @@ open class PanoramaVideoActivity : SimpleActivity() {
override fun onPause() {
super.onPause()
vr_video_view.pauseRendering()
- isRendering = false
+ mIsRendering = false
}
override fun onDestroy() {
super.onDestroy()
- if (isRendering) {
+ if (mIsRendering) {
vr_video_view.shutdown()
}
if (!isChangingConfigurations) {
mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ mTimerHandler.removeCallbacksAndMessages(null)
}
}
@@ -108,7 +119,8 @@ open class PanoramaVideoActivity : SimpleActivity() {
vr_video_view.apply {
loadVideo(Uri.fromFile(File(path)), options)
- schedulePlayPauseFadeOut()
+ pauseVideo()
+
setFlingingEnabled(true)
setPureTouchTracking(true)
@@ -126,6 +138,22 @@ open class PanoramaVideoActivity : SimpleActivity() {
override fun onClick() {
handleClick()
}
+
+ override fun onLoadSuccess() {
+ if (mDuration == 0) {
+ setupDuration(duration)
+ setupTimer()
+ }
+
+ if (mPlayOnReady) {
+ mPlayOnReady = false
+ playVideo()
+ }
+ }
+
+ override fun onCompletion() {
+ videoCompleted()
+ }
})
}
@@ -137,7 +165,7 @@ open class PanoramaVideoActivity : SimpleActivity() {
}
window.decorView.setOnSystemUiVisibilityChangeListener { visibility ->
- isFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
+ mIsFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
toggleButtonVisibility()
}
}
@@ -147,19 +175,46 @@ open class PanoramaVideoActivity : SimpleActivity() {
setupButtonMargins()
}
+ private fun setupDuration(duration: Long) {
+ mDuration = (duration / 1000).toInt()
+ video_seekbar.max = mDuration
+ video_duration.text = mDuration.getFormattedDuration()
+ setVideoProgress(0)
+ }
+
+ private fun setupTimer() {
+ runOnUiThread(object : Runnable {
+ override fun run() {
+ if (mIsPlaying && !mIsDragged) {
+ mCurrTime = (vr_video_view!!.currentPosition / 1000).toInt()
+ video_seekbar.progress = mCurrTime
+ video_curr_time.text = mCurrTime.getFormattedDuration()
+ }
+
+ mTimerHandler.postDelayed(this, 1000)
+ }
+ })
+ }
+
private fun togglePlayPause() {
- isPlaying = !isPlaying
- mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ mIsPlaying = !mIsPlaying
video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
- schedulePlayPauseFadeOut()
- if (isPlaying) {
+ mHidePlayPauseHandler.removeCallbacksAndMessages(null)
+ if (mIsPlaying) {
playVideo()
} else {
pauseVideo()
}
+ schedulePlayPauseFadeOut()
}
private fun playVideo() {
+ if (mCurrTime == mDuration) {
+ setVideoProgress(0)
+ mPlayOnReady = true
+ return
+ }
+
vr_video_view.playVideo()
video_play_outline.setImageResource(R.drawable.ic_pause)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
@@ -171,6 +226,22 @@ open class PanoramaVideoActivity : SimpleActivity() {
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
+ private fun setVideoProgress(seconds: Int) {
+ vr_video_view.seekTo(seconds * 1000L)
+ video_seekbar.progress = seconds
+ mCurrTime = seconds
+ video_curr_time.text = seconds.getFormattedDuration()
+ }
+
+ private fun videoCompleted() {
+ mIsPlaying = false
+ mCurrTime = (vr_video_view.duration / 1000).toInt()
+ video_seekbar.progress = video_seekbar.max
+ video_curr_time.text = mDuration.getFormattedDuration()
+ pauseVideo()
+ video_play_outline.alpha = PLAY_PAUSE_VISIBLE_ALPHA
+ }
+
private fun schedulePlayPauseFadeOut() {
mHidePlayPauseHandler.removeCallbacksAndMessages(null)
mHidePlayPauseHandler.postDelayed({
@@ -179,21 +250,57 @@ open class PanoramaVideoActivity : SimpleActivity() {
}
private fun setupButtonMargins() {
- (explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
+ (video_time_holder.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
+ video_time_holder.onGlobalLayout {
+ (explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight + video_time_holder.height
+ explore.requestLayout()
+ }
}
private fun toggleButtonVisibility() {
- explore.animate().alpha(if (isFullScreen) 0f else 1f)
- explore.isClickable = !isFullScreen
+ explore.animate().alpha(if (mIsFullscreen) 0f else 1f)
+ explore.isClickable = !mIsFullscreen
+
+ var anim = android.R.anim.fade_in
+ if (mIsFullscreen) {
+ anim = android.R.anim.fade_out
+ video_seekbar.setOnSeekBarChangeListener(null)
+ } else {
+ video_seekbar.setOnSeekBarChangeListener(this)
+ }
+
+ AnimationUtils.loadAnimation(this, anim).apply {
+ duration = 150
+ fillAfter = true
+ video_time_holder.startAnimation(this)
+ }
}
private fun handleClick() {
- isFullScreen = !isFullScreen
+ mIsFullscreen = !mIsFullscreen
toggleButtonVisibility()
- if (isFullScreen) {
+ if (mIsFullscreen) {
hideSystemUI(false)
} else {
showSystemUI(false)
}
}
+
+ override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+ if (fromUser) {
+ setVideoProgress(progress)
+ }
+ }
+
+ override fun onStartTrackingTouch(seekBar: SeekBar?) {
+ vr_video_view.pauseVideo()
+ mIsDragged = true
+ }
+
+ override fun onStopTrackingTouch(seekBar: SeekBar?) {
+ mIsPlaying = true
+ playVideo()
+ mIsDragged = false
+ schedulePlayPauseFadeOut()
+ }
}
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 436262a3e..6d797c2ca 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -85,6 +85,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mTimeHolder = video_time_holder
mBrightnessSideScroll = video_brightness_controller
mVolumeSideScroll = video_volume_controller
+ mCurrTimeView = video_curr_time
}
storeStateVariables()
@@ -317,7 +318,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mTimeHolder.setPadding(left, top, right, bottom)
- mCurrTimeView = mView!!.video_curr_time
mSeekBar = mView!!.video_seekbar
mSeekBar!!.setOnSeekBarChangeListener(this)
mTimeHolder.beInvisibleIf(mIsFullscreen)
@@ -604,10 +604,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
if (mExoPlayer == null)
return
- if (!mIsPlaying) {
- togglePlayPause()
- } else {
+ if (mIsPlaying) {
mExoPlayer!!.playWhenReady = true
+ } else {
+ togglePlayPause()
}
mIsDragged = false
diff --git a/app/src/main/res/layout/activity_panorama_video.xml b/app/src/main/res/layout/activity_panorama_video.xml
index e5c970568..84a1962aa 100644
--- a/app/src/main/res/layout/activity_panorama_video.xml
+++ b/app/src/main/res/layout/activity_panorama_video.xml
@@ -27,6 +27,8 @@
android:layout_centerInParent="true"
android:background="@drawable/circle_black_background_with_inset"
android:padding="26dp"
- android:src="@drawable/ic_pause"/>
+ android:src="@drawable/ic_play"/>
+
+
From 3ee3887754309579f789c6f1ef355bc2757ed435 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 21:01:03 +0200
Subject: [PATCH 39/62] add skip forward/backward at panorama videos
---
.../activities/PanoramaVideoActivity.kt | 22 ++++++++++++++++++-
.../gallery/fragments/VideoFragment.kt | 1 -
.../gallery/helpers/Constants.kt | 1 +
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
index 6187d08ed..194554028 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
@@ -25,6 +25,7 @@ import com.simplemobiletools.gallery.extensions.hideSystemUI
import com.simplemobiletools.gallery.extensions.navigationBarHeight
import com.simplemobiletools.gallery.extensions.showSystemUI
import com.simplemobiletools.gallery.helpers.HIDE_PLAY_PAUSE_DELAY
+import com.simplemobiletools.gallery.helpers.MIN_SKIP_LENGTH
import com.simplemobiletools.gallery.helpers.PATH
import com.simplemobiletools.gallery.helpers.PLAY_PAUSE_VISIBLE_ALPHA
import kotlinx.android.synthetic.main.activity_panorama_video.*
@@ -113,6 +114,9 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
intent.removeExtra(PATH)
+ video_curr_time.setOnClickListener { skip(false) }
+ video_duration.setOnClickListener { skip(true) }
+
try {
val options = VrVideoView.Options()
options.inputType = VrVideoView.Options.TYPE_MONO
@@ -209,6 +213,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
}
private fun playVideo() {
+ video_play_outline.setImageResource(R.drawable.ic_pause)
if (mCurrTime == mDuration) {
setVideoProgress(0)
mPlayOnReady = true
@@ -216,7 +221,6 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
}
vr_video_view.playVideo()
- video_play_outline.setImageResource(R.drawable.ic_pause)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
@@ -286,6 +290,22 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
}
}
+ private fun skip(forward: Boolean) {
+ if (forward && mCurrTime == mDuration) {
+ return
+ }
+
+ val curr = vr_video_view.currentPosition
+ val twoPercents = Math.max((vr_video_view.duration / 50).toInt(), MIN_SKIP_LENGTH)
+ val newProgress = if (forward) curr + twoPercents else curr - twoPercents
+ val roundProgress = Math.round(newProgress / 1000f)
+ val limitedProgress = Math.max(Math.min(vr_video_view.duration.toInt(), roundProgress), 0)
+ setVideoProgress(limitedProgress)
+ if (!mIsPlaying) {
+ togglePlayPause()
+ }
+ }
+
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
if (fromUser) {
setVideoProgress(progress)
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 6d797c2ca..af176e24a 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -38,7 +38,6 @@ import java.io.File
class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, SeekBar.OnSeekBarChangeListener {
private val PROGRESS = "progress"
- private val MIN_SKIP_LENGTH = 2000
private var mTextureView: TextureView? = null
private var mCurrTimeView: TextView? = null
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 79a0b37f7..1208b47a8 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
@@ -88,6 +88,7 @@ const val DRAG_THRESHOLD = 8
const val MONTH_MILLISECONDS = MONTH_SECONDS * 1000L
const val HIDE_PLAY_PAUSE_DELAY = 500L
const val PLAY_PAUSE_VISIBLE_ALPHA = 0.8f
+const val MIN_SKIP_LENGTH = 2000
const val DIRECTORY = "directory"
const val MEDIUM = "medium"
From 33880f7c1bae1f451baf4997c7a924dfaf3ff48c Mon Sep 17 00:00:00 2001
From: tibbi
Date: Sun, 21 Oct 2018 21:23:28 +0200
Subject: [PATCH 40/62] adding a panorama video button for toggling cardboard
mode
---
.../activities/PanoramaPhotoActivity.kt | 19 +++++++------
.../activities/PanoramaVideoActivity.kt | 28 +++++++++++++++----
.../res/layout/activity_panorama_video.xml | 9 ++++++
3 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
index 7773ddd0d..27584fdc9 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
@@ -24,7 +24,7 @@ import kotlinx.android.synthetic.main.activity_panorama_photo.*
open class PanoramaPhotoActivity : SimpleActivity() {
private val CARDBOARD_DISPLAY_MODE = 3
- private var isFullScreen = false
+ private var isFullscreen = false
private var isExploreEnabled = true
private var isRendering = false
@@ -131,7 +131,7 @@ open class PanoramaPhotoActivity : SimpleActivity() {
}
window.decorView.setOnSystemUiVisibilityChangeListener { visibility ->
- isFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
+ isFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
toggleButtonVisibility()
}
}
@@ -159,8 +159,9 @@ open class PanoramaPhotoActivity : SimpleActivity() {
}
private fun setupButtonMargins() {
+ val navBarHeight = navigationBarHeight
(cardboard.layoutParams as RelativeLayout.LayoutParams).apply {
- bottomMargin = navigationBarHeight
+ bottomMargin = navBarHeight
rightMargin = navigationBarWidth
}
@@ -168,17 +169,17 @@ open class PanoramaPhotoActivity : SimpleActivity() {
}
private fun toggleButtonVisibility() {
- cardboard.animate().alpha(if (isFullScreen) 0f else 1f)
- cardboard.isClickable = !isFullScreen
+ cardboard.animate().alpha(if (isFullscreen) 0f else 1f)
+ cardboard.isClickable = !isFullscreen
- explore.animate().alpha(if (isFullScreen) 0f else 1f)
- explore.isClickable = !isFullScreen
+ explore.animate().alpha(if (isFullscreen) 0f else 1f)
+ explore.isClickable = !isFullscreen
}
private fun handleClick() {
- isFullScreen = !isFullScreen
+ isFullscreen = !isFullscreen
toggleButtonVisibility()
- if (isFullScreen) {
+ if (isFullscreen) {
hideSystemUI(false)
} else {
showSystemUI(false)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
index 194554028..30e76ad5a 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
@@ -20,10 +20,7 @@ import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.isPiePlus
import com.simplemobiletools.gallery.R
-import com.simplemobiletools.gallery.extensions.config
-import com.simplemobiletools.gallery.extensions.hideSystemUI
-import com.simplemobiletools.gallery.extensions.navigationBarHeight
-import com.simplemobiletools.gallery.extensions.showSystemUI
+import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.HIDE_PLAY_PAUSE_DELAY
import com.simplemobiletools.gallery.helpers.MIN_SKIP_LENGTH
import com.simplemobiletools.gallery.helpers.PATH
@@ -33,6 +30,8 @@ import kotlinx.android.synthetic.main.bottom_video_time_holder.*
import java.io.File
open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
+ private val CARDBOARD_DISPLAY_MODE = 3
+
private var mIsFullscreen = false
private var mIsExploreEnabled = true
private var mIsRendering = false
@@ -59,6 +58,10 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
setupButtonMargins()
+ cardboard.setOnClickListener {
+ vr_video_view.displayMode = CARDBOARD_DISPLAY_MODE
+ }
+
explore.setOnClickListener {
mIsExploreEnabled = !mIsExploreEnabled
vr_video_view.setPureTouchTracking(mIsExploreEnabled)
@@ -254,14 +257,27 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
}
private fun setupButtonMargins() {
- (video_time_holder.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
+ val navBarHeight = navigationBarHeight
+ video_time_holder.apply {
+ (layoutParams as RelativeLayout.LayoutParams).bottomMargin = navBarHeight
+ setPadding(paddingLeft, paddingTop, navigationBarWidth, paddingBottom)
+ }
+
video_time_holder.onGlobalLayout {
- (explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight + video_time_holder.height
+ (explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navBarHeight + video_time_holder.height
+
+ (cardboard.layoutParams as RelativeLayout.LayoutParams).apply {
+ bottomMargin = navBarHeight + video_time_holder.height
+ rightMargin = navigationBarWidth
+ }
explore.requestLayout()
}
}
private fun toggleButtonVisibility() {
+ cardboard.animate().alpha(if (mIsFullscreen) 0f else 1f)
+ cardboard.isClickable = !mIsFullscreen
+
explore.animate().alpha(if (mIsFullscreen) 0f else 1f)
explore.isClickable = !mIsFullscreen
diff --git a/app/src/main/res/layout/activity_panorama_video.xml b/app/src/main/res/layout/activity_panorama_video.xml
index 84a1962aa..ca3704d84 100644
--- a/app/src/main/res/layout/activity_panorama_video.xml
+++ b/app/src/main/res/layout/activity_panorama_video.xml
@@ -20,6 +20,15 @@
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_explore"/>
+
+
Date: Sun, 21 Oct 2018 21:44:39 +0200
Subject: [PATCH 41/62] adding some bottom gradient to panoramas for easier
button visibility
---
.../gallery/activities/PanoramaPhotoActivity.kt | 14 +++++++++-----
.../gallery/activities/PanoramaVideoActivity.kt | 17 +++++++++--------
.../main/res/layout/activity_panorama_photo.xml | 7 +++++++
.../main/res/layout/activity_panorama_video.xml | 7 +++++++
4 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
index 27584fdc9..a1dfb2664 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaPhotoActivity.kt
@@ -12,6 +12,7 @@ import android.widget.RelativeLayout
import com.google.vr.sdk.widgets.pano.VrPanoramaEventListener
import com.google.vr.sdk.widgets.pano.VrPanoramaView
import com.simplemobiletools.commons.extensions.beVisible
+import com.simplemobiletools.commons.extensions.onGlobalLayout
import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
@@ -166,14 +167,17 @@ open class PanoramaPhotoActivity : SimpleActivity() {
}
(explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
+
+ cardboard.onGlobalLayout {
+ panorama_gradient_background.layoutParams.height = navBarHeight + cardboard.height
+ }
}
private fun toggleButtonVisibility() {
- cardboard.animate().alpha(if (isFullscreen) 0f else 1f)
- cardboard.isClickable = !isFullscreen
-
- explore.animate().alpha(if (isFullscreen) 0f else 1f)
- explore.isClickable = !isFullscreen
+ arrayOf(cardboard, explore, panorama_gradient_background).forEach {
+ it.animate().alpha(if (isFullscreen) 0f else 1f)
+ it.isClickable = !isFullscreen
+ }
}
private fun handleClick() {
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
index 30e76ad5a..3e65534ff 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaVideoActivity.kt
@@ -56,7 +56,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
- setupButtonMargins()
+ setupButtons()
cardboard.setOnClickListener {
vr_video_view.displayMode = CARDBOARD_DISPLAY_MODE
@@ -179,7 +179,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
override fun onConfigurationChanged(newConfig: Configuration?) {
super.onConfigurationChanged(newConfig)
- setupButtonMargins()
+ setupButtons()
}
private fun setupDuration(duration: Long) {
@@ -256,7 +256,7 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
}, HIDE_PLAY_PAUSE_DELAY)
}
- private fun setupButtonMargins() {
+ private fun setupButtons() {
val navBarHeight = navigationBarHeight
video_time_holder.apply {
(layoutParams as RelativeLayout.LayoutParams).bottomMargin = navBarHeight
@@ -270,16 +270,17 @@ open class PanoramaVideoActivity : SimpleActivity(), SeekBar.OnSeekBarChangeList
bottomMargin = navBarHeight + video_time_holder.height
rightMargin = navigationBarWidth
}
+ vr_view_gradient_background.layoutParams.height = navBarHeight + video_time_holder.height + explore.height
explore.requestLayout()
}
}
private fun toggleButtonVisibility() {
- cardboard.animate().alpha(if (mIsFullscreen) 0f else 1f)
- cardboard.isClickable = !mIsFullscreen
-
- explore.animate().alpha(if (mIsFullscreen) 0f else 1f)
- explore.isClickable = !mIsFullscreen
+ val newAlpha = if (mIsFullscreen) 0f else 1f
+ arrayOf(cardboard, explore, vr_view_gradient_background).forEach {
+ it.animate().alpha(newAlpha)
+ it.isClickable = !mIsFullscreen
+ }
var anim = android.R.anim.fade_in
if (mIsFullscreen) {
diff --git a/app/src/main/res/layout/activity_panorama_photo.xml b/app/src/main/res/layout/activity_panorama_photo.xml
index ff13ef97c..4592d8838 100644
--- a/app/src/main/res/layout/activity_panorama_photo.xml
+++ b/app/src/main/res/layout/activity_panorama_photo.xml
@@ -12,6 +12,13 @@
android:layout_height="match_parent"
android:visibility="gone"/>
+
+
+
+
Date: Sun, 21 Oct 2018 22:38:41 +0200
Subject: [PATCH 42/62] removing a redundant style definition
---
app/build.gradle | 2 +-
app/src/main/res/layout/bottom_actions.xml | 24 +++++++++----------
.../layout/bottom_actions_aspect_ratio.xml | 8 +++----
.../bottom_editor_crop_rotate_actions.xml | 10 ++++----
.../layout/bottom_editor_primary_actions.xml | 4 ++--
.../layout/bottom_set_wallpaper_actions.xml | 4 ++--
.../res/layout/bottom_video_time_holder.xml | 4 ++--
7 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index a60229b8b..3cc62e0bb 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.12'
+ implementation 'com.simplemobiletools:commons:5.1.14'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
diff --git a/app/src/main/res/layout/bottom_actions.xml b/app/src/main/res/layout/bottom_actions.xml
index 090a30d78..2cb308bbc 100644
--- a/app/src/main/res/layout/bottom_actions.xml
+++ b/app/src/main/res/layout/bottom_actions.xml
@@ -11,9 +11,9 @@
Date: Mon, 22 Oct 2018 10:37:36 +0200
Subject: [PATCH 43/62] improve the SAF file path selection
---
.../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 ed43c8dcb..364e02b9b 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
@@ -355,7 +355,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList(selectedKeys.size)
val removeMedia = ArrayList(selectedKeys.size)
From 6f812bbbaaec347d82a3f1a8d1175c8b94380760 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 11:30:46 +0200
Subject: [PATCH 44/62] adding a simple way of renaming multiple items at once
---
app/build.gradle | 2 +-
.../gallery/adapters/DirectoryAdapter.kt | 46 +++++++++++--------
.../gallery/adapters/MediaAdapter.kt | 31 ++++++++-----
3 files changed, 48 insertions(+), 31 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 3cc62e0bb..7fbdd5d2f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.14'
+ implementation 'com.simplemobiletools:commons:5.1.15'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
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 784e2e65e..b40908788 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt
@@ -10,6 +10,7 @@ import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog
+import com.simplemobiletools.commons.dialogs.RenameItemsDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.OTG_PATH
import com.simplemobiletools.commons.models.FileDirItem
@@ -68,7 +69,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList
+ RenameItemsDialog(activity, paths) {
+ listener?.refreshItems()
}
}
}
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 364e02b9b..52d40caf8 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt
@@ -13,6 +13,7 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog
+import com.simplemobiletools.commons.dialogs.RenameItemsDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.OTG_PATH
import com.simplemobiletools.commons.models.FileDirItem
@@ -111,7 +112,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList
menu.apply {
- findItem(R.id.cab_rename).isVisible = isOneItemSelected && selectedItems.firstOrNull()?.getIsInRecycleBin() == false
+ findItem(R.id.cab_rename).isVisible = selectedItems.firstOrNull()?.getIsInRecycleBin() == false
findItem(R.id.cab_open_with).isVisible = isOneItemSelected
findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedKeys.isNotEmpty()
findItem(R.id.cab_restore_recycle_bin_files).isVisible = selectedPaths.all { it.startsWith(activity.filesDir.absolutePath) }
@@ -195,17 +196,25 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList
Date: Mon, 22 Oct 2018 13:57:23 +0200
Subject: [PATCH 45/62] moving MediaSideScroll to the Views folder, no real
change
---
.../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 1 +
.../gallery/{helpers => views}/MediaSideScroll.kt | 4 +++-
app/src/main/res/layout/pager_photo_item.xml | 2 +-
app/src/main/res/layout/pager_video_item.xml | 4 ++--
4 files changed, 7 insertions(+), 4 deletions(-)
rename app/src/main/kotlin/com/simplemobiletools/gallery/{helpers => views}/MediaSideScroll.kt (97%)
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 af176e24a..1edde49d9 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -32,6 +32,7 @@ import com.simplemobiletools.gallery.activities.VideoActivity
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
+import com.simplemobiletools.gallery.views.MediaSideScroll
import kotlinx.android.synthetic.main.bottom_video_time_holder.view.*
import kotlinx.android.synthetic.main.pager_video_item.view.*
import java.io.File
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MediaSideScroll.kt
similarity index 97%
rename from app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt
rename to app/src/main/kotlin/com/simplemobiletools/gallery/views/MediaSideScroll.kt
index 5c012cade..bfb394eeb 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MediaSideScroll.kt
@@ -1,4 +1,4 @@
-package com.simplemobiletools.gallery.helpers
+package com.simplemobiletools.gallery.views
import android.app.Activity
import android.content.Context
@@ -13,6 +13,8 @@ import android.widget.TextView
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.ViewPagerActivity
import com.simplemobiletools.gallery.extensions.audioManager
+import com.simplemobiletools.gallery.helpers.CLICK_MAX_DURATION
+import com.simplemobiletools.gallery.helpers.DRAG_THRESHOLD
// allow horizontal swipes through the layout, else it can cause glitches at zoomed in images
class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) {
diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml
index 9be779d15..4bb227f80 100644
--- a/app/src/main/res/layout/pager_photo_item.xml
+++ b/app/src/main/res/layout/pager_photo_item.xml
@@ -47,7 +47,7 @@
android:visibility="gone"
tools:text="My image\nAnother line"/>
-
-
-
From df03f39b9403154aad87e11c0acb9132338f304c Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 16:27:56 +0200
Subject: [PATCH 46/62] allow closing fullscreen with down gesture, if deep
zoomable image is visible
---
.../gallery/fragments/PhotoFragment.kt | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
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 4382df7dd..26ae8208e 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -15,6 +15,7 @@ import android.os.Bundle
import android.os.Handler
import android.util.DisplayMetrics
import android.view.LayoutInflater
+import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import com.bumptech.glide.Glide
@@ -75,6 +76,12 @@ class PhotoFragment : ViewPagerFragment() {
private var storedAllowOneFingerZoom = false
private var storedExtendedDetails = 0
+ private var mTouchDownX = 0f
+ private var mTouchDownY = 0f
+ private var mOriginalSubsamplingScale = 0f
+ private var mCloseDownThreshold = 100f
+ private var mIgnoreCloseDown = false
+
lateinit var view: ViewGroup
lateinit var medium: Medium
@@ -99,6 +106,11 @@ class PhotoFragment : ViewPagerFragment() {
}
}
}
+
+ subsampling_view.setOnTouchListener { v, event ->
+ handleEvent(event)
+ false
+ }
}
if (ViewPagerActivity.screenWidth == 0 || ViewPagerActivity.screenHeight == 0) {
@@ -383,6 +395,7 @@ class PhotoFragment : ViewPagerFragment() {
val useWidth = if (imageOrientation == ORIENTATION_ROTATE_90 || imageOrientation == ORIENTATION_ROTATE_270) sHeight else sWidth
val useHeight = if (imageOrientation == ORIENTATION_ROTATE_90 || imageOrientation == ORIENTATION_ROTATE_270) sWidth else sHeight
setDoubleTapZoomScale(getDoubleTapZoomScale(useWidth, useHeight))
+ mOriginalSubsamplingScale = scale
}
override fun onTileLoadError(e: Exception?) {
@@ -541,6 +554,29 @@ class PhotoFragment : ViewPagerFragment() {
listener?.fragmentClicked()
}
+ private fun handleEvent(event: MotionEvent) {
+ if (view.subsampling_view.scale != mOriginalSubsamplingScale) {
+ return
+ }
+
+ when (event.actionMasked) {
+ MotionEvent.ACTION_DOWN -> {
+ mTouchDownX = event.x
+ mTouchDownY = event.y
+ }
+ MotionEvent.ACTION_POINTER_DOWN -> mIgnoreCloseDown = true
+ MotionEvent.ACTION_UP -> {
+ val diffX = mTouchDownX - event.x
+ val diffY = mTouchDownY - event.y
+
+ if (!mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold) {
+ activity?.supportFinishAfterTransition()
+ }
+ mIgnoreCloseDown = false
+ }
+ }
+ }
+
override fun fullscreenToggled(isFullscreen: Boolean) {
this.isFullscreen = isFullscreen
view.photo_details.apply {
From 4b7adea7791f1d052cb67a66a53e75d777cdce98 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 16:30:13 +0200
Subject: [PATCH 47/62] enable down gesture at the gif view too
---
.../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 5 +++++
1 file changed, 5 insertions(+)
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 26ae8208e..bc6f251cf 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -107,6 +107,11 @@ class PhotoFragment : ViewPagerFragment() {
}
}
+ gif_view.setOnTouchListener { v, event ->
+ handleEvent(event)
+ false
+ }
+
subsampling_view.setOnTouchListener { v, event ->
handleEvent(event)
false
From 237937c1622e844047097f4e590bb1709d164d67 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 16:41:17 +0200
Subject: [PATCH 48/62] add the close-down gesture to videos too
---
.../gallery/fragments/PhotoFragment.kt | 35 +++----------------
.../gallery/fragments/VideoFragment.kt | 10 ++++++
.../gallery/fragments/ViewPagerFragment.kt | 25 +++++++++++++
3 files changed, 39 insertions(+), 31 deletions(-)
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 bc6f251cf..fab869e88 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -15,7 +15,6 @@ import android.os.Bundle
import android.os.Handler
import android.util.DisplayMetrics
import android.view.LayoutInflater
-import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import com.bumptech.glide.Glide
@@ -74,13 +73,8 @@ class PhotoFragment : ViewPagerFragment() {
private var storedAllowDeepZoomableImages = false
private var storedShowHighestQuality = false
private var storedAllowOneFingerZoom = false
- private var storedExtendedDetails = 0
-
- private var mTouchDownX = 0f
- private var mTouchDownY = 0f
private var mOriginalSubsamplingScale = 0f
- private var mCloseDownThreshold = 100f
- private var mIgnoreCloseDown = false
+ private var storedExtendedDetails = 0
lateinit var view: ViewGroup
lateinit var medium: Medium
@@ -113,7 +107,9 @@ class PhotoFragment : ViewPagerFragment() {
}
subsampling_view.setOnTouchListener { v, event ->
- handleEvent(event)
+ if (view.subsampling_view.scale == mOriginalSubsamplingScale) {
+ handleEvent(event)
+ }
false
}
}
@@ -559,29 +555,6 @@ class PhotoFragment : ViewPagerFragment() {
listener?.fragmentClicked()
}
- private fun handleEvent(event: MotionEvent) {
- if (view.subsampling_view.scale != mOriginalSubsamplingScale) {
- return
- }
-
- when (event.actionMasked) {
- MotionEvent.ACTION_DOWN -> {
- mTouchDownX = event.x
- mTouchDownY = event.y
- }
- MotionEvent.ACTION_POINTER_DOWN -> mIgnoreCloseDown = true
- MotionEvent.ACTION_UP -> {
- val diffX = mTouchDownX - event.x
- val diffY = mTouchDownY - event.y
-
- if (!mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold) {
- activity?.supportFinishAfterTransition()
- }
- mIgnoreCloseDown = false
- }
- }
- }
-
override fun fullscreenToggled(isFullscreen: Boolean) {
this.isFullscreen = isFullscreen
view.photo_details.apply {
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 1edde49d9..606076791 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -86,6 +86,16 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mBrightnessSideScroll = video_brightness_controller
mVolumeSideScroll = video_volume_controller
mCurrTimeView = video_curr_time
+
+ video_preview.setOnTouchListener { v, event ->
+ handleEvent(event)
+ true
+ }
+
+ video_surface.setOnTouchListener { v, event ->
+ handleEvent(event)
+ false
+ }
}
storeStateVariables()
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 bb37b58e2..3a999e10d 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt
@@ -1,5 +1,6 @@
package com.simplemobiletools.gallery.fragments
+import android.view.MotionEvent
import androidx.fragment.app.Fragment
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.OTG_PATH
@@ -11,6 +12,11 @@ import java.io.File
abstract class ViewPagerFragment : Fragment() {
var listener: FragmentListener? = null
+ protected var mTouchDownX = 0f
+ protected var mTouchDownY = 0f
+ protected var mCloseDownThreshold = 100f
+ protected var mIgnoreCloseDown = false
+
abstract fun fullscreenToggled(isFullscreen: Boolean)
interface FragmentListener {
@@ -68,4 +74,23 @@ abstract class ViewPagerFragment : Fragment() {
}
fun getPathToLoad(medium: Medium) = if (medium.path.startsWith(OTG_PATH)) medium.path.getOTGPublicPath(context!!) else medium.path
+
+ protected fun handleEvent(event: MotionEvent) {
+ when (event.actionMasked) {
+ MotionEvent.ACTION_DOWN -> {
+ mTouchDownX = event.x
+ mTouchDownY = event.y
+ }
+ MotionEvent.ACTION_POINTER_DOWN -> mIgnoreCloseDown = true
+ MotionEvent.ACTION_UP -> {
+ val diffX = mTouchDownX - event.x
+ val diffY = mTouchDownY - event.y
+
+ if (!mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold) {
+ activity?.supportFinishAfterTransition()
+ }
+ mIgnoreCloseDown = false
+ }
+ }
+ }
}
From 197dec4a265162594122fce269bd8777c8e3657a Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 16:51:30 +0200
Subject: [PATCH 49/62] toggle fullscreen at clicking video preview too
---
.../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 1 +
1 file changed, 1 insertion(+)
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 606076791..b455a2740 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -77,6 +77,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
video_curr_time.setOnClickListener { skip(false) }
video_duration.setOnClickListener { skip(true) }
video_holder.setOnClickListener { toggleFullscreen() }
+ video_preview.setOnClickListener { toggleFullscreen() }
panorama_outline.setOnClickListener { openPanorama() }
// adding an empty click listener just to avoid ripple animation at toggling fullscreen
From 90d1c521fa5861da87d209bbd0521e5608277a74 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 17:10:31 +0200
Subject: [PATCH 50/62] make Down gesture closing optional, enabled by default
---
.../gallery/activities/SettingsActivity.kt | 9 +++++++
.../gallery/fragments/PhotoFragment.kt | 18 +++++++-------
.../gallery/fragments/VideoFragment.kt | 16 +++++++------
.../gallery/helpers/Config.kt | 4 ++++
.../gallery/helpers/Constants.kt | 1 +
app/src/main/res/layout/activity_settings.xml | 24 +++++++++++++++++++
app/src/main/res/values-ar/strings.xml | 1 +
app/src/main/res/values-az/strings.xml | 1 +
app/src/main/res/values-ca/strings.xml | 1 +
app/src/main/res/values-cs/strings.xml | 1 +
app/src/main/res/values-da/strings.xml | 1 +
app/src/main/res/values-de/strings.xml | 1 +
app/src/main/res/values-el/strings.xml | 1 +
app/src/main/res/values-es/strings.xml | 1 +
app/src/main/res/values-fi/strings.xml | 1 +
app/src/main/res/values-fr/strings.xml | 1 +
app/src/main/res/values-gl/strings.xml | 1 +
app/src/main/res/values-hr/strings.xml | 1 +
app/src/main/res/values-hu/strings.xml | 1 +
app/src/main/res/values-it/strings.xml | 1 +
app/src/main/res/values-ja/strings.xml | 1 +
app/src/main/res/values-ko-rKR/strings.xml | 1 +
app/src/main/res/values-lt/strings.xml | 1 +
app/src/main/res/values-nb/strings.xml | 1 +
app/src/main/res/values-nl/strings.xml | 1 +
app/src/main/res/values-pl/strings.xml | 1 +
app/src/main/res/values-pt-rBR/strings.xml | 1 +
app/src/main/res/values-pt/strings.xml | 1 +
app/src/main/res/values-ru/strings.xml | 1 +
app/src/main/res/values-sk/strings.xml | 3 ++-
app/src/main/res/values-sv/strings.xml | 1 +
app/src/main/res/values-tr/strings.xml | 1 +
app/src/main/res/values-uk/strings.xml | 1 +
app/src/main/res/values-zh-rCN/strings.xml | 1 +
app/src/main/res/values-zh-rTW/strings.xml | 1 +
app/src/main/res/values/strings.xml | 1 +
36 files changed, 88 insertions(+), 16 deletions(-)
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 9adc2cbb7..f58789dd1 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt
@@ -58,6 +58,7 @@ class SettingsActivity : SimpleActivity() {
setupDeleteEmptyFolders()
setupAllowPhotoGestures()
setupAllowVideoGestures()
+ setupAllowDownGesture()
setupBottomActions()
setupShowMediaCount()
setupKeepLastModified()
@@ -302,6 +303,14 @@ class SettingsActivity : SimpleActivity() {
}
}
+ private fun setupAllowDownGesture() {
+ settings_allow_down_gesture.isChecked = config.allowDownGesture
+ settings_allow_down_gesture_holder.setOnClickListener {
+ settings_allow_down_gesture.toggle()
+ config.allowDownGesture = settings_allow_down_gesture.isChecked
+ }
+ }
+
private fun setupShowMediaCount() {
settings_show_media_count.isChecked = config.showMediaCount
settings_show_media_count_holder.setOnClickListener {
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 fab869e88..ed82b721c 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt
@@ -101,16 +101,18 @@ class PhotoFragment : ViewPagerFragment() {
}
}
- gif_view.setOnTouchListener { v, event ->
- handleEvent(event)
- false
- }
-
- subsampling_view.setOnTouchListener { v, event ->
- if (view.subsampling_view.scale == mOriginalSubsamplingScale) {
+ if (context.config.allowDownGesture) {
+ gif_view.setOnTouchListener { v, event ->
handleEvent(event)
+ false
+ }
+
+ subsampling_view.setOnTouchListener { v, event ->
+ if (view.subsampling_view.scale == mOriginalSubsamplingScale) {
+ handleEvent(event)
+ }
+ false
}
- false
}
}
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 b455a2740..ebf15ba00 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -88,14 +88,16 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mVolumeSideScroll = video_volume_controller
mCurrTimeView = video_curr_time
- video_preview.setOnTouchListener { v, event ->
- handleEvent(event)
- true
- }
+ if (context.config.allowDownGesture) {
+ video_preview.setOnTouchListener { v, event ->
+ handleEvent(event)
+ true
+ }
- video_surface.setOnTouchListener { v, event ->
- handleEvent(event)
- false
+ video_surface.setOnTouchListener { v, event ->
+ handleEvent(event)
+ false
+ }
}
}
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 7333a1dd6..40838d5cd 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt
@@ -399,4 +399,8 @@ class Config(context: Context) : BaseConfig(context) {
var showRecycleBinLast: Boolean
get() = prefs.getBoolean(SHOW_RECYCLE_BIN_LAST, false)
set(showRecycleBinLast) = prefs.edit().putBoolean(SHOW_RECYCLE_BIN_LAST, showRecycleBinLast).apply()
+
+ var allowDownGesture: Boolean
+ get() = prefs.getBoolean(ALLOW_DOWN_GESTURE, true)
+ set(allowDownGesture) = prefs.edit().putBoolean(ALLOW_DOWN_GESTURE, allowDownGesture).apply()
}
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 1208b47a8..29c738dfa 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt
@@ -63,6 +63,7 @@ const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images"
const val WAS_SVG_SHOWING_HANDLED = "was_svg_showing_handled"
const val LAST_BIN_CHECK = "last_bin_check"
const val SHOW_HIGHEST_QUALITY = "show_highest_quality"
+const val ALLOW_DOWN_GESTURE = "allow_down_gesture"
// slideshow
const val SLIDESHOW_INTERVAL = "slideshow_interval"
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
index b631f301e..27fd9bd44 100644
--- a/app/src/main/res/layout/activity_settings.xml
+++ b/app/src/main/res/layout/activity_settings.xml
@@ -644,6 +644,30 @@
+
+
+
+
+
+
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
المصغرات
diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml
index 327be5e79..27136947b 100644
--- a/app/src/main/res/values-az/strings.xml
+++ b/app/src/main/res/values-az/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Thumbnails
diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml
index 37eb43858..798c31551 100644
--- a/app/src/main/res/values-ca/strings.xml
+++ b/app/src/main/res/values-ca/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Miniatures
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index 97442b076..3da9d775a 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Thumbnails
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index 8dbe74752..e29321873 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Thumbnails
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index e1fc39111..1339b5dda 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -162,6 +162,7 @@
Stark vergrösserbare Bilder
Zeige Bilder in der höchstmöglichen Qualität
Zeige den Papierkorb als letztes Element auf dem Hauptbildschirm
+ Allow closing the fullscreen view with a down gesture
Thumbnails
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index 6bfd6483f..8dcb0d264 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -162,6 +162,7 @@
Βαθιά μεγέθυνση εικόνων
Εμφάνιση εικόνων με την υψηλότερη δυνατή ποιότητα
Εμφάνιση του Κάδου ως τελευταίο στοιχείο στην κύρια οθόνη
+ Allow closing the fullscreen view with a down gesture
Εικονίδια
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 90057a8cf..c075a4e4d 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Miniaturas
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index 9084aa31a..6d86135e3 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Esikatselukuvat
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 8f99120ed..030bb7c4b 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Vignettes
diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml
index 362c84db6..ef72b9d18 100644
--- a/app/src/main/res/values-gl/strings.xml
+++ b/app/src/main/res/values-gl/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Iconas
diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml
index 69780e427..c6d7d6baa 100644
--- a/app/src/main/res/values-hr/strings.xml
+++ b/app/src/main/res/values-hr/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Sličice
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 7d4198bbc..fd22bfba8 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Thumbnails
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 21cee6961..5483a5f27 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -162,6 +162,7 @@
Immagini ingrandibili a fondo
Mostra le immagini alla massima qualità possibile
Mostra il cestino come ultimo elemento nella schermata principale
+ Allow closing the fullscreen view with a down gesture
Miniature
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 06d7b544a..8ee43c035 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -162,6 +162,7 @@
画像のズームを深くする
可能な限り高品質で画像を表示
ごみ箱をメイン画面の最後に表示
+ Allow closing the fullscreen view with a down gesture
サムネイル設定
diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml
index 3010341ef..ff6a97400 100644
--- a/app/src/main/res/values-ko-rKR/strings.xml
+++ b/app/src/main/res/values-ko-rKR/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
섬네일
diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml
index eb33a9d4b..138b4f17d 100644
--- a/app/src/main/res/values-lt/strings.xml
+++ b/app/src/main/res/values-lt/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Miniatiūros
diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml
index 540ccff27..dbaa4a07f 100644
--- a/app/src/main/res/values-nb/strings.xml
+++ b/app/src/main/res/values-nb/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Minibilder
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 63b22808e..46790ef4a 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -162,6 +162,7 @@
Afbeeldingen ver inzoomen
Afbeeldingen in de hoogst mogelijke kwaliteit weergeven
Prullenbak als laatste item tonen
+ Allow closing the fullscreen view with a down gesture
Miniatuurvoorbeelden
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index eeaf4a66f..c64473509 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Miniatury
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 1e51da9ad..51aa5c2f7 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Miniaturas
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index fd59f697f..088dd1885 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Mostrar fotos com a melhor qualidade possível
Mostrar a reciclagem como o último item do ecrã principal
+ Allow closing the fullscreen view with a down gesture
Miniaturas
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 2eb9e31ff..7b7cba427 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -162,6 +162,7 @@
Масштабируемые изображения
Показывать изображения с максимально высоким качеством
Показывать корзину как последний элемент на главном экране
+ Allow closing the fullscreen view with a down gesture
Миниатюры
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index 4c0a92e53..f4cbde3f0 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -146,7 +146,7 @@
Prehliadať miniatúry vodorovne
Automaticky skrývať systémové lišty pri celoobrazovkových médiách
Odstrániť prázdne priečinky po vymazaní ich obsahu
- Allow controlling photo brightness with vertical gestures
+ Povoliť ovládanie jasu vertikálnymi ťahmi
Povoliť ovládanie hlasitosti a jasu videí vertikálnymi ťahmi
Zobraziť počet médií v priečinku na hlavnej obrazovke
Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu
@@ -162,6 +162,7 @@
Hlboko priblížiteľné obrázky
Zobrazovať obrázky v najlepšej možnej kvalite
Zobraziť odpadkový kôš ako poslednú položku na hlavnej obrazovke
+ Povoliť zatváranie celoobrazovkového režimu potiahnutím prsta dole
Náhľady
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index a5ee7bd35..0eeff1265 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Miniatyrer
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 783118413..765c5f261 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Thumbnails
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index e13e793ac..049d23054 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -162,6 +162,7 @@
Глибокомасштабовані зображення
Показувати зображення в найвищій можливій якості
Показувати \"Кошик\" останнім елементом на головному екрані
+ Allow closing the fullscreen view with a down gesture
Ескізи
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index b7a446090..0e5981b3a 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -162,6 +162,7 @@
深度放大图像
以最高质量显示图像
在主屏幕界面的最后一项显示回收站
+ Allow closing the fullscreen view with a down gesture
缩略图
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 9d2a97151..c2b62bb11 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -162,6 +162,7 @@
可深度縮放的圖片
以最高品質顯示圖片
回收桶顯示在主畫面最後一項
+ Allow closing the fullscreen view with a down gesture
縮圖
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 922d1cc58..24264a8ba 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -162,6 +162,7 @@
Deep zoomable images
Show images in the highest possible quality
Show the Recycle Bin as the last item on the main screen
+ Allow closing the fullscreen view with a down gesture
Thumbnails
From 20ca9da9d0845a772c59ecbbce3262e6bca1a210 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 17:18:40 +0200
Subject: [PATCH 51/62] do not consume touch events at video_preview
---
.../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 ebf15ba00..b4a09d681 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt
@@ -91,7 +91,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
if (context.config.allowDownGesture) {
video_preview.setOnTouchListener { v, event ->
handleEvent(event)
- true
+ false
}
video_surface.setOnTouchListener { v, event ->
From b2b458b26ea6190c0047e17c68bb720b583de2fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Solatec=20Inform=C3=A0tica?=
<35220662+Solatec@users.noreply.github.com>
Date: Mon, 22 Oct 2018 17:36:39 +0200
Subject: [PATCH 52/62] Update strings.xml
---
app/src/main/res/values-ca/strings.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml
index 798c31551..07c2011a0 100644
--- a/app/src/main/res/values-ca/strings.xml
+++ b/app/src/main/res/values-ca/strings.xml
@@ -159,10 +159,10 @@
Fer una verificació addicional per evitar que es mostrin fitxers no vàlids
Mostra alguns botons d\'acció a la part inferior de la pantalla
Mostra la paperera de reciclatge a la pantalla de carpetes
- Deep zoomable images
- Show images in the highest possible quality
- Show the Recycle Bin as the last item on the main screen
- Allow closing the fullscreen view with a down gesture
+ Imatges ampliades a mida
+ Mostra imatges amb la màxima qualitat possible
+ Mostra la paperera de reciclatge com a últim element a la pantalla principal
+ Permet tancar la vista de pantalla completa amb un gest avall
Miniatures
From 77ec40115675fa22d7a3c7c6aca9c80babdbb3ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Solatec=20Inform=C3=A0tica?=
<35220662+Solatec@users.noreply.github.com>
Date: Mon, 22 Oct 2018 17:42:53 +0200
Subject: [PATCH 53/62] Update strings.xml
---
app/src/main/res/values-es/strings.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index c075a4e4d..b47f2264e 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -159,10 +159,10 @@
Hacer una comprobación adicional para evitar mostrar archivos inválidos
Mostrar algunos botones de acción en la parte inferior de la pantalla
Mostrar la papelera de reciclaje en la pantalla de carpetas
- Deep zoomable images
- Show images in the highest possible quality
- Show the Recycle Bin as the last item on the main screen
- Allow closing the fullscreen view with a down gesture
+ Imágenes ampliables con zoom
+ Muestra imágenes con la mayor calidad posible
+ Mostrar la Papelera de reciclaje como el último elemento en la pantalla principal
+ Permite cerrar la vista de pantalla completa con un gesto hacia abajo.
Miniaturas
From 7c12bb18e20079430866db59b8fdfc35b08ca47e Mon Sep 17 00:00:00 2001
From: KowalskiOmniROM
Date: Mon, 22 Oct 2018 18:44:19 +0200
Subject: [PATCH 54/62] Update strings.xml
---
app/src/main/res/values-fr/strings.xml | 214 +++++++++++++------------
1 file changed, 108 insertions(+), 106 deletions(-)
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 030bb7c4b..a0faec73c 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -1,22 +1,22 @@
- Simple Galerie
+ Simple Gallery
Galerie
Édition
- Ouvrir appareil photo
- (caché)
+ Démarrer l\'appareil photo
+ (masqué)
(exclu)
Épingler le dossier
Désépingler le dossier
Épingler en haut
Afficher le contenu de tous les dossiers
Tous les dossiers
- Permuter vers la vue du dossier
+ Affichage en vue \"Dossier\"
Autre dossier
Afficher sur la carte
Position inconnue
- Augmenter le nombre de colonnes
- Réduire le nombre de colonnes
+ Ajouter une colonne
+ Supprimer une colonne
Changer l\'image de couverture
Sélectionner une photo
Utiliser par défaut
@@ -24,198 +24,200 @@
Luminosité
Verrouiller la rotation
Déverrouiller la rotation
- Change orientation
- Force portrait
- Paysage de force
+ Orientation
+ Forcer la vue portrait
+ Forcer la vue paysage
Utiliser l\'orientation par défaut
- Fixe Date Valeur prise
- Fixation....
- Dates fixées avec succès
+ Corriger la valeur des dates de prise des photos
+ Correction en cours....
+ Dates corrigées
Filtrer les médias
Images
Vidéos
- GIF
- RAW images
+ GIFs
+ Images RAW
SVGs
- Aucun fichier média trouvé avec les filtres sélectionnés.
- Changer les filtres
+ Aucun fichier média trouvé avec les filtres sélectionnés
+ Modifier les filtres
- Cette option masque le dossier en ajoutant un fichier \'.nomedia\' à l\'intérieur, cela masquera aussi tous les sous-dossiers. Vous pouvez les voir en modifiant l\'option \'Afficher les dossiers cachés\' dans les paramètres. Continuer ?
+ Cette option masque le dossier en ajoutant un fichier \".nomedia\" à l\'intérieur, cela masquera aussi tous les sous-dossiers. Vous pouvez les voir en appuyant sur le symbole \"Œil\" (permettant l\'affichage) depuis les paramètres. Continuer ?
Exclure
Dossiers exclus
Gérer les dossiers exclus
- Cela va exclure la sélection ainsi que ses sous-dossiers depuis Simple Galerie uniquement. Vous pouvez gérer les dossiers exclus depuis les paramètres.
+ Cela va exclure la sélection ainsi que ses sous-dossiers depuis Simple Gallery uniquement. Vous pouvez gérer les dossiers exclus depuis les paramètres.
Exclure un dossier parent ?
- Exclure des dossiers les masquera ainsi que leurs sous-dossiers uniquement dans Simple Galerie, ils seront toujours visibles depuis d\'autres applications.\\Si vous voulez aussi les masquer ailleurs, utilisez la fonction Masquer.
+ Exclure des dossiers les masquera ainsi que leurs sous-dossiers uniquement dans Simple Gallery, ils seront toujours visibles depuis d\'autres applications.\n\nSi vous voulez aussi les masquer ailleurs, utilisez la fonction \"Masquer\".
Tout supprimer
- Supprimer tous les dossiers de la liste des exclusions ? Ceci n\'effacera pas les dossiers.
+ Supprimer tous les dossiers de la liste des exclusions ? Cela n\'effacera pas les dossiers.
Dossiers masqués
Gérer les dossiers masqués
- Il semblerait que vous n\'ayez pas de dossier cachés avec un fichier \".nomedia\".
+ Il semblerait que vous n\'ayez pas de dossier masqués avec un fichier \".nomedia\".
- Dossiers inclus
- Gérer les dossiers inclus
+ Dossiers ajoutés
+ Gérer les dossiers ajoutés
Ajouter un dossier
- Si vous avez des dossiers contenant des médias et qu\'ils ne sont pas reconnus par l\'application, vous pouvez les ajouter manuellement ici.
+ Si vous avez des dossiers contenant des médias qui ne sont pas affichés dans l\'application, vous pouvez les ajouter manuellement ici.\n\nCet ajout n\'exclura aucun autre dossier.
Redimensionner
Redimensionner la sélection et enregistrer
Largeur
Hauteur
- Garder le ratio
+ Conserver le rapport d\'affichage
Veuillez entrer une résolution valide
Éditeur
Sauvegarder
- Tourner
+ Pivoter
Chemin
Chemin invalide
Échec de l\'édition de l\'image
- Éditer l\'image avec :
+ Modifier l\'image avec :
Aucun éditeur d\'image trouvé
- Emplacement du fichier inconnu.
- Ne parvient pas à réécrire par dessus le fichier source
+ Emplacement du fichier inconnu
+ Impossible de remplacer le fichier source
Pivoter à gauche
Pivoter à droite
Pivoter à 180º
Retourner
Retourner horizontalement
Retourner verticalement
- Éditer avec
- Gratuit
+ Modifier avec
+ Libre
- Simple fond d\'écran
+ Fond d\'écran simple
Définir comme fond d\'écran
- Échec de la définition en tant que fond d\'écran.
+ Échec de la définition en tant que fond d\'écran
Définir comme fond d\'écran avec :
- Paramètres de fond d\'écran…
- Fond d\'écran défini avec succès
- Ratio d\'aspect portrait
- Ratio d\'aspect paysage
- Page d\'accueil
- Écran de verrouillage
- Page d\'accueil et écran de verrouillage
+ Définition du fond d\'écran en cours…
+ Fond d\'écran défini
+ Rapport d\'affichage portrait
+ Rapport d\'affichage paysage
+ Écran d\'accueil
+ Écran de déverrouillage
+ Écran d\'accueil et écran de déverrouillage
Diaporama
Intervalle (secondes) :
Inclure photos
Inclure vidéos
- Inclure GIF
+ Inclure GIFs
Ordre aléatoire
Utiliser un fondu
- Revenir en arrière
+ Défilement inverse
Diaporama en boucle
Diaporama terminé
Aucun média trouvé pour le diaporama
- Changer le type de vue
+ Changer de mode d\'affichage
Grille
Liste
Sous-dossiers de groupe direct
Grouper par
- Ne pas regrouper les fichiers
+ Ne pas grouper les fichiers
Dossier
- Dernière modification
- Date de prise
+ Date de modification
+ Date de prise de vue
Type de fichier
Extension
+ Définir pour ce dossier uniquement
Lecture automatique des vidéos
Permuter la visibilité des noms de fichier
- Lire en boucle les vidéos
- GIF animés sur les miniatures
- Luminosité maximale lors de l\'affichage de media
- Rogner les miniatures en carrés
- Pivoter les medias plein écran selon
+ Lecture en boucle des vidéos
+ GIFs animés sur les miniatures
+ Luminosité maximale
+ Recadrer les miniatures en carrés
+ Pivoter l\'affichage selon
Paramètres système
Rotation de l\'appareil
- Ratio d\'aspect
- Fond et barre de statut noir en plein écran
+ Rapport d\'affichage
+ Arrière-plan et barre d\'état noirs
Défilement des miniatures horizontalement
- Masquer automatiquement l\'interface utilisateur si média en plein écran
+ Masquer automatiquement l\'interface utilisateur
Supprimer les dossiers vides après avoir supprimé leur contenu
- Permettre le contrôle de la luminosité de la photo avec des gestes verticaux.
- Permettre le contrôle du volume vidéo et de la luminosité avec des gestes verticaux
- Afficher le nombre de fichiers dans les dossiers sur l\'écran principal
- Remplacer Partager par Pivoter si menu en plein écran
- Afficher les détails supplémentaires par dessus le média en plein écran
- Gérer les détails supplémentaires
- Autoriser le zoom avec un doigt sur un média en plein écran
- Autoriser le changement instantané de média en cliquant sur les côtés de l\'écran
- Permet de zoomer en profondeur
- Masquer les détails supplémentaires lorsque la barre d\'état est masquée
- Faire une vérification supplémentaire pour éviter de montrer des fichiers invalides
- Afficher quelques boutons d\'action en bas de l\'écran
- Afficher la corbeille à l\'écran Dossiers
- Deep zoomable images
- Show images in the highest possible quality
- Show the Recycle Bin as the last item on the main screen
- Allow closing the fullscreen view with a down gesture
+ Contrôler la luminosité de la photo avec des gestes verticaux
+ Contrôler le volume et la luminosité de la vidéo avec des gestes verticaux
+ Afficher le nombre de fichiers dans les dossiers
+ Remplacer \"Partager\" par \"Pivoter\" en plein écran
+ Afficher en surimpression les informations supplémentaires du média en plein écran
+ Gérer les informations supplémentaires
+ Effectuer le zoom avec un doigt sur une image en plein écran
+ Changement instantané de média en appuyant sur les côtés de l\'écran
+ Utiliser le zoom maximal des images
+ Ne pas afficher les informations supplémentaires si la barre d\'état est masquée
+ Éviter l\'affichage de fichiers non conformes
+ Afficher les éléments masqués
+ Afficher les boutons d\'action
+ Afficher la corbeille en vue \"Dossier\"
+ Niveau de zoom maximal des images
+ Afficher les images avec la meilleur qualité possible
+ Afficher la corbeille en dernière place sur l\'écran principal
+ Fermeture de la vue plein écran par un geste vers le bas
- Vignettes
- Média plein écran
+ Miniatures
+ Affichage en plein écran
Détails supplémentaires
- Actions en bas
+ Menu d\'actions sur la bas de l\'écran
- Gérer les actions visible du bas
- Basculer favori
+ Gérer le menu d\'actions
+ Ajouter aux favoris
Changer la visibilité des fichiers
- Comment faire de Simple Galerie ma galerie par défaut ?
- Il faut dans un premier temps trouver la galerie par défaut dans la section « Applications » des paramètres du téléphone, puis toucher « Ouvrir par défaut » et enfin selectionner « Réinitialiser les paramètres par défaut ». La prochaine fois que vous ouvrirez une image ou une vidéo, il vous sera proposé de choisir une application, choisissez Simple Gallery puis « Toujours ».
- J\'ai verrouillé l\'appli avec un mot de passe et je ne m\'en rappelle plus. Que faire ?
- Il y a deux façons de procéder. Soit vous reinstallez l\'appli, soit retrouver l\'appli dans les paramètres du téléphone et toucher « Effacer les données ». Cela va seulement remettre à zéro les paramètres de l\'appli et ne supprimera pas vos fichiers.
- Comment faire pour qu\'un album soit toujours tout en haut ?
- Vous avez juste à faire un appui long sur l\'album en question et choisir l\'icône « Epingler » dans le menu d\'actions. Vous pouvez en épingler plusieurs, les éléments épinglés seront alors triés dans l\'ordre par défaut.
+ Comment faire de Simple Gallery ma galerie par défaut ?
+ Il faut dans un premier temps, trouver l\'application \"galerie\" par défaut dans la section \"Applications\" des paramètres de l\'appareil, puis appuyer sur \"Ouvrir par défaut\", et enfin sélectionner \"Réinitialiser les paramètres par défaut\". La prochaine fois que vous ouvrirez une image ou une vidéo, il vous sera proposé de choisir une application, choisissez \"Simple Gallery\" puis \"Toujours\".
+ J\'ai verrouillé l\'application avec un mot de passe et je ne m\'en rappelle plus. Que faire ?
+ Il y a deux façons de procéder. Soit vous réinstallez l\'application, soit vous recherchez l\'application dans les paramètres de l\'appareil et appuyez sur \"Effacer les données\". Cela va seulement réinitialiser les paramètres de l\'application et ne supprimera pas vos fichiers.
+ Comment faire pour qu\'un album soit toujours affiché tout en haut ?
+ Vous devez simplement à effectuer un appui prolongé sur l\'album en question et choisir l\'icône \"Épingler\" dans le menu d\'actions. Vous pouvez en épingler plusieurs. Les éléments épinglés seront alors triés selon l\'ordre par défaut.
Comment avancer rapidement dans les vidéos ?
- Vous pouvez appuyer sur le temps actuel ou la durée totale de la vidéo sur la barre de progression, la vidéo reculera ou avancera selon votre choix.
- Quelle est la différence entre cacher et exclure un répertoire ?
- Exclure n\'affiche pas le dossier dans Simple Galerie uniquement, alors que Cacher le cache pour l\'intégralité du système, y compris les autres galeries. Dans le dernier cas, un fichier \".nomedia\" est créé dans le répertoire caché, et peut s\'enlever avec n\'importe quel explorateur de fichiers.
- Pourquoi des répertoires avec des pochettes d\'albums musicaux ou des miniatures d\'images sont affichés ?
- Cela peut arriver de voir des albums qui ne devraient pas être affichés. Vous pouvez les exclure facilement en faisaint un appui long sur eux puis en sélectionnant « Exclure », après quoi vous pouvez aussi sélectionner le répertoire parent, ce qui devrait éviter l\'apparition d\'albums similaires.
+ Vous pouvez appuyer sur la durée actuelle ou totale de la vidéo sur la barre de progression, la vidéo reculera ou avancera selon votre choix.
+ Quelle est la différence entre masquer et exclure un dossier ?
+ \"Exclure un dossier\" permet de ne pas l\'afficher uniquement dans Simple Gallery, alors que \"Masquer un dossier\" rend le dossier invisible sur l\'ensemble de l\'appareil, y compris les autres applications de galerie. Dans le dernier cas, un fichier \".nomedia\" est créé dans le dossier masqué, et peut être supprimé avec n\'importe quel explorateur de fichiers.
+ Pourquoi des dossiers avec des pochettes d\'albums musicaux ou des miniatures d\'images sont affichés ?
+ Il est possible que des albums qui ne devraient pas être affichés le soient. Vous pouvez les exclure facilement en les sélectionnant par un appui prolongé, puis en choisissant l\'option \"Exclure\", après quoi vous pouvez aussi sélectionner le dossier parent, ce qui devrait éviter l\'apparition d\'albums similaires.
Un dossier avec des images n\'apparaît pas. Que faire ?
- Cela peut arriver pour de multiples raisons, mais c\'est facile à résoudre. Allez dans « Paramètres » puis « Gérer les dossiers inclus », sélectionnez le plus et sélectionnez le dossier voulu.
+ Cela peut arriver pour de multiples raisons, mais c\'est facile à résoudre. Allez dans \"Paramètres\", puis \"Gérer les dossiers inclus\", appuyez sur \"+\" et sélectionnez le dossier voulu.
Comment faire apparaître uniquement certains dossiers ?
- Ajouter un répértoire dans les dossiers inclus n\'exclut rien automatiquement. Pour ce faire, il faut aller dans « Paramètres » puis « Gérer les dossiers exclus », exclure le répertoire racine \"/\", puis ajouter les répertoires souhaités dans « Paramètres » puis « Gérer les répertoires inclus ». Seuls les répertoires selectionnés seront visibles, du fait que les exclusions et inclusions sont récursives, et si un répertoire est à la fois exclus et inclus, il sera affiché.
- Les images en plein écran contiennent des artéfacts, est-ce possible d\'améliorer la qualité ?
- Oui, il existe dans « Paramètres » une option « Remplacer les images zoomables profondes par des images de meilleure qualité », mais les images seront alors floues si vous zoomez trop.
- Puis-je recadrer des images avec cette application?
- Oui, vous pouvez recadrer les images dans l\'éditeur en faisant glisser les coins de l\'image. Vous pouvez accéder à l\'éditeur en appuyant longuement sur une vignette d\'image et en sélectionnant Modifier, ou en sélectionnant Modifier en mode plein écran.
- Puis-je en quelque sorte regrouper les vignettes des fichiers multimédias ?
- Bien sûr, il vous suffit d\'utiliser l\'option de menu \"Grouper par\" lorsque vous êtes dans l\'affichage des vignettes. Vous pouvez regrouper les fichiers selon plusieurs critères, y compris la date de prise de vue. Si vous utilisez la fonction \"Afficher le contenu de tous les dossiers\", vous pouvez également les regrouper par dossiers.
- Le tri par date prise ne semble pas fonctionner correctement, comment puis-je le corriger ?
- Il est très probablement causé par les fichiers copiés quelque part. Vous pouvez le corriger en sélectionnant les vignettes du fichier et en sélectionnant \"Fix Date Taken value\".
- I see some color banding on the images. How can I improve the quality?
- The current solution for displaying images works fine in the vast majority of cases, but if you want even better image quality, you can enable the \"Show images in the highest possible quality\" at the app settings, in the \"Deep zoomable images\" section.
- I have hidden a file/folder. How can I unhide it?
- You can either press the \"Temporarily show hidden items\" menu item at the main screen, or toggle \"Show hidden items\" in the app settings to see the hidden item. If you want to unhide it, just long press it and select \"Unhide\". Folders are hidden by adding a hidden \".nomedia\" file into them, you can delete the file with any file manager too.
+ Ajouter un dossier dans les \"Dossiers inclus\" rend visible l\'ensemble du contenu du dossier. Pour exclure certains dossiers, il faut aller dans \"Paramètres\", puis \"Gérer les dossiers exclus\", exclure le dossier racine \"/\", puis ajouter les dossiers souhaités dans \"Paramètres\", puis \"Gérer les dossiers inclus\". Seuls les dossiers sélectionnés seront visibles, du fait que les exclusions et inclusions sont récursives, et si un dossier est à la fois exclus et inclus, il sera affiché.
+ Les images en plein écran contiennent des artefacts, est-ce possible d\'améliorer la qualité ?
+ Oui, il existe dans \"Paramètres\" une option \"Afficher les images avec la plus haute qualité possible\", mais les images seront alors floues si vous zoomez trop.
+ Puis-je recadrer des images avec cette application ?
+ Oui, vous pouvez recadrer les images dans l\'éditeur en faisant glisser les coins de l\'image. Vous pouvez accéder à l\'éditeur en appuyant longuement sur une vignette d\'image et en sélectionnant \"Modifier\", ou en sélectionnant \"Modifier\" en mode plein écran.
+ Puis-je regrouper les miniatures des fichiers multimédias ?
+ Bien sûr, il vous suffit d\'utiliser l\'option de menu \"Grouper par\" lorsque vous êtes dans l\'affichage des miniatures. Vous pouvez regrouper les fichiers selon plusieurs critères, y compris la date de prise de vue. Si vous utilisez la fonction \"Afficher le contenu de tous les dossiers\", vous pouvez également les regrouper par dossier.
+ Le tri par date de prise de vue ne semble pas fonctionner correctement, comment puis-je le corriger ?
+ Il est très probablement causé par les fichiers copiés quelque part. Vous pouvez le corriger en sélectionnant les miniatures du fichier et en sélectionnant \"Corriger la valeur des dates de prise des photos\".
+ Je vois des bandes de couleurs sur les images. Comment puis-je améliorer la qualité ?
+ La solution actuelle d\'affichage des images fonctionne bien dans la grande majorité des cas, mais si vous voulez une qualité d\'image encore meilleure, vous pouvez activer l\'option \"Afficher les images avec la plus haute qualité possible\" dans la section \"Niveau de zoom maximal des images\" des paramètres de l\'application.
+ J\'ai masqué un fichier ou un dossier. Comment puis-je en rétablir l\'affichage ?
+ Vous pouvez soit appuyer sur l\'option \"Afficher les fichiers masqués\" du menu de l\'écran principal, ou appuyer sur le bouton \"Afficher les éléments masqués\" dans les paramètres de l\'application. Si vous voulez rétablir leur affichage, effectuez un appui prolongé dessus et appuyez sur le symbole \"Œil\" permettant l\'affichage. Les dossiers sont masqués en ajoutant un fichier \".nomedia\" à leur racine, vous pouvez également supprimer ce fichier avec n\’importe quel explorateur de fichiers.
- Un album pour visionner photos et vidéos sans publicité.
+ Une galerie pour visionner photos et vidéos sans publicité.
- Un simple outil pour visionner les photos et les vidéos. Elles peuvent être triées par dates, tailles, noms dans les deux sens (alphabétique comme désalphabétique), il est possible de zoomer sur les photos. Les fichiers sont affichés sur de multiples colonnes en fonction de la taille de l\'écran, vous pouvez changer le nombre de colonnes par pincement. Elles peuvent être renommées, partagées, supprimées, copiées et déplacées. Les images peuvent en plus être tournées, rognées ou être définies comme fond d\'écran directement depuis l\'application.
+ Un outil simple pour visionner les photos et les vidéos. Elles peuvent être triées par dates, dimensions, noms dans les deux ordres (alphabétique ou alphabétique inversé), il est possible de zoomer sur les photos. Les fichiers sont affichés sur de multiples colonnes en fonction de la dimension de l\'écran, vous pouvez changer le nombre de colonnes par pincement. Elles peuvent être renommées, partagées, supprimées, copiées et déplacées. Les images peuvent en plus être pivotées, rognées ou être définies comme fond d\'écran directement depuis l\'application.
- La galerie est également proposée pour une utilisation comme tierce partie pour la prévisualisation des images/vidéos, ajouter des pièces jointes aux clients email, etc… C\'est parfait pour un usage au quotidien.
+ La galerie est également proposée pour une utilisation comme tierce partie pour la prévisualisation des images/vidéos, ajouter des pièces jointes aux clients de courriel, etc… C\'est parfait pour un usage au quotidien.
- L\'autorisation d\'empreinte digitale est nécessaire pour verrouiller les dossiers cachés et/ou l\'application.
+ L\'autorisation d\'empreinte digitale est nécessaire pour verrouiller les dossiers masqués et/ou l\'application.
- L\'application ne contient ni publicité ni autorisation inutile. Elle est totalement opensource et est également fournie avec des couleurs personnalisables.
+ L\'application ne contient ni publicité, ni autorisation inutile. Elle est totalement opensource et est également fournie avec des couleurs personnalisables.
Cette application fait partie d\'une plus grande suite. Vous pouvez trouver les autres applications sur https://www.simplemobiletools.com
From fe4c8dc3a3d7aba0cf547325ab1d1e0cb5360fc2 Mon Sep 17 00:00:00 2001
From: gregory678
Date: Mon, 22 Oct 2018 20:12:34 +0200
Subject: [PATCH 55/62] Polish translation update [2018.10.22]
---
app/src/main/res/values-pl/strings.xml | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index c64473509..3cbb219cb 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -38,7 +38,7 @@
Filmy
GIFy
Obrazy RAW
- SVGs
+ Obrazy SVG
Nie znalazłem multimediów z wybranymi filtrami.
Zmień filtry
@@ -159,10 +159,10 @@
Dodatkowe sprawdzenie w celu uniknięcia pokazywania niewłaściwych plików
Pokazuj niektóre przyciski akcji na dole ekranu
Pokazuj kosz w widoku folderów
- Deep zoomable images
- Show images in the highest possible quality
- Show the Recycle Bin as the last item on the main screen
- Allow closing the fullscreen view with a down gesture
+ Duże powiększanie obrazów
+ Pokazuj obrazy w najwyższej możliwej rozdzielczości
+ Pokazuj kosz jako ostatni element na głównym ekranie
+ Zezwalaj na zamykanie pełnoekranowego widoku gestem pociągnięcia w dół
Miniatury
@@ -200,10 +200,10 @@
Tak. Użyj opcji \'Grupuj według\', gdy jesteś w widoku miniatur. Grupować je możesz według wielu kryteriów, włącznie z datą ich utworzenia. Ponadto, jeśli użyjesz opcji \'Pokazuj całą zawartość folderów\', możesz je także grupować według folderów.
Sortowanie według daty utworzenia nie działa poprawnie. Dlaczego tak się dzieje i jak mogę to naprawić?
Dzieje się tak, gdyż prawdopodobnie pliki zostały skądś do urządzenia skopiowane. Naprawić to można wybierając miniatury plików, a następnie opcję \'Napraw datę utworzenia\'.
- I see some color banding on the images. How can I improve the quality?
- The current solution for displaying images works fine in the vast majority of cases, but if you want even better image quality, you can enable the \"Show images in the highest possible quality\" at the app settings, in the \"Deep zoomable images\" section.
- I have hidden a file/folder. How can I unhide it?
- You can either press the \"Temporarily show hidden items\" menu item at the main screen, or toggle \"Show hidden items\" in the app settings to see the hidden item. If you want to unhide it, just long press it and select \"Unhide\". Folders are hidden by adding a hidden \".nomedia\" file into them, you can delete the file with any file manager too.
+ Na obrazach widzę wyraźne zmiany w kolorach. Jak mogę to naprawić?
+ Obecne rozwiązanie służące wyświetlaniu obrazów działa jak powinno w większości w przypadków. Jeśli jednak tak nie jest, pomocna może okazać się opcja \"Pokazuj obrazy w najwyższej możliwej jakości\" w sekcji \"Duże powiększanie obrazów\".
+ Mam ukryte pliki i / lub foldery. Jak mogę zobaczyć?
+ Możesz to zrobić albo wybierając opcję \"Tymczasowo pokaż ukryte multimedia\" w menu na ekranie głównym, lub \"Pokazuj ukryte elementy\" w ustawieniach. Foldery są ukrywane poprzez dodanie do nich pustego, ukrytego pliku \".nomedia\", usunąć go możesz dowolnym menedżerem plików.
From bbd655b6249193ec65e8041d8d344feed2be0081 Mon Sep 17 00:00:00 2001
From: sawka6630
Date: Mon, 22 Oct 2018 21:28:22 +0300
Subject: [PATCH 56/62] Translation of string No.165
---
app/src/main/res/values-uk/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 049d23054..5bf73200e 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -162,7 +162,7 @@
Глибокомасштабовані зображення
Показувати зображення в найвищій можливій якості
Показувати \"Кошик\" останнім елементом на головному екрані
- Allow closing the fullscreen view with a down gesture
+ Дозволити закриття повноекранного перегляду свайпом згори вниз
Ескізи
From e54953f38017d23db4b482f95da481036b6fc11e Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 21:14:38 +0200
Subject: [PATCH 57/62] try excluding unwanted folders at first app launches
---
.../gallery/activities/MainActivity.kt | 77 +++++++++++++++++++
1 file changed, 77 insertions(+)
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 02603f098..de25bfda5 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -901,6 +901,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
config.everShownFolders = HashSet()
}
mDirs = dirs.clone() as ArrayList
+
+ if (config.appRunCount < 5 && mDirs.size > 100) {
+ excludeSpamFolders()
+ }
}
private fun checkPlaceholderVisibility(dirs: ArrayList) {
@@ -1081,6 +1085,79 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
}
+ // exclude probably unwanted folders, for example facebook stickers are split between hundreds of separate folders like
+ // /storage/emulated/0/Android/data/com.facebook.orca/files/stickers/175139712676531/209575122566323
+ // /storage/emulated/0/Android/data/com.facebook.orca/files/stickers/497837993632037/499671223448714
+ private fun excludeSpamFolders() {
+ Thread {
+ try {
+ val internalPath = config.internalStoragePath
+ val sdPath = config.sdCardPath
+ val pathParts = ArrayList>()
+ mDirs.asSequence().map { it.path.removePrefix(internalPath).removePrefix(sdPath) }.sorted().toList().forEach {
+ val parts = it.split("/").asSequence().filter { it.isNotEmpty() }.toMutableList() as ArrayList
+ if (parts.size > 3) {
+ pathParts.add(parts)
+ }
+ }
+
+ val keys = getLongestCommonStrings(pathParts)
+ pathParts.clear()
+ keys.forEach { it ->
+ val parts = it.split("/").asSequence().filter { it.isNotEmpty() }.toMutableList() as ArrayList
+ pathParts.add(parts)
+ }
+
+ getLongestCommonStrings(pathParts).forEach {
+ var file = File("$internalPath/$it")
+ if (file.exists()) {
+ config.addExcludedFolder(file.absolutePath)
+ } else {
+ file = File("$sdPath/$it")
+ if (file.exists()) {
+ config.addExcludedFolder(file.absolutePath)
+ }
+ }
+ }
+ } catch (e: Exception) {
+ }
+ }.start()
+ }
+
+ private fun getLongestCommonStrings(pathParts: ArrayList>): ArrayList {
+ val commonStrings = ArrayList()
+ return try {
+ val cnt = pathParts.size
+ for (i in 0..cnt) {
+ var longestCommonString = ""
+ for (j in i..cnt) {
+ var currentCommonString = ""
+ if (i != j) {
+ val originalParts = pathParts.getOrNull(i)
+ val otherParts = pathParts.getOrNull(j)
+ if (originalParts != null && otherParts != null) {
+ originalParts.forEachIndexed { index, string ->
+ if (string == otherParts.getOrNull(index)) {
+ currentCommonString += "$string/"
+ if (currentCommonString.length > longestCommonString.length) {
+ longestCommonString = currentCommonString.trimEnd('/')
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (longestCommonString.isNotEmpty()) {
+ commonStrings.add(longestCommonString)
+ }
+ }
+ commonStrings.groupingBy { it }.eachCount().filter { it.value > 5 && it.key.length > 10 }.map { it.key }.toMutableList() as ArrayList
+ } catch (e: Exception) {
+ ArrayList()
+ }
+ }
+
override fun refreshItems() {
getDirectories()
}
From 9221c445331bfe0bc2a7adbdfd23d826c60e7274 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Mon, 22 Oct 2018 21:53:27 +0200
Subject: [PATCH 58/62] update commons to 5.1.17
---
app/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/build.gradle b/app/build.gradle
index 7fbdd5d2f..1b515a113 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.15'
+ implementation 'com.simplemobiletools:commons:5.1.17'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
From 47636f8b0afc3300c33ed860ee6f7d302ef6a61f Mon Sep 17 00:00:00 2001
From: tibbi
Date: Tue, 23 Oct 2018 10:50:51 +0200
Subject: [PATCH 59/62] fix Favorite items getting removed at emptying the
recycle bin
---
.../com/simplemobiletools/gallery/interfaces/MediumDao.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt
index ab8f76c48..5a02476b0 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/MediumDao.kt
@@ -33,7 +33,7 @@ interface MediumDao {
@Query("DELETE FROM media WHERE full_path = :path COLLATE NOCASE")
fun deleteMediumPath(path: String)
- @Query("DELETE FROM media WHERE deleted_ts < :timestmap")
+ @Query("DELETE FROM media WHERE deleted_ts < :timestmap AND deleted_ts != 0")
fun deleteOldRecycleBinItems(timestmap: Long)
@Query("UPDATE OR REPLACE media SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath COLLATE NOCASE")
From 2a412308d0825e49329c79c0ff1718eabd5baad9 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Tue, 23 Oct 2018 11:10:48 +0200
Subject: [PATCH 60/62] update commons to 5.2.0
---
app/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/build.gradle b/app/build.gradle
index 1b515a113..2f21cf99c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,7 @@ android {
}
dependencies {
- implementation 'com.simplemobiletools:commons:5.1.17'
+ implementation 'com.simplemobiletools:commons:5.2.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
From a08b859178e7f64a6517fbc3875af97740303554 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Tue, 23 Oct 2018 11:10:54 +0200
Subject: [PATCH 61/62] update version to 5.1.0
---
app/build.gradle | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 2f21cf99c..cfa9e8587 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,8 +11,8 @@ android {
applicationId "com.simplemobiletools.gallery"
minSdkVersion 21
targetSdkVersion 28
- versionCode 203
- versionName "5.0.1"
+ versionCode 204
+ versionName "5.1.0"
multiDexEnabled true
setProperty("archivesBaseName", "gallery")
}
From 0ecd7c3e8c7a4ec1c6f9929e891cb336049c86e4 Mon Sep 17 00:00:00 2001
From: tibbi
Date: Tue, 23 Oct 2018 11:10:59 +0200
Subject: [PATCH 62/62] updating changelog
---
CHANGELOG.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4c8816b44..d65d24356 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,22 @@
Changelog
==========
+Version 5.1.0 *(2018-10-23)*
+----------------------------
+
+ * Added support for panorama videos
+ * Added an extra check to avoid trying deleting files without write permission
+ * Added an initial implementation of renaming multiple items at once
+ * Added some performance improvements at item de/selection
+ * Allow enabling hidden item visibility at the copy/move destination picker
+ * Allow closing fullscreen view with swipe down gestures (can be disabled in settings)
+ * Fixed a glitch with Favorite items getting unselected every day
+ * Fixed exposure time displayed at long exposure photos
+ * Fixed fullscreen images being sometimes totally zoomed in after device rotation
+ * Fixed slideshow direction
+ * Made loading initial fullscreen view quicker and fullscreen toggling more reliable
+ * Not sure what else, nobody reads this anyway
+
Version 5.0.1 *(2018-10-17)*
----------------------------