Merge pull request #1 from SimpleMobileTools/master

update fork
This commit is contained in:
Matheus Victor 2019-05-05 11:50:03 -03:00 committed by GitHub
commit 689c239096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 88 additions and 69 deletions

View File

@ -1,6 +1,13 @@
Changelog
==========
Version 6.7.0 *(2019-05-02)*
----------------------------
* Moved the video duration field at the top right corner of thumbnails, if enabled
* Fixed some fullscreen image related glitches
* Misc translation and stability improvements
Version 6.6.4 *(2019-04-09)*
----------------------------

View File

@ -15,8 +15,8 @@ android {
applicationId "com.simplemobiletools.gallery.pro"
minSdkVersion 21
targetSdkVersion 28
versionCode 243
versionName "6.6.4"
versionCode 244
versionName "6.7.0"
multiDexEnabled true
setProperty("archivesBaseName", "gallery")
}
@ -61,12 +61,12 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.11.4'
implementation 'com.simplemobiletools:commons:5.12.12'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'
implementation 'com.google.vr:sdk-panowidget:1.180.0'
implementation 'com.google.vr:sdk-videowidget:1.180.0'
@ -74,8 +74,8 @@ dependencies {
implementation 'info.androidhive:imagefilters:1.0.7'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.caverock:androidsvg-aar:1.3'
implementation 'com.github.tibbi:gestureviews:cb7c2c191a'
implementation 'com.github.tibbi:subsampling-scale-image-view:7e4202eaee'
implementation 'com.github.tibbi:gestureviews:1506ec6156'
implementation 'com.github.tibbi:subsampling-scale-image-view:1df78cdfff'
kapt 'com.github.bumptech.glide:compiler:4.9.0' // keep it here too, not just in Commons, else loading SVGs wont work
kapt 'androidx.room:room-compiler:2.0.0'

View File

@ -1122,7 +1122,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
dirs.removeAll(invalidDirs)
setupAdapter(dirs)
invalidDirs.forEach {
mDirectoryDao.deleteDirPath(it.path)
try {
mDirectoryDao.deleteDirPath(it.path)
} catch (ignored: Exception) {
}
}
}
}

View File

@ -483,7 +483,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
private fun setupView(view: View, directory: Directory) {
val isSelected = selectedKeys.contains(directory.path.hashCode())
view.apply {
dir_name.text = if (groupDirectSubfolders) "${directory.name} (${directory.subfoldersCount})" else directory.name
dir_name.text = if (groupDirectSubfolders && directory.subfoldersCount > 1) "${directory.name} (${directory.subfoldersCount})" else directory.name
dir_path?.text = "${directory.path.substringBeforeLast("/")}/"
photo_cnt.text = directory.subfoldersMediaCount.toString()
val thumbnailType = when {
@ -501,7 +501,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
activity.loadImage(thumbnailType, directory.tmb, dir_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)
dir_pin.beVisibleIf(pinnedFolders.contains(directory.path))
dir_location.beVisibleIf(directory.location != LOCAITON_INTERNAL)
dir_location.beVisibleIf(directory.location != LOCATION_INTERNAL)
if (dir_location.isVisible()) {
dir_location.setImageResource(if (directory.location == LOCATION_SD) R.drawable.ic_sd_card else R.drawable.ic_usb)
}

View File

@ -6,7 +6,6 @@ import android.content.Context
import android.content.Intent
import android.content.res.Configuration
import android.database.Cursor
import android.database.sqlite.SQLiteException
import android.graphics.Point
import android.graphics.drawable.PictureDrawable
import android.media.AudioManager
@ -189,9 +188,7 @@ fun Context.getDirsToShow(dirs: ArrayList<Directory>, allDirs: ArrayList<Directo
it.subfoldersMediaCount = it.mediaCnt
}
val dirFolders = dirs.map { it.path }.sorted().toMutableSet() as HashSet<String>
val foldersToShow = getDirectParentSubfolders(dirFolders, currentPathPrefix)
val parentDirs = dirs.filter { foldersToShow.contains(it.path) } as ArrayList<Directory>
val parentDirs = getDirectParentSubfolders(dirs, currentPathPrefix)
updateSubfolderCounts(dirs, parentDirs)
// show the current folder as an available option too, not just subfolders
@ -210,7 +207,8 @@ fun Context.getDirsToShow(dirs: ArrayList<Directory>, allDirs: ArrayList<Directo
}
}
fun Context.getDirectParentSubfolders(folders: HashSet<String>, currentPathPrefix: String): HashSet<String> {
fun Context.getDirectParentSubfolders(dirs: ArrayList<Directory>, currentPathPrefix: String): ArrayList<Directory> {
val folders = dirs.map { it.path }.sorted().toMutableSet() as HashSet<String>
val internalPath = internalStoragePath
val sdPath = sdCardPath
val currentPaths = LinkedHashSet<String>()
@ -258,15 +256,17 @@ fun Context.getDirectParentSubfolders(folders: HashSet<String>, currentPathPrefi
}
if (folders.size == currentPaths.size) {
return currentPaths
return dirs.filter { currentPaths.contains(it.path) } as ArrayList<Directory>
}
folders.clear()
folders.addAll(currentPaths)
val dirsToShow = dirs.filter { folders.contains(it.path) } as ArrayList<Directory>
return if (areDirectSubfoldersAvailable) {
getDirectParentSubfolders(folders, currentPathPrefix)
getDirectParentSubfolders(dirsToShow, currentPathPrefix)
} else {
folders
dirsToShow
}
}
@ -426,7 +426,7 @@ fun Context.getPathLocation(path: String): Int {
return when {
isPathOnSD(path) -> LOCATION_SD
isPathOnOTG(path) -> LOCATION_OTG
else -> LOCAITON_INTERNAL
else -> LOCATION_INTERNAL
}
}
@ -477,7 +477,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
Thread {
val directories = try {
directoryDao.getAll() as ArrayList<Directory>
} catch (e: SQLiteException) {
} catch (e: Exception) {
ArrayList<Directory>()
}

View File

@ -243,11 +243,13 @@ class PhotoFragment : ViewPagerFragment() {
// avoid GIFs being skewed, played in wrong aspect ratio
if (mMedium.isGIF()) {
mView.onGlobalLayout {
measureScreen()
Handler().postDelayed({
mView.gif_view_frame.controller.resetState()
loadGif()
}, 50)
if (activity != null) {
measureScreen()
Handler().postDelayed({
mView.gif_view_frame.controller.resetState()
loadGif()
}, 50)
}
}
} else {
hideZoomableView()
@ -286,7 +288,7 @@ class PhotoFragment : ViewPagerFragment() {
private fun measureScreen() {
val metrics = DisplayMetrics()
activity!!.windowManager.defaultDisplay.getRealMetrics(metrics)
activity?.windowManager?.defaultDisplay?.getRealMetrics(metrics)
mScreenWidth = metrics.widthPixels
mScreenHeight = metrics.heightPixels
}

View File

@ -154,7 +154,7 @@ const val TYPE_GIFS = 4
const val TYPE_RAWS = 8
const val TYPE_SVGS = 16
const val LOCAITON_INTERNAL = 1
const val LOCATION_INTERNAL = 1
const val LOCATION_SD = 2
const val LOCATION_OTG = 3

View File

@ -69,6 +69,8 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:shadowColor="@color/default_background_color"
android:shadowRadius="4"
android:paddingBottom="@dimen/small_margin"
android:textColor="@android:color/white"
android:textSize="@dimen/normal_text_size"/>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/media_item_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -13,26 +14,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/medium_check"
android:layout_width="@dimen/selection_check_size"
android:layout_height="@dimen/selection_check_size"
android:layout_alignRight="@+id/medium_name"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="@dimen/small_margin"
android:background="@drawable/circle_background"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_check"
android:visibility="gone"/>
<ImageView
android:id="@+id/play_outline"
android:layout_width="@dimen/selection_check_size"
android:layout_height="@dimen/selection_check_size"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="@dimen/small_margin"
android:src="@drawable/img_play_outline"
@ -42,25 +28,39 @@
android:id="@+id/video_duration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="@drawable/gradient_background"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:ellipsize="end"
android:gravity="right"
android:gravity="end"
android:maxLines="1"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:shadowColor="@color/default_background_color"
android:shadowRadius="4"
android:textColor="@android:color/white"
android:textSize="@dimen/normal_text_size"
android:visibility="gone"
tools:text="02:34"/>
<ImageView
android:id="@+id/medium_check"
android:layout_width="@dimen/selection_check_size"
android:layout_height="@dimen/selection_check_size"
android:layout_alignEnd="@+id/medium_name"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/small_margin"
android:background="@drawable/circle_background"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_check"
android:visibility="gone"/>
<TextView
android:id="@+id/medium_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/medium_thumbnail"
android:layout_alignRight="@+id/medium_thumbnail"
android:layout_alignStart="@+id/medium_thumbnail"
android:layout_alignEnd="@+id/medium_thumbnail"
android:layout_alignParentBottom="true"
android:background="@drawable/gradient_background"
android:ellipsize="end"
@ -69,7 +69,10 @@
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:shadowColor="@color/default_background_color"
android:shadowRadius="4"
android:textColor="@android:color/white"
android:textSize="@dimen/smaller_text_size"/>
android:textSize="@dimen/smaller_text_size"
tools:text="My photo"/>
</RelativeLayout>

View File

@ -41,7 +41,8 @@
android:paddingLeft="6dp"
android:paddingRight="@dimen/normal_margin"
android:textColor="@android:color/white"
android:textSize="@dimen/bigger_text_size"/>
android:textSize="@dimen/bigger_text_size"
tools:text="My photo"/>
<ImageView
android:id="@+id/play_outline"

View File

@ -7,16 +7,16 @@
android:title="@string/search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="collapseActionView|ifRoom"/>
<item
android:id="@+id/sort"
android:icon="@drawable/ic_sort"
android:title="@string/sort_by"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/open_camera"
android:icon="@drawable/ic_camera"
android:title="@string/open_camera"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/sort"
android:icon="@drawable/ic_sort"
android:title="@string/sort_by"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/filter"
android:icon="@drawable/ic_filter"

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">動画を早送りするにはどうすればよいですか?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar, that will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -198,7 +198,7 @@
<string name="faq_2_title">I locked the app with a password, but I forgot it. What can I do?</string>
<string name="faq_2_text">You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files.</string>
<string name="faq_3_title">How can I make an album always appear at the top?</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actionmenu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_3_text">You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method.</string>
<string name="faq_4_title">How can I fast-forward videos?</string>
<string name="faq_4_text">You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward.</string>
<string name="faq_5_title">What is the difference between hiding and excluding a folder?</string>

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.3.31'
repositories {
google()
@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 KiB

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 KiB

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 KiB

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

View File

@ -1,2 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

View File

@ -1,6 +1,6 @@
#Wed Jan 16 16:59:58 CET 2019
#Tue Apr 30 16:38:30 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip