Merge pull request #6 from SimpleMobileTools/master

merge
This commit is contained in:
fiepi 2017-10-22 10:50:50 +08:00 committed by GitHub
commit 4608df3d74
81 changed files with 3868 additions and 1269 deletions

View file

@ -1,6 +1,97 @@
Changelog Changelog
========== ==========
Version 2.16.0 *(2017-10-19)*
----------------------------
* Added sorting by path
* Added an option to show customizable extended details over fullscreen media
* Allow selecting Album cover photos from any folders
* Added a checkbox for skipping Delete confirmation dialog
Version 2.15.2 *(2017-10-06)*
----------------------------
* Properly display SD card content to Android 4 users
* Fix displaying some third party media, like Bluemail attachments
* Fix media picking intents if "Show all folders content" is enabled
Version 2.15.1 *(2017-10-01)*
----------------------------
* Updated commons library with minor fixes
Version 2.15.0 *(2017-10-01)*
----------------------------
* Added fingerprint to hidden item protection
* Added a new List view type
* Fixed an issue with some hidden items being shown at "Show all folders content"
* Fixed typing in color hex codes manually with some keyboards
* Do not autosave rotated images in any case
* Tons of other performance, stability and UX improvements
Version 2.14.4 *(2017-09-18)*
----------------------------
* Revert to the old way of loading fullscreen images to avoid issues on Android 7+
Version 2.14.3 *(2017-09-17)*
----------------------------
* Removed some error toast messages after delete, or if image loading failed
* Fixed some visual glitches at horizontal scrolling
* Disable pull-to-refresh at horizontal scrolling
* Many other smaller bugfixes and improvements
Version 2.14.2 *(2017-09-11)*
----------------------------
* Fixing some glitches with fullscreen images
* Add an extra check to avoid displaying non-existing media
* Fix opening media from third party intents
Version 2.14.1 *(2017-09-07)*
----------------------------
* Fixing some glitches around fullscreen view
Version 2.14.0 *(2017-09-05)*
----------------------------
* Simplified the way of creating new folders
* Added a loop option to slideshows, slowed down the swipe animation
* Added an option to filter out gifs from slideshows
* Improved the quality of fullscreen images
* Properly allow excluding the root folder
Version 2.13.4 *(2017-09-01)*
----------------------------
* Improved the image loading performance
* Added a switch for disabling video gestures
* Added a switch for deleting empty folders after deleting content
* Show excluded folder content at third party intent if needed
Version 2.13.3 *(2017-08-29)*
----------------------------
* Fixing copy/move actions on some devices
Version 2.13.2 *(2017-08-28)*
----------------------------
* Moved media type filter from Settings to the Action menu
* Allow filtering GIFs out
* Make sure we always show manually included folders
* Properly show hidden files, when open from some File Manager
Version 2.13.1 *(2017-08-16)*
----------------------------
* Show a folder if its both excluded and included
* Many translation improvements
Version 2.13.0 *(2017-08-07)* Version 2.13.0 *(2017-08-07)*
---------------------------- ----------------------------

208
LICENSE
View file

@ -1,13 +1,201 @@
Copyright 2016 SimpleMobileTools Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Licensed under the Apache License, Version 2.0 (the "License"); TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0 1. Definitions.
Unless required by applicable law or agreed to in writing, software "License" shall mean the terms and conditions for use, reproduction,
distributed under the License is distributed on an "AS IS" BASIS, and distribution as defined by Sections 1 through 9 of this document.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and "Licensor" shall mean the copyright owner or entity authorized by
limitations under the License. the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 SimpleMobileTools
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -4,14 +4,14 @@ apply plugin: 'kotlin-android-extensions'
android { android {
compileSdkVersion 25 compileSdkVersion 25
buildToolsVersion "25.0.2" buildToolsVersion "25.0.3"
defaultConfig { defaultConfig {
applicationId "com.simplemobiletools.gallery" applicationId "com.simplemobiletools.gallery"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 23 targetSdkVersion 23
versionCode 124 versionCode 136
versionName "2.13.1" versionName "2.16.0"
} }
signingConfigs { signingConfigs {
@ -37,7 +37,7 @@ android {
} }
dependencies { dependencies {
compile 'com.simplemobiletools:commons:2.25.4' compile 'com.simplemobiletools:commons:2.30.6'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
@ -52,7 +52,7 @@ dependencies {
} }
buildscript { buildscript {
ext.kotlin_version = '1.1.4-2' ext.kotlin_version = '1.1.51'
repositories { repositories {
mavenCentral() mavenCentral()
} }

View file

@ -1,5 +1,2 @@
-keep class com.simplemobiletools.** { *; } -keep class com.simplemobiletools.** { *; }
-dontwarn com.simplemobiletools.** -dontwarn com.simplemobiletools.**
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

View file

@ -1,12 +1,14 @@
package com.simplemobiletools.gallery package com.simplemobiletools.gallery
import android.app.Application import android.app.Application
import com.github.ajalt.reprint.core.Reprint
import com.squareup.leakcanary.LeakCanary import com.squareup.leakcanary.LeakCanary
class App : Application() { class App : Application() {
val USE_LEAK_CANARY = false val USE_LEAK_CANARY = false
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
Reprint.initialize(this)
if (USE_LEAK_CANARY) { if (USE_LEAK_CANARY) {
if (LeakCanary.isInAnalyzerProcess(this)) { if (LeakCanary.isInAnalyzerProcess(this)) {
return return

View file

@ -172,7 +172,11 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
try { try {
getFileOutputStream(file) { getFileOutputStream(file) {
saveBitmap(file, bitmap, it) if (it != null) {
saveBitmap(file, bitmap, it)
} else {
toast(R.string.image_editing_failed)
}
} }
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "Crop compressing failed $path $e") Log.e(TAG, "Crop compressing failed $path $e")

View file

@ -1,23 +1,27 @@
package com.simplemobiletools.gallery.activities package com.simplemobiletools.gallery.activities
import android.Manifest
import android.app.Activity import android.app.Activity
import android.content.ClipData
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri import android.net.Uri
import android.os.AsyncTask
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.provider.MediaStore import android.provider.MediaStore
import android.support.v4.app.ActivityCompat
import android.support.v7.widget.GridLayoutManager import android.support.v7.widget.GridLayoutManager
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import com.google.gson.Gson import com.google.gson.Gson
import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN
import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.commons.models.Release import com.simplemobiletools.commons.models.Release
import com.simplemobiletools.commons.views.MyScalableRecyclerView import com.simplemobiletools.commons.views.MyScalableRecyclerView
import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.BuildConfig
@ -25,6 +29,7 @@ import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.adapters.DirectoryAdapter import com.simplemobiletools.gallery.adapters.DirectoryAdapter
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
import com.simplemobiletools.gallery.dialogs.ChangeSortingDialog import com.simplemobiletools.gallery.dialogs.ChangeSortingDialog
import com.simplemobiletools.gallery.dialogs.FilterMediaDialog
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Directory
@ -33,7 +38,6 @@ import java.io.*
import java.util.* import java.util.*
class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private val STORAGE_PERMISSION = 1
private val PICK_MEDIA = 2 private val PICK_MEDIA = 2
private val PICK_WALLPAPER = 3 private val PICK_WALLPAPER = 3
private val LAST_MEDIA_CHECK_PERIOD = 3000L private val LAST_MEDIA_CHECK_PERIOD = 3000L
@ -46,20 +50,22 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private var mIsGetVideoContentIntent = false private var mIsGetVideoContentIntent = false
private var mIsGetAnyContentIntent = false private var mIsGetAnyContentIntent = false
private var mIsSetWallpaperIntent = false private var mIsSetWallpaperIntent = false
private var mAllowPickingMultiple = false
private var mIsThirdPartyIntent = false private var mIsThirdPartyIntent = false
private var mIsGettingDirs = false private var mIsGettingDirs = false
private var mStoredAnimateGifs = true private var mStoredAnimateGifs = true
private var mStoredCropThumbnails = true private var mStoredCropThumbnails = true
private var mStoredScrollHorizontally = true private var mStoredScrollHorizontally = true
private var mStoredTextColor = 0
private var mLoadedInitialPhotos = false private var mLoadedInitialPhotos = false
private var mLastMediaModified = 0 private var mLatestMediaId = 0L
private var mLastMediaHandler = Handler() private var mLastMediaHandler = Handler()
private var mCurrAsyncTask: GetDirectoriesAsynctask? = null private var mCurrAsyncTask: GetDirectoriesAsynctask? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
storeStoragePaths()
mIsPickImageIntent = isPickImageIntent(intent) mIsPickImageIntent = isPickImageIntent(intent)
mIsPickVideoIntent = isPickVideoIntent(intent) mIsPickVideoIntent = isPickVideoIntent(intent)
@ -67,16 +73,22 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mIsGetVideoContentIntent = isGetVideoContentIntent(intent) mIsGetVideoContentIntent = isGetVideoContentIntent(intent)
mIsGetAnyContentIntent = isGetAnyContentIntent(intent) mIsGetAnyContentIntent = isGetAnyContentIntent(intent)
mIsSetWallpaperIntent = isSetWallpaperIntent(intent) mIsSetWallpaperIntent = isSetWallpaperIntent(intent)
mAllowPickingMultiple = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent ||
mIsGetAnyContentIntent || mIsSetWallpaperIntent mIsGetAnyContentIntent || mIsSetWallpaperIntent
removeTempFolder()
directories_refresh_layout.setOnRefreshListener({ getDirectories() }) directories_refresh_layout.setOnRefreshListener({ getDirectories() })
mDirs = ArrayList<Directory>() mDirs = ArrayList()
mStoredAnimateGifs = config.animateGifs mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails mStoredCropThumbnails = config.cropThumbnails
mStoredScrollHorizontally = config.scrollHorizontally mStoredScrollHorizontally = config.scrollHorizontally
storeStoragePaths() mStoredTextColor = config.textColor
checkWhatsNewDialog() checkWhatsNewDialog()
directories_empty_text.setOnClickListener {
showFilterMediaDialog()
}
} }
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onCreateOptionsMenu(menu: Menu): Boolean {
@ -84,8 +96,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
menuInflater.inflate(R.menu.menu_main_intent, menu) menuInflater.inflate(R.menu.menu_main_intent, menu)
} else { } else {
menuInflater.inflate(R.menu.menu_main, menu) menuInflater.inflate(R.menu.menu_main, menu)
menu.findItem(R.id.increase_column_count).isVisible = config.dirColumnCnt < 10 menu.findItem(R.id.increase_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt < 10
menu.findItem(R.id.reduce_column_count).isVisible = config.dirColumnCnt > 1 menu.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.temporarily_show_hidden).isVisible = !config.shouldShowHidden
menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
@ -95,10 +107,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.sort -> showSortingDialog() R.id.sort -> showSortingDialog()
R.id.filter -> showFilterMediaDialog()
R.id.open_camera -> launchCamera() R.id.open_camera -> launchCamera()
R.id.show_all -> showAllMedia() R.id.show_all -> showAllMedia()
R.id.change_view_type -> changeViewType()
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden()
R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden() R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden()
R.id.create_new_folder -> createNewFolder()
R.id.increase_column_count -> increaseColumnCount() R.id.increase_column_count -> increaseColumnCount()
R.id.reduce_column_count -> reduceColumnCount() R.id.reduce_column_count -> reduceColumnCount()
R.id.settings -> launchSettings() R.id.settings -> launchSettings()
@ -110,6 +125,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
config.isThirdPartyIntent = false
if (mStoredAnimateGifs != config.animateGifs) { if (mStoredAnimateGifs != config.animateGifs) {
directories_grid.adapter?.notifyDataSetChanged() directories_grid.adapter?.notifyDataSetChanged()
} }
@ -119,54 +135,66 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
} }
if (mStoredScrollHorizontally != config.scrollHorizontally) { if (mStoredScrollHorizontally != config.scrollHorizontally) {
directories_grid.adapter?.let { (directories_grid.adapter as? DirectoryAdapter)?.apply {
(it as DirectoryAdapter).scrollVertically = !config.scrollHorizontally scrollVertically = config.viewTypeFolders == VIEW_TYPE_LIST || !config.scrollHorizontally
it.notifyDataSetChanged() notifyDataSetChanged()
} }
setupScrollDirection() setupScrollDirection()
} }
if (mStoredTextColor != config.textColor) {
(directories_grid.adapter as? DirectoryAdapter)?.updateTextColor(config.textColor)
}
tryloadGallery() tryloadGallery()
invalidateOptionsMenu() invalidateOptionsMenu()
directories_empty_text_label.setTextColor(config.textColor)
directories_empty_text.setTextColor(config.primaryColor)
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
mCurrAsyncTask?.shouldStop = true
storeDirectories() storeDirectories()
directories_refresh_layout.isRefreshing = false directories_refresh_layout.isRefreshing = false
mIsGettingDirs = false mIsGettingDirs = false
mStoredAnimateGifs = config.animateGifs mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails mStoredCropThumbnails = config.cropThumbnails
mStoredScrollHorizontally = config.scrollHorizontally mStoredScrollHorizontally = config.scrollHorizontally
mStoredTextColor = config.textColor
directories_grid.listener = null directories_grid.listener = null
mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.removeCallbacksAndMessages(null)
if (!mDirs.isEmpty()) {
mCurrAsyncTask?.stopFetching()
}
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
config.temporarilyShowHidden = false config.temporarilyShowHidden = false
removeTempFolder()
}
private fun removeTempFolder() {
val newFolder = File(config.tempFolderPath)
if (newFolder.exists() && newFolder.isDirectory) {
if (newFolder.list()?.isEmpty() == true) {
deleteFileBg(newFolder, true) { }
}
}
config.tempFolderPath = ""
} }
private fun tryloadGallery() { private fun tryloadGallery() {
if (hasWriteStoragePermission()) { handlePermission(PERMISSION_WRITE_STORAGE) {
if (config.showAll) if (it) {
showAllMedia() if (config.showAll)
else showAllMedia()
getDirectories() else
setupLayoutManager() getDirectories()
checkIfColorChanged()
} else {
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION)
}
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) { setupLayoutManager()
super.onRequestPermissionsResult(requestCode, permissions, grantResults) checkIfColorChanged()
if (requestCode == STORAGE_PERMISSION) {
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
getDirectories()
} else { } else {
toast(R.string.no_storage_permissions) toast(R.string.no_storage_permissions)
finish() finish()
@ -181,7 +209,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mIsGettingDirs = true mIsGettingDirs = true
val dirs = getCachedDirectories() val dirs = getCachedDirectories()
if (dirs.isNotEmpty() && !mLoadedInitialPhotos) { if (dirs.isNotEmpty() && !mLoadedInitialPhotos) {
gotDirectories(dirs) gotDirectories(dirs, true)
} }
if (!mLoadedInitialPhotos) { if (!mLoadedInitialPhotos) {
@ -190,13 +218,24 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mLoadedInitialPhotos = true mLoadedInitialPhotos = true
mCurrAsyncTask = GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) { mCurrAsyncTask = GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) {
gotDirectories(it) gotDirectories(addTempFolderIfNeeded(it), false)
} }
mCurrAsyncTask!!.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) mCurrAsyncTask!!.execute()
} }
private fun showSortingDialog() { private fun showSortingDialog() {
ChangeSortingDialog(this, true, false) { ChangeSortingDialog(this, true, false) {
if (config.directorySorting and SORT_BY_DATE_MODIFIED > 0 || config.directorySorting and SORT_BY_DATE_TAKEN > 0) {
getDirectories()
} else {
gotDirectories(mDirs, true)
}
}
}
private fun showFilterMediaDialog() {
FilterMediaDialog(this) {
directories_refresh_layout.isRefreshing = true
getDirectories() getDirectories()
} }
} }
@ -205,9 +244,28 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
config.showAll = true config.showAll = true
Intent(this, MediaActivity::class.java).apply { Intent(this, MediaActivity::class.java).apply {
putExtra(DIRECTORY, "/") putExtra(DIRECTORY, "/")
startActivity(this)
if (mIsThirdPartyIntent) {
handleMediaIntent(this)
} else {
startActivity(this)
finish()
}
}
}
private fun changeViewType() {
val items = arrayListOf(
RadioItem(VIEW_TYPE_GRID, getString(R.string.grid)),
RadioItem(VIEW_TYPE_LIST, getString(R.string.list)))
RadioGroupDialog(this, items, config.viewTypeFolders) {
config.viewTypeFolders = it as Int
invalidateOptionsMenu()
setupLayoutManager()
directories_grid.adapter = null
setupAdapter()
} }
finish()
} }
private fun tryToggleTemporarilyShowHidden() { private fun tryToggleTemporarilyShowHidden() {
@ -247,6 +305,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private fun getRecyclerAdapter() = (directories_grid.adapter as DirectoryAdapter) private fun getRecyclerAdapter() = (directories_grid.adapter as DirectoryAdapter)
private fun setupLayoutManager() { private fun setupLayoutManager() {
if (config.viewTypeFolders == VIEW_TYPE_GRID)
setupGridLayoutManager()
else
setupListLayoutManager()
}
private fun setupGridLayoutManager() {
val layoutManager = directories_grid.layoutManager as GridLayoutManager val layoutManager = directories_grid.layoutManager as GridLayoutManager
if (config.scrollHorizontally) { if (config.scrollHorizontally) {
layoutManager.orientation = GridLayoutManager.HORIZONTAL layoutManager.orientation = GridLayoutManager.HORIZONTAL
@ -284,6 +349,25 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
} }
} }
private fun setupListLayoutManager() {
directories_grid.isDragSelectionEnabled = true
directories_grid.isZoomingEnabled = false
val layoutManager = directories_grid.layoutManager as GridLayoutManager
layoutManager.spanCount = 1
layoutManager.orientation = GridLayoutManager.VERTICAL
directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
private fun createNewFolder() {
FilePickerDialog(this, internalStoragePath, false, config.shouldShowHidden) {
CreateNewFolderDialog(this, it) {
config.tempFolderPath = it
gotDirectories(addTempFolderIfNeeded(mDirs), true)
}
}
}
private fun increaseColumnCount() { private fun increaseColumnCount() {
config.dirColumnCnt = ++(directories_grid.layoutManager as GridLayoutManager).spanCount config.dirColumnCnt = ++(directories_grid.layoutManager as GridLayoutManager).spanCount
invalidateOptionsMenu() invalidateOptionsMenu()
@ -326,36 +410,22 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
if (requestCode == PICK_MEDIA && resultData?.data != null) { if (requestCode == PICK_MEDIA && resultData != null) {
Intent().apply { val resultIntent = Intent()
if (mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent) {
when {
intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true -> fillExtraOutput(resultData)
resultData.extras?.containsKey(PICKED_PATHS) == true -> fillPickedPaths(resultData, resultIntent)
else -> fillIntentPath(resultData, resultIntent)
}
} else if ((mIsPickImageIntent || mIsPickVideoIntent)) {
val path = resultData.data.path val path = resultData.data.path
val uri = Uri.fromFile(File(path)) val uri = Uri.fromFile(File(path))
if (mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent) { resultIntent.data = uri
if (intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true) { resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
var inputStream: InputStream? = null
var outputStream: OutputStream? = null
try {
val output = intent.extras.get(MediaStore.EXTRA_OUTPUT) as Uri
inputStream = FileInputStream(File(path))
outputStream = contentResolver.openOutputStream(output)
inputStream.copyTo(outputStream)
} catch (ignored: FileNotFoundException) {
} finally {
inputStream?.close()
outputStream?.close()
}
} else {
val type = File(path).getMimeType("image/jpeg")
setDataAndTypeAndNormalize(uri, type)
flags = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
}
} else if (mIsPickImageIntent || mIsPickVideoIntent) {
data = uri
flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
}
setResult(Activity.RESULT_OK, this)
} }
setResult(Activity.RESULT_OK, resultIntent)
finish() finish()
} else if (requestCode == PICK_WALLPAPER) { } else if (requestCode == PICK_WALLPAPER) {
setResult(Activity.RESULT_OK) setResult(Activity.RESULT_OK)
@ -365,10 +435,51 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
super.onActivityResult(requestCode, resultCode, resultData) super.onActivityResult(requestCode, resultCode, resultData)
} }
private fun fillExtraOutput(resultData: Intent) {
val path = resultData.data.path
var inputStream: InputStream? = null
var outputStream: OutputStream? = null
try {
val output = intent.extras.get(MediaStore.EXTRA_OUTPUT) as Uri
inputStream = FileInputStream(File(path))
outputStream = contentResolver.openOutputStream(output)
inputStream.copyTo(outputStream)
} catch (ignored: FileNotFoundException) {
} finally {
inputStream?.close()
outputStream?.close()
}
}
private fun fillPickedPaths(resultData: Intent, resultIntent: Intent) {
val paths = resultData.extras.getStringArrayList(PICKED_PATHS)
val uris = paths.map { Uri.fromFile(File(it)) } as ArrayList
val clipData = ClipData("Attachment", arrayOf("image/*", "video/*"), ClipData.Item(uris.removeAt(0)))
uris.forEach {
clipData.addItem(ClipData.Item(it))
}
resultIntent.clipData = clipData
}
private fun fillIntentPath(resultData: Intent, resultIntent: Intent) {
val path = resultData.data.path
val uri = Uri.fromFile(File(path))
val type = File(path).getMimeType("image/jpeg")
resultIntent.setDataAndTypeAndNormalize(uri, type)
resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
}
private fun itemClicked(path: String) { private fun itemClicked(path: String) {
Intent(this, MediaActivity::class.java).apply { Intent(this, MediaActivity::class.java).apply {
putExtra(DIRECTORY, path) putExtra(DIRECTORY, path)
handleMediaIntent(this)
}
}
private fun handleMediaIntent(intent: Intent) {
intent.apply {
if (mIsSetWallpaperIntent) { if (mIsSetWallpaperIntent) {
putExtra(SET_WALLPAPER_INTENT, true) putExtra(SET_WALLPAPER_INTENT, true)
startActivityForResult(this, PICK_WALLPAPER) startActivityForResult(this, PICK_WALLPAPER)
@ -376,30 +487,38 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
putExtra(GET_IMAGE_INTENT, mIsPickImageIntent || mIsGetImageContentIntent) putExtra(GET_IMAGE_INTENT, mIsPickImageIntent || mIsGetImageContentIntent)
putExtra(GET_VIDEO_INTENT, mIsPickVideoIntent || mIsGetVideoContentIntent) putExtra(GET_VIDEO_INTENT, mIsPickVideoIntent || mIsGetVideoContentIntent)
putExtra(GET_ANY_INTENT, mIsGetAnyContentIntent) putExtra(GET_ANY_INTENT, mIsGetAnyContentIntent)
putExtra(Intent.EXTRA_ALLOW_MULTIPLE, mAllowPickingMultiple)
startActivityForResult(this, PICK_MEDIA) startActivityForResult(this, PICK_MEDIA)
} }
} }
} }
private fun gotDirectories(dirs: ArrayList<Directory>) { private fun gotDirectories(newDirs: ArrayList<Directory>, isFromCache: Boolean) {
mLastMediaModified = getLastMediaModified() val dirs = getSortedDirectories(newDirs)
mLatestMediaId = getLatestMediaId()
directories_refresh_layout.isRefreshing = false directories_refresh_layout.isRefreshing = false
mIsGettingDirs = false mIsGettingDirs = false
directories_empty_text_label.beVisibleIf(dirs.isEmpty() && !isFromCache)
directories_empty_text.beVisibleIf(dirs.isEmpty() && !isFromCache)
checkLastMediaChanged() checkLastMediaChanged()
if (dirs.hashCode() == mDirs.hashCode()) if (dirs.hashCode() == mDirs.hashCode()) {
return return
}
mDirs = dirs mDirs = dirs
runOnUiThread { runOnUiThread {
setupAdapter() setupAdapter()
} }
storeDirectories() storeDirectories()
} }
private fun storeDirectories() { private fun storeDirectories() {
if (!config.temporarilyShowHidden) { if (!config.temporarilyShowHidden && config.tempFolderPath.isEmpty()) {
val directories = Gson().toJson(mDirs) val directories = Gson().toJson(mDirs)
config.directories = directories config.directories = directories
} }
@ -418,13 +537,16 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
} }
private fun setupScrollDirection() { private fun setupScrollDirection() {
val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID
directories_refresh_layout.isEnabled = !config.scrollHorizontally
directories_vertical_fastscroller.isHorizontal = false directories_vertical_fastscroller.isHorizontal = false
directories_vertical_fastscroller.beGoneIf(config.scrollHorizontally) directories_vertical_fastscroller.beGoneIf(allowHorizontalScroll)
directories_horizontal_fastscroller.isHorizontal = true directories_horizontal_fastscroller.isHorizontal = true
directories_horizontal_fastscroller.beVisibleIf(config.scrollHorizontally) directories_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll)
if (config.scrollHorizontally) { if (allowHorizontalScroll) {
directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout)
} else { } else {
directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout)
@ -438,9 +560,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.removeCallbacksAndMessages(null)
mLastMediaHandler.postDelayed({ mLastMediaHandler.postDelayed({
Thread({ Thread({
val lastModified = getLastMediaModified() val mediaId = getLatestMediaId()
if (mLastMediaModified != lastModified) { if (mLatestMediaId != mediaId) {
mLastMediaModified = lastModified mLatestMediaId = mediaId
runOnUiThread { runOnUiThread {
getDirectories() getDirectories()
} }
@ -459,6 +581,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_grid.setDragSelectActive(position) directories_grid.setDragSelectActive(position)
} }
override fun recheckPinnedFolders() {
gotDirectories(movePinnedDirectoriesToFront(mDirs), true)
}
private fun checkWhatsNewDialog() { private fun checkWhatsNewDialog() {
arrayListOf<Release>().apply { arrayListOf<Release>().apply {
add(Release(46, R.string.release_46)) add(Release(46, R.string.release_46))
@ -494,6 +620,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
add(Release(119, R.string.release_119)) add(Release(119, R.string.release_119))
add(Release(122, R.string.release_122)) add(Release(122, R.string.release_122))
add(Release(123, R.string.release_123)) add(Release(123, R.string.release_123))
add(Release(125, R.string.release_125))
add(Release(127, R.string.release_127))
add(Release(133, R.string.release_133))
add(Release(136, R.string.release_136))
checkWhatsNew(this, BuildConfig.VERSION_CODE) checkWhatsNew(this, BuildConfig.VERSION_CODE)
} }
} }

View file

@ -18,15 +18,18 @@ import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition import com.bumptech.glide.request.transition.Transition
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.commons.views.MyScalableRecyclerView import com.simplemobiletools.commons.views.MyScalableRecyclerView
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.adapters.MediaAdapter import com.simplemobiletools.gallery.adapters.MediaAdapter
import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask
import com.simplemobiletools.gallery.dialogs.ChangeSortingDialog import com.simplemobiletools.gallery.dialogs.ChangeSortingDialog
import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog
import com.simplemobiletools.gallery.dialogs.FilterMediaDialog
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
@ -35,8 +38,7 @@ import java.io.File
import java.io.IOException import java.io.IOException
class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private val TAG = MediaActivity::class.java.simpleName private val SAVE_MEDIA_CNT = 100
private val SAVE_MEDIA_CNT = 40
private val LAST_MEDIA_CHECK_PERIOD = 3000L private val LAST_MEDIA_CHECK_PERIOD = 3000L
private var mPath = "" private var mPath = ""
@ -44,14 +46,17 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private var mIsGetVideoIntent = false private var mIsGetVideoIntent = false
private var mIsGetAnyIntent = false private var mIsGetAnyIntent = false
private var mIsGettingMedia = false private var mIsGettingMedia = false
private var mAllowPickingMultiple = false
private var mShowAll = false private var mShowAll = false
private var mLoadedInitialPhotos = false private var mLoadedInitialPhotos = false
private var mStoredAnimateGifs = true private var mStoredAnimateGifs = true
private var mStoredCropThumbnails = true private var mStoredCropThumbnails = true
private var mStoredScrollHorizontally = true private var mStoredScrollHorizontally = true
private var mStoredTextColor = 0
private var mLastDrawnHashCode = 0 private var mLastDrawnHashCode = 0
private var mLastMediaModified = 0 private var mLatestMediaId = 0L
private var mLastMediaHandler = Handler() private var mLastMediaHandler = Handler()
private var mCurrAsyncTask: GetMediaAsynctask? = null
companion object { companion object {
var mMedia = ArrayList<Medium>() var mMedia = ArrayList<Medium>()
@ -64,6 +69,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mIsGetImageIntent = getBooleanExtra(GET_IMAGE_INTENT, false) mIsGetImageIntent = getBooleanExtra(GET_IMAGE_INTENT, false)
mIsGetVideoIntent = getBooleanExtra(GET_VIDEO_INTENT, false) mIsGetVideoIntent = getBooleanExtra(GET_VIDEO_INTENT, false)
mIsGetAnyIntent = getBooleanExtra(GET_ANY_INTENT, false) mIsGetAnyIntent = getBooleanExtra(GET_ANY_INTENT, false)
mAllowPickingMultiple = getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
} }
media_refresh_layout.setOnRefreshListener({ getMedia() }) media_refresh_layout.setOnRefreshListener({ getMedia() })
@ -71,9 +77,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mStoredAnimateGifs = config.animateGifs mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails mStoredCropThumbnails = config.cropThumbnails
mStoredScrollHorizontally = config.scrollHorizontally mStoredScrollHorizontally = config.scrollHorizontally
mStoredTextColor = config.textColor
mShowAll = config.showAll mShowAll = config.showAll
if (mShowAll) if (mShowAll)
supportActionBar?.setDisplayHomeAsUpEnabled(false) supportActionBar?.setDisplayHomeAsUpEnabled(false)
media_empty_text.setOnClickListener {
showFilterMediaDialog()
}
} }
override fun onResume() { override fun onResume() {
@ -87,15 +98,21 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
if (mStoredScrollHorizontally != config.scrollHorizontally) { if (mStoredScrollHorizontally != config.scrollHorizontally) {
media_grid.adapter?.let { (media_grid.adapter as? MediaAdapter)?.apply {
(it as MediaAdapter).scrollVertically = !config.scrollHorizontally scrollVertically = config.viewTypeFiles == VIEW_TYPE_LIST || !config.scrollHorizontally
it.notifyDataSetChanged() notifyDataSetChanged()
} }
setupScrollDirection() setupScrollDirection()
} }
if (mStoredTextColor != config.textColor) {
(media_grid.adapter as? MediaAdapter)?.updateTextColor(config.textColor)
}
tryloadGallery() tryloadGallery()
invalidateOptionsMenu() invalidateOptionsMenu()
media_empty_text_label.setTextColor(config.textColor)
media_empty_text.setTextColor(config.primaryColor)
} }
override fun onPause() { override fun onPause() {
@ -105,8 +122,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mStoredAnimateGifs = config.animateGifs mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails mStoredCropThumbnails = config.cropThumbnails
mStoredScrollHorizontally = config.scrollHorizontally mStoredScrollHorizontally = config.scrollHorizontally
mStoredTextColor = config.textColor
media_grid.listener = null media_grid.listener = null
mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.removeCallbacksAndMessages(null)
if (!mMedia.isEmpty()) {
mCurrAsyncTask?.stopFetching()
}
} }
override fun onDestroy() { override fun onDestroy() {
@ -117,14 +139,17 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
private fun tryloadGallery() { private fun tryloadGallery() {
if (hasWriteStoragePermission()) { handlePermission(PERMISSION_WRITE_STORAGE) {
val dirName = getHumanizedFilename(mPath) if (it) {
title = if (mShowAll) resources.getString(R.string.all_folders) else dirName val dirName = getHumanizedFilename(mPath)
getMedia() title = if (mShowAll) resources.getString(R.string.all_folders) else dirName
setupLayoutManager() getMedia()
checkIfColorChanged() setupLayoutManager()
} else { checkIfColorChanged()
finish() } else {
toast(R.string.no_storage_permissions)
finish()
}
} }
} }
@ -142,7 +167,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
val currAdapter = media_grid.adapter val currAdapter = media_grid.adapter
if (currAdapter == null) { if (currAdapter == null) {
media_grid.adapter = MediaAdapter(this, mMedia, this, mIsGetAnyIntent) { media_grid.adapter = MediaAdapter(this, mMedia, this, mIsGetAnyIntent, mAllowPickingMultiple) {
itemClicked(it.path) itemClicked(it.path)
} }
} else { } else {
@ -152,13 +177,16 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
private fun setupScrollDirection() { private fun setupScrollDirection() {
val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFiles == VIEW_TYPE_GRID
media_refresh_layout.isEnabled = !config.scrollHorizontally
media_vertical_fastscroller.isHorizontal = false media_vertical_fastscroller.isHorizontal = false
media_vertical_fastscroller.beGoneIf(config.scrollHorizontally) media_vertical_fastscroller.beGoneIf(allowHorizontalScroll)
media_horizontal_fastscroller.isHorizontal = true media_horizontal_fastscroller.isHorizontal = true
media_horizontal_fastscroller.beVisibleIf(config.scrollHorizontally) media_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll)
if (config.scrollHorizontally) { if (allowHorizontalScroll) {
media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout)
} else { } else {
media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) media_vertical_fastscroller.setViews(media_grid, media_refresh_layout)
@ -172,9 +200,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.removeCallbacksAndMessages(null)
mLastMediaHandler.postDelayed({ mLastMediaHandler.postDelayed({
Thread({ Thread({
val lastModified = getLastMediaModified() val mediaId = getLatestMediaId()
if (mLastMediaModified != lastModified) { if (mLatestMediaId != mediaId) {
mLastMediaModified = lastModified mLatestMediaId = mediaId
runOnUiThread { runOnUiThread {
getMedia() getMedia()
} }
@ -200,8 +228,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
findItem(R.id.increase_column_count).isVisible = config.mediaColumnCnt < 10 findItem(R.id.increase_column_count).isVisible = config.viewTypeFiles == VIEW_TYPE_GRID && config.mediaColumnCnt < 10
findItem(R.id.reduce_column_count).isVisible = config.mediaColumnCnt > 1 findItem(R.id.reduce_column_count).isVisible = config.viewTypeFiles == VIEW_TYPE_GRID && config.mediaColumnCnt > 1
findItem(R.id.toggle_filename).isVisible = config.viewTypeFiles == VIEW_TYPE_GRID
} }
return true return true
@ -210,9 +240,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.sort -> showSortingDialog() R.id.sort -> showSortingDialog()
R.id.filter -> showFilterMediaDialog()
R.id.toggle_filename -> toggleFilenameVisibility() R.id.toggle_filename -> toggleFilenameVisibility()
R.id.open_camera -> launchCamera() R.id.open_camera -> launchCamera()
R.id.folder_view -> switchToFolderView() R.id.folder_view -> switchToFolderView()
R.id.change_view_type -> changeViewType()
R.id.hide_folder -> tryHideFolder() R.id.hide_folder -> tryHideFolder()
R.id.unhide_folder -> unhideFolder() R.id.unhide_folder -> unhideFolder()
R.id.exclude_folder -> tryExcludeFolder() R.id.exclude_folder -> tryExcludeFolder()
@ -227,24 +259,45 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
return true return true
} }
private fun toggleFilenameVisibility() {
config.displayFileNames = !config.displayFileNames
if (media_grid.adapter != null)
getRecyclerAdapter().updateDisplayFilenames(config.displayFileNames)
}
private fun showSortingDialog() { private fun showSortingDialog() {
ChangeSortingDialog(this, false, !config.showAll, mPath) { ChangeSortingDialog(this, false, !config.showAll, mPath) {
getMedia() getMedia()
} }
} }
private fun showFilterMediaDialog() {
FilterMediaDialog(this) {
media_refresh_layout.isRefreshing = true
getMedia()
}
}
private fun toggleFilenameVisibility() {
config.displayFileNames = !config.displayFileNames
if (media_grid.adapter != null)
getRecyclerAdapter().updateDisplayFilenames(config.displayFileNames)
}
private fun switchToFolderView() { private fun switchToFolderView() {
config.showAll = false config.showAll = false
startActivity(Intent(this, MainActivity::class.java)) startActivity(Intent(this, MainActivity::class.java))
finish() finish()
} }
private fun changeViewType() {
val items = arrayListOf(
RadioItem(VIEW_TYPE_GRID, getString(R.string.grid)),
RadioItem(VIEW_TYPE_LIST, getString(R.string.list)))
RadioGroupDialog(this, items, config.viewTypeFiles) {
config.viewTypeFiles = it as Int
invalidateOptionsMenu()
setupLayoutManager()
media_grid.adapter = null
setupAdapter()
}
}
private fun tryHideFolder() { private fun tryHideFolder() {
if (config.wasHideFolderTooltipShown) { if (config.wasHideFolderTooltipShown) {
hideFolder() hideFolder()
@ -283,8 +336,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private fun deleteDirectoryIfEmpty() { private fun deleteDirectoryIfEmpty() {
val file = File(mPath) val file = File(mPath)
if (!file.isDownloadsFolder() && file.isDirectory && file.listFiles()?.isEmpty() == true) { if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.listFiles()?.isEmpty() == true) {
file.delete() deleteFile(file, true) {}
} }
} }
@ -293,22 +346,22 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
return return
mIsGettingMedia = true mIsGettingMedia = true
val token = object : TypeToken<List<Medium>>() {}.type val media = getCachedMedia(mPath)
val media = Gson().fromJson<ArrayList<Medium>>(config.loadFolderMedia(mPath), token) ?: ArrayList<Medium>(1)
if (media.isNotEmpty() && !mLoadedInitialPhotos) { if (media.isNotEmpty() && !mLoadedInitialPhotos) {
gotMedia(media) gotMedia(media, true)
} else { } else {
media_refresh_layout.isRefreshing = true media_refresh_layout.isRefreshing = true
} }
mLoadedInitialPhotos = true mLoadedInitialPhotos = true
GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) { mCurrAsyncTask = GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) {
gotMedia(it) gotMedia(it)
}.execute() }
mCurrAsyncTask!!.execute()
} }
private fun isDirEmpty(): Boolean { private fun isDirEmpty(): Boolean {
return if (mMedia.size <= 0) { return if (mMedia.size <= 0 && config.filterMedia > 0) {
deleteDirectoryIfEmpty() deleteDirectoryIfEmpty()
finish() finish()
true true
@ -335,6 +388,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private fun getRecyclerAdapter() = (media_grid.adapter as MediaAdapter) private fun getRecyclerAdapter() = (media_grid.adapter as MediaAdapter)
private fun setupLayoutManager() { private fun setupLayoutManager() {
if (config.viewTypeFiles == VIEW_TYPE_GRID)
setupGridLayoutManager()
else
setupListLayoutManager()
}
private fun setupGridLayoutManager() {
val layoutManager = media_grid.layoutManager as GridLayoutManager val layoutManager = media_grid.layoutManager as GridLayoutManager
if (config.scrollHorizontally) { if (config.scrollHorizontally) {
layoutManager.orientation = GridLayoutManager.HORIZONTAL layoutManager.orientation = GridLayoutManager.HORIZONTAL
@ -372,6 +432,16 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
} }
private fun setupListLayoutManager() {
media_grid.isDragSelectionEnabled = true
media_grid.isZoomingEnabled = false
val layoutManager = media_grid.layoutManager as GridLayoutManager
layoutManager.spanCount = 1
layoutManager.orientation = GridLayoutManager.VERTICAL
media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
private fun increaseColumnCount() { private fun increaseColumnCount() {
config.mediaColumnCnt = ++(media_grid.layoutManager as GridLayoutManager).spanCount config.mediaColumnCnt = ++(media_grid.layoutManager as GridLayoutManager).spanCount
invalidateOptionsMenu() invalidateOptionsMenu()
@ -445,11 +515,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
} }
private fun gotMedia(media: ArrayList<Medium>) { private fun gotMedia(media: ArrayList<Medium>, isFromCache: Boolean = false) {
mLastMediaModified = getLastMediaModified() mLatestMediaId = getLatestMediaId()
mIsGettingMedia = false mIsGettingMedia = false
media_refresh_layout.isRefreshing = false media_refresh_layout.isRefreshing = false
media_empty_text_label.beVisibleIf(media.isEmpty() && !isFromCache)
media_empty_text.beVisibleIf(media.isEmpty() && !isFromCache)
checkLastMediaChanged() checkLastMediaChanged()
if (mLastDrawnHashCode == 0) if (mLastDrawnHashCode == 0)
mLastDrawnHashCode = media.hashCode() mLastDrawnHashCode = media.hashCode()
@ -479,6 +552,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
if (!it) { if (!it) {
toast(R.string.unknown_error_occurred) toast(R.string.unknown_error_occurred)
} else if (mMedia.isEmpty()) { } else if (mMedia.isEmpty()) {
deleteDirectoryIfEmpty()
finish() finish()
} }
} }
@ -494,4 +568,12 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
override fun itemLongClicked(position: Int) { override fun itemLongClicked(position: Int) {
media_grid.setDragSelectActive(position) media_grid.setDragSelectActive(position)
} }
override fun selectedPaths(paths: ArrayList<String>) {
Intent().apply {
putExtra(PICKED_PATHS, paths)
setResult(Activity.RESULT_OK, this)
}
finish()
}
} }

View file

@ -1,26 +1,24 @@
package com.simplemobiletools.gallery.activities package com.simplemobiletools.gallery.activities
import android.Manifest
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager
import android.database.Cursor import android.database.Cursor
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.provider.MediaStore import android.provider.MediaStore
import android.support.v4.app.ActivityCompat
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import com.simplemobiletools.commons.extensions.hasWriteStoragePermission
import com.simplemobiletools.commons.extensions.scanPath import com.simplemobiletools.commons.extensions.scanPath
import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.fragments.PhotoFragment import com.simplemobiletools.gallery.fragments.PhotoFragment
import com.simplemobiletools.gallery.fragments.VideoFragment import com.simplemobiletools.gallery.fragments.VideoFragment
import com.simplemobiletools.gallery.fragments.ViewPagerFragment import com.simplemobiletools.gallery.fragments.ViewPagerFragment
import com.simplemobiletools.gallery.helpers.IS_FROM_GALLERY
import com.simplemobiletools.gallery.helpers.IS_VIEW_INTENT import com.simplemobiletools.gallery.helpers.IS_VIEW_INTENT
import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.helpers.MEDIUM
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
@ -28,9 +26,9 @@ import kotlinx.android.synthetic.main.fragment_holder.*
import java.io.File import java.io.File
open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentListener { open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentListener {
private val STORAGE_PERMISSION = 1
private var mMedium: Medium? = null private var mMedium: Medium? = null
private var mIsFullScreen = false private var mIsFullScreen = false
private var mIsFromGallery = false
private var mFragment: ViewPagerFragment? = null private var mFragment: ViewPagerFragment? = null
lateinit var mUri: Uri lateinit var mUri: Uri
@ -42,16 +40,19 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
public override fun onCreate(savedInstanceState: Bundle?) { public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.fragment_holder) setContentView(R.layout.fragment_holder)
handlePermission(PERMISSION_WRITE_STORAGE) {
if (hasWriteStoragePermission()) { if (it) {
checkIntent(savedInstanceState) checkIntent(savedInstanceState)
} else { } else {
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION) toast(R.string.no_storage_permissions)
finish()
}
} }
} }
private fun checkIntent(savedInstanceState: Bundle? = null) { private fun checkIntent(savedInstanceState: Bundle? = null) {
mUri = intent.data ?: return mUri = intent.data ?: return
mIsFromGallery = intent.getBooleanExtra(IS_FROM_GALLERY, false)
if (mUri.scheme == "file") { if (mUri.scheme == "file") {
scanPath(mUri.path) {} scanPath(mUri.path) {}
@ -60,11 +61,13 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
return return
} else { } else {
val path = applicationContext.getRealPathFromURI(mUri) ?: "" val path = applicationContext.getRealPathFromURI(mUri) ?: ""
scanPath(mUri.path) {} if (path != mUri.toString()) {
if (path.isNotEmpty()) { scanPath(mUri.path) {}
sendViewPagerIntent(path) if (path.isNotEmpty()) {
finish() sendViewPagerIntent(path)
return finish()
return
}
} }
} }
@ -110,22 +113,10 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background)) supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background))
} }
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
if (requestCode == STORAGE_PERMISSION) {
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
checkIntent()
} else {
toast(R.string.no_storage_permissions)
finish()
}
}
}
private fun sendViewPagerIntent(path: String) { private fun sendViewPagerIntent(path: String) {
Intent(this, ViewPagerActivity::class.java).apply { Intent(this, ViewPagerActivity::class.java).apply {
putExtra(IS_VIEW_INTENT, true) putExtra(IS_VIEW_INTENT, true)
putExtra(IS_FROM_GALLERY, mIsFromGallery)
putExtra(MEDIUM, path) putExtra(MEDIUM, path)
startActivity(this) startActivity(this)
} }

View file

@ -3,15 +3,21 @@ package com.simplemobiletools.gallery.activities
import android.content.Intent import android.content.Intent
import android.content.res.Resources import android.content.res.Resources
import android.os.Bundle import android.os.Bundle
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.dialogs.SecurityDialog import com.simplemobiletools.commons.dialogs.SecurityDialog
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.handleHiddenFolderPasswordProtection import com.simplemobiletools.commons.extensions.handleHiddenFolderPasswordProtection
import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.PROTECTION_FINGERPRINT
import com.simplemobiletools.commons.helpers.SHOW_ALL_TABS import com.simplemobiletools.commons.helpers.SHOW_ALL_TABS
import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.dialogs.ManageExtendedDetailsDialog
import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.* 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 kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.activity_settings.*
class SettingsActivity : SimpleActivity() { class SettingsActivity : SimpleActivity() {
@ -38,10 +44,13 @@ class SettingsActivity : SimpleActivity() {
setupDarkBackground() setupDarkBackground()
setupScrollHorizontally() setupScrollHorizontally()
setupScreenRotation() setupScreenRotation()
setupHideSystemUI()
setupReplaceShare() setupReplaceShare()
setupPasswordProtection() setupPasswordProtection()
setupShowMedia() setupDeleteEmptyFolders()
setupHideSystemUI() setupAllowVideoGestures()
setupShowExtendedDetails()
setupManageExtendedDetails()
updateTextColors(settings_holder) updateTextColors(settings_holder)
} }
@ -163,10 +172,32 @@ class SettingsActivity : SimpleActivity() {
config.isPasswordProtectionOn = !hasPasswordProtection config.isPasswordProtectionOn = !hasPasswordProtection
config.passwordHash = if (hasPasswordProtection) "" else hash config.passwordHash = if (hasPasswordProtection) "" else hash
config.protectionType = type config.protectionType = type
if (config.isPasswordProtectionOn) {
val confirmationTextId = if (config.protectionType == PROTECTION_FINGERPRINT)
R.string.fingerprint_setup_successfully else R.string.protection_setup_successfully
ConfirmationDialog(this, "", confirmationTextId, R.string.ok, 0) { }
}
} }
} }
} }
private fun setupDeleteEmptyFolders() {
settings_delete_empty_folders.isChecked = config.deleteEmptyFolders
settings_delete_empty_folders_holder.setOnClickListener {
settings_delete_empty_folders.toggle()
config.deleteEmptyFolders = settings_delete_empty_folders.isChecked
}
}
private fun setupAllowVideoGestures() {
settings_allow_video_gestures.isChecked = config.allowVideoGestures
settings_allow_video_gestures_holder.setOnClickListener {
settings_allow_video_gestures.toggle()
config.allowVideoGestures = settings_allow_video_gestures.isChecked
}
}
private fun setupScreenRotation() { private fun setupScreenRotation() {
settings_screen_rotation.text = getScreenRotationText() settings_screen_rotation.text = getScreenRotationText()
settings_screen_rotation_holder.setOnClickListener { settings_screen_rotation_holder.setOnClickListener {
@ -188,24 +219,23 @@ class SettingsActivity : SimpleActivity() {
else -> R.string.screen_rotation_aspect_ratio else -> R.string.screen_rotation_aspect_ratio
}) })
private fun setupShowMedia() { private fun setupShowExtendedDetails() {
settings_show_media.text = getShowMediaText() settings_show_extended_details.isChecked = config.showExtendedDetails
settings_show_media_holder.setOnClickListener { settings_show_extended_details_holder.setOnClickListener {
val items = arrayListOf( settings_show_extended_details.toggle()
RadioItem(IMAGES_AND_VIDEOS, res.getString(R.string.images_and_videos)), config.showExtendedDetails = settings_show_extended_details.isChecked
RadioItem(IMAGES, res.getString(R.string.images)), settings_manage_extended_details_holder.beVisibleIf(config.showExtendedDetails)
RadioItem(VIDEOS, res.getString(R.string.videos)))
RadioGroupDialog(this@SettingsActivity, items, config.showMedia) {
config.showMedia = it as Int
settings_show_media.text = getShowMediaText()
}
} }
} }
private fun getShowMediaText() = getString(when (config.showMedia) { private fun setupManageExtendedDetails() {
IMAGES_AND_VIDEOS -> R.string.images_and_videos settings_manage_extended_details_holder.beVisibleIf(config.showExtendedDetails)
IMAGES -> R.string.images settings_manage_extended_details_holder.setOnClickListener {
else -> R.string.videos ManageExtendedDetailsDialog(this) {
}) if (config.extendedDetails == 0) {
settings_show_extended_details_holder.callOnClick()
}
}
}
}
} }

View file

@ -1,9 +1,12 @@
package com.simplemobiletools.gallery.activities package com.simplemobiletools.gallery.activities
import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.getFilenameFromPath
import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.dialogs.PickDirectoryDialog import com.simplemobiletools.gallery.dialogs.PickDirectoryDialog
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.models.Directory
import java.io.File import java.io.File
import java.util.* import java.util.*
@ -19,4 +22,15 @@ open class SimpleActivity : BaseSimpleActivity() {
copyMoveFilesTo(files, source.trimEnd('/'), it, isCopyOperation, true, callback) copyMoveFilesTo(files, source.trimEnd('/'), it, isCopyOperation, true, callback)
} }
} }
fun addTempFolderIfNeeded(dirs: ArrayList<Directory>): ArrayList<Directory> {
val directories = ArrayList<Directory>()
val tempFolderPath = config.tempFolderPath
if (tempFolderPath.isNotEmpty()) {
val newFolder = Directory(tempFolderPath, "", tempFolderPath.getFilenameFromPath(), 0, 0, 0, 0L)
directories.add(newFolder)
}
directories.addAll(dirs)
return directories
}
} }

View file

@ -1,5 +1,7 @@
package com.simplemobiletools.gallery.activities package com.simplemobiletools.gallery.activities
import android.animation.Animator
import android.animation.ValueAnimator
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
@ -20,14 +22,16 @@ import android.provider.MediaStore
import android.support.v4.view.ViewPager import android.support.v4.view.ViewPager
import android.util.DisplayMetrics import android.util.DisplayMetrics
import android.view.* import android.view.*
import com.simplemobiletools.commons.dialogs.ConfirmationDialog import android.view.animation.DecelerateInterpolator
import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.MediaActivity.Companion.mMedia import com.simplemobiletools.gallery.activities.MediaActivity.Companion.mMedia
import com.simplemobiletools.gallery.adapters.MyPagerAdapter import com.simplemobiletools.gallery.adapters.MyPagerAdapter
import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask
import com.simplemobiletools.gallery.dialogs.DeleteWithRememberDialog
import com.simplemobiletools.gallery.dialogs.SaveAsDialog import com.simplemobiletools.gallery.dialogs.SaveAsDialog
import com.simplemobiletools.gallery.dialogs.SlideshowDialog import com.simplemobiletools.gallery.dialogs.SlideshowDialog
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
@ -50,6 +54,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private var mPos = -1 private var mPos = -1
private var mShowAll = false private var mShowAll = false
private var mIsSlideshowActive = false private var mIsSlideshowActive = false
private var mSkipConfirmationDialog = false
private var mRotationDegrees = 0f private var mRotationDegrees = 0f
private var mLastHandledOrientation = 0 private var mLastHandledOrientation = 0
private var mPrevHashcode = 0 private var mPrevHashcode = 0
@ -69,11 +74,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_medium) setContentView(R.layout.activity_medium)
if (!hasWriteStoragePermission()) { handlePermission(PERMISSION_WRITE_STORAGE) {
finish() if (it) {
return initViewPager()
} else {
toast(R.string.no_storage_permissions)
finish()
}
} }
}
private fun initViewPager() {
measureScreen() measureScreen()
val uri = intent.data val uri = intent.data
if (uri != null) { if (uri != null) {
@ -88,8 +99,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
cursor?.close() cursor?.close()
} }
} else { } else {
mPath = intent.getStringExtra(MEDIUM) try {
mShowAll = config.showAll mPath = intent.getStringExtra(MEDIUM)
mShowAll = config.showAll
} catch (e: Exception) {
showErrorToast(e)
finish()
return
}
} }
if (mPath.isEmpty()) { if (mPath.isEmpty()) {
@ -98,10 +115,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
return return
} }
if (intent.extras?.containsKey(IS_VIEW_INTENT) == true && File(mPath).isHidden) { if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) {
if (!config.isPasswordProtectionOn) { if (isShowHiddenFlagNeeded()) {
config.temporarilyShowHidden = true if (!config.isPasswordProtectionOn) {
config.temporarilyShowHidden = true
}
} }
config.isThirdPartyIntent = true
} }
showSystemUI() showSystemUI()
@ -109,17 +130,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
mDirectory = File(mPath).parent mDirectory = File(mPath).parent
title = mPath.getFilenameFromPath() title = mPath.getFilenameFromPath()
view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { view_pager.onGlobalLayout {
override fun onGlobalLayout() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) {
view_pager.viewTreeObserver.removeOnGlobalLayoutListener(this)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && isDestroyed)
return
if (mMedia.isNotEmpty()) { if (mMedia.isNotEmpty()) {
gotMedia(mMedia) gotMedia(mMedia)
} }
} }
}) }
reloadViewPager() reloadViewPager()
scanPath(mPath) {} scanPath(mPath) {}
@ -145,28 +162,32 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) { if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) {
config.temporarilyShowHidden = false config.temporarilyShowHidden = false
} }
if (config.isThirdPartyIntent) {
config.isThirdPartyIntent = false
if (intent.extras == null || !intent.getBooleanExtra(IS_FROM_GALLERY, false)) {
mMedia.clear()
}
}
} }
private fun setupOrientationEventListener() { private fun setupOrientationEventListener() {
mOrientationEventListener = object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) { mOrientationEventListener = object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) {
override fun onOrientationChanged(orientation: Int) { override fun onOrientationChanged(orientation: Int) {
val currOrient = if (orientation in 45..134) { val currOrient = when (orientation) {
ORIENT_LANDSCAPE_RIGHT in 45..134 -> ORIENT_LANDSCAPE_RIGHT
} else if (orientation in 225..314) { in 225..314 -> ORIENT_LANDSCAPE_LEFT
ORIENT_LANDSCAPE_LEFT else -> ORIENT_PORTRAIT
} else {
ORIENT_PORTRAIT
} }
if (mLastHandledOrientation != currOrient) { if (mLastHandledOrientation != currOrient) {
mLastHandledOrientation = currOrient mLastHandledOrientation = currOrient
if (currOrient == ORIENT_LANDSCAPE_LEFT) { requestedOrientation = when (currOrient) {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE ORIENT_LANDSCAPE_LEFT -> ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
} else if (currOrient == ORIENT_LANDSCAPE_RIGHT) { ORIENT_LANDSCAPE_RIGHT -> ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE else -> ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
} else {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
} }
} }
} }
@ -175,8 +196,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (!hasWriteStoragePermission()) { if (!hasPermission(PERMISSION_WRITE_STORAGE)) {
finish() finish()
return
} }
supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background)) supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background))
@ -233,7 +255,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
R.id.menu_unhide -> toggleFileVisibility(false) R.id.menu_unhide -> toggleFileVisibility(false)
R.id.menu_share_1 -> shareMedium(getCurrentMedium()!!) R.id.menu_share_1 -> shareMedium(getCurrentMedium()!!)
R.id.menu_share_2 -> shareMedium(getCurrentMedium()!!) R.id.menu_share_2 -> shareMedium(getCurrentMedium()!!)
R.id.menu_delete -> askConfirmDelete() R.id.menu_delete -> checkDeleteConfirmation()
R.id.menu_rename -> renameFile() R.id.menu_rename -> renameFile()
R.id.menu_edit -> openFileEditor(getCurrentFile()) R.id.menu_edit -> openFileEditor(getCurrentFile())
R.id.menu_properties -> showProperties() R.id.menu_properties -> showProperties()
@ -266,12 +288,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun startSlideshow() { private fun startSlideshow() {
if (getMediaForSlideshow()) { if (getMediaForSlideshow()) {
view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { view_pager.onGlobalLayout {
override fun onGlobalLayout() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) {
view_pager.viewTreeObserver.removeOnGlobalLayoutListener(this)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && isDestroyed)
return
hideSystemUI() hideSystemUI()
mSlideshowInterval = config.slideshowInterval mSlideshowInterval = config.slideshowInterval
mSlideshowMoveBackwards = config.slideshowMoveBackwards mSlideshowMoveBackwards = config.slideshowMoveBackwards
@ -279,7 +297,59 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
scheduleSwipe() scheduleSwipe()
} }
}) }
}
}
private fun animatePagerTransition(forward: Boolean) {
val oldPosition = view_pager.currentItem
val animator = ValueAnimator.ofInt(0, view_pager.width)
animator.addListener(object : Animator.AnimatorListener {
override fun onAnimationRepeat(animation: Animator?) {
}
override fun onAnimationEnd(animation: Animator?) {
view_pager.endFakeDrag()
if (view_pager.currentItem == oldPosition) {
slideshowEnded(forward)
}
}
override fun onAnimationCancel(animation: Animator?) {
view_pager.endFakeDrag()
}
override fun onAnimationStart(animation: Animator?) {
}
})
animator.interpolator = DecelerateInterpolator()
animator.addUpdateListener(object : ValueAnimator.AnimatorUpdateListener {
var oldDragPosition = 0
override fun onAnimationUpdate(animation: ValueAnimator) {
val dragPosition = animation.animatedValue as Int
val dragOffset = dragPosition - oldDragPosition
oldDragPosition = dragPosition
view_pager?.fakeDragBy(dragOffset * (if (forward) 1f else -1f))
}
})
animator.duration = SLIDESHOW_SCROLL_DURATION
view_pager.beginFakeDrag()
animator.start()
}
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 {
stopSlideshow()
toast(R.string.slideshow_ended)
} }
} }
@ -308,24 +378,23 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} }
private fun swipeToNextMedium() { private fun swipeToNextMedium() {
val before = view_pager.currentItem animatePagerTransition(!mSlideshowMoveBackwards)
view_pager.currentItem = if (mSlideshowMoveBackwards) --view_pager.currentItem else ++view_pager.currentItem
if (before == view_pager.currentItem) {
stopSlideshow()
toast(R.string.slideshow_ended)
}
} }
private fun getMediaForSlideshow(): Boolean { private fun getMediaForSlideshow(): Boolean {
mSlideshowMedia = mMedia.toMutableList() mSlideshowMedia = mMedia.toMutableList()
if (!config.slideshowIncludePhotos) { if (!config.slideshowIncludePhotos) {
mSlideshowMedia = mSlideshowMedia.filter { !it.isImage() && !it.isGif() } as MutableList mSlideshowMedia = mSlideshowMedia.filter { !it.isImage() } as MutableList
} }
if (!config.slideshowIncludeVideos) { if (!config.slideshowIncludeVideos) {
mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGif() } as MutableList mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGif() } as MutableList
} }
if (!config.slideshowIncludeGIFs) {
mSlideshowMedia = mSlideshowMedia.filter { !it.isGif() } as MutableList
}
if (config.slideshowRandomOrder) { if (config.slideshowRandomOrder) {
Collections.shuffle(mSlideshowMedia) Collections.shuffle(mSlideshowMedia)
mPos = 0 mPos = 0
@ -347,6 +416,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun copyMoveTo(isCopyOperation: Boolean) { private fun copyMoveTo(isCopyOperation: Boolean) {
val files = ArrayList<File>(1).apply { add(getCurrentFile()) } val files = ArrayList<File>(1).apply { add(getCurrentFile()) }
tryCopyMoveFilesTo(files, isCopyOperation) { tryCopyMoveFilesTo(files, isCopyOperation) {
config.tempFolderPath = ""
if (!isCopyOperation) { if (!isCopyOperation) {
reloadViewPager() reloadViewPager()
} }
@ -368,34 +438,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} }
private fun rotateImage() { private fun rotateImage() {
val currentMedium = getCurrentMedium() ?: return
if (currentMedium.isJpg() && !isPathOnSD(currentMedium.path)) {
rotateByExif()
} else {
rotateByDegrees()
}
}
private fun rotateByExif() {
val exif = ExifInterface(getCurrentPath())
val rotation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL)
val newRotation = getNewRotation(rotation)
exif.setAttribute(ExifInterface.TAG_ORIENTATION, newRotation)
exif.saveAttributes()
File(getCurrentPath()).setLastModified(System.currentTimeMillis())
(getCurrentFragment() as? PhotoFragment)?.refreshBitmap()
}
private fun getNewRotation(rotation: Int): String {
return when (rotation) {
ExifInterface.ORIENTATION_ROTATE_90 -> ExifInterface.ORIENTATION_ROTATE_180
ExifInterface.ORIENTATION_ROTATE_180 -> ExifInterface.ORIENTATION_ROTATE_270
ExifInterface.ORIENTATION_ROTATE_270 -> ExifInterface.ORIENTATION_NORMAL
else -> ExifInterface.ORIENTATION_ROTATE_90
}.toString()
}
private fun rotateByDegrees() {
mRotationDegrees = (mRotationDegrees + 90) % 360 mRotationDegrees = (mRotationDegrees + 90) % 360
getCurrentFragment()?.let { getCurrentFragment()?.let {
(it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees) (it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees)
@ -409,10 +451,16 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
Thread({ Thread({
toast(R.string.saving) toast(R.string.saving)
val selectedFile = File(it) val selectedFile = File(it)
val tmpFile = File(selectedFile.parent, "tmp_${it.getFilenameFromPath()}") val tmpFile = File(selectedFile.parent, ".tmp_${it.getFilenameFromPath()}")
try { try {
val bitmap = BitmapFactory.decodeFile(currPath) val bitmap = BitmapFactory.decodeFile(currPath)
getFileOutputStream(tmpFile) { getFileOutputStream(tmpFile) {
if (it == null) {
toast(R.string.unknown_error_occurred)
deleteFile(tmpFile) {}
return@getFileOutputStream
}
saveFile(tmpFile, bitmap, it) saveFile(tmpFile, bitmap, it)
if (needsStupidWritePermissions(selectedFile.absolutePath)) { if (needsStupidWritePermissions(selectedFile.absolutePath)) {
deleteFile(selectedFile) {} deleteFile(selectedFile) {}
@ -426,7 +474,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
toast(R.string.out_of_memory_error) toast(R.string.out_of_memory_error)
deleteFile(tmpFile) {} deleteFile(tmpFile) {}
} catch (e: Exception) { } catch (e: Exception) {
toast(R.string.unknown_error_occurred) showErrorToast(e)
deleteFile(tmpFile) {} deleteFile(tmpFile) {}
} }
}).start() }).start()
@ -439,8 +487,30 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val bmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) val bmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true)
bmp.compress(file.getCompressionFormat(), 90, out) bmp.compress(file.getCompressionFormat(), 90, out)
out.flush() out.flush()
toast(R.string.file_saved)
out.close() out.close()
toast(R.string.file_saved)
mRotationDegrees = 0f
invalidateOptionsMenu()
}
private fun isShowHiddenFlagNeeded(): Boolean {
val file = File(mPath)
if (file.isHidden)
return true
var parent = file.parentFile ?: return false
while (true) {
if (parent.isHidden || parent.listFiles()?.contains(File(NOMEDIA)) == true) {
return true
}
if (parent.absolutePath == "/") {
break
}
parent = parent.parentFile ?: return false
}
return false
} }
private fun getCurrentFragment() = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem) private fun getCurrentFragment() = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem)
@ -521,11 +591,24 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
super.onActivityResult(requestCode, resultCode, resultData) super.onActivityResult(requestCode, resultCode, resultData)
} }
private fun checkDeleteConfirmation() {
if (mSkipConfirmationDialog) {
deleteConfirmed()
} else {
askConfirmDelete()
}
}
private fun askConfirmDelete() { private fun askConfirmDelete() {
ConfirmationDialog(this) { DeleteWithRememberDialog(this) {
deleteFileBg(File(getCurrentMedia()[mPos].path)) { mSkipConfirmationDialog = it
reloadViewPager() deleteConfirmed()
} }
}
private fun deleteConfirmed() {
deleteFileBg(File(getCurrentMedia()[mPos].path)) {
reloadViewPager()
} }
} }
@ -534,8 +617,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
deleteDirectoryIfEmpty() deleteDirectoryIfEmpty()
finish() finish()
true true
} else } else {
false false
}
} }
private fun renameFile() { private fun renameFile() {
@ -576,10 +660,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
mPrevHashcode = media.hashCode() mPrevHashcode = media.hashCode()
mMedia = media mMedia = media
if (mPos == -1) { mPos = if (mPos == -1) {
mPos = getPositionInList(media) getPositionInList(media)
} else { } else {
mPos = Math.min(mPos, mMedia.size - 1) Math.min(mPos, mMedia.size - 1)
} }
updateActionbarTitle() updateActionbarTitle()
@ -590,20 +674,18 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun getPositionInList(items: MutableList<Medium>): Int { private fun getPositionInList(items: MutableList<Medium>): Int {
mPos = 0 mPos = 0
var i = 0 for ((i, medium) in items.withIndex()) {
for (medium in items) {
if (medium.path == mPath) { if (medium.path == mPath) {
return i return i
} }
i++
} }
return mPos return mPos
} }
private fun deleteDirectoryIfEmpty() { private fun deleteDirectoryIfEmpty() {
val file = File(mDirectory) val file = File(mDirectory)
if (!file.isDownloadsFolder() && file.isDirectory && file.listFiles()?.isEmpty() == true) { if (config.deleteEmptyFolders && !file.isDownloadsFolder() && file.isDirectory && file.listFiles()?.isEmpty() == true) {
file.delete() deleteFile(file, true) {}
} }
scanPath(mDirectory) {} scanPath(mDirectory) {}

View file

@ -1,6 +1,7 @@
package com.simplemobiletools.gallery.adapters package com.simplemobiletools.gallery.adapters
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.os.Build
import android.support.v7.view.ActionMode import android.support.v7.view.ActionMode
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.util.SparseArray import android.util.SparseArray
@ -19,9 +20,10 @@ import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog
import com.simplemobiletools.gallery.dialogs.PickMediumDialog import com.simplemobiletools.gallery.dialogs.PickMediumDialog
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST
import com.simplemobiletools.gallery.models.AlbumCover import com.simplemobiletools.gallery.models.AlbumCover
import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Directory
import kotlinx.android.synthetic.main.directory_item.view.* import kotlinx.android.synthetic.main.directory_item_list.view.*
import java.io.File import java.io.File
import java.util.* import java.util.*
@ -30,11 +32,13 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
val multiSelector = MultiSelector() val multiSelector = MultiSelector()
val config = activity.config val config = activity.config
val isListViewType = config.viewTypeFolders == VIEW_TYPE_LIST
var actMode: ActionMode? = null var actMode: ActionMode? = null
var itemViews = SparseArray<View>() var itemViews = SparseArray<View>()
val selectedPositions = HashSet<Int>() val selectedPositions = HashSet<Int>()
var primaryColor = config.primaryColor var primaryColor = config.primaryColor
var textColor = config.textColor
var pinnedFolders = config.pinnedFolders var pinnedFolders = config.pinnedFolders
var scrollVertically = !config.scrollHorizontally var scrollVertically = !config.scrollHorizontally
@ -42,8 +46,9 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
if (select) { if (select) {
itemViews[pos]?.dir_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN) itemViews[pos]?.dir_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
selectedPositions.add(pos) selectedPositions.add(pos)
} else } else {
selectedPositions.remove(pos) selectedPositions.remove(pos)
}
itemViews[pos]?.dir_check?.beVisibleIf(select) itemViews[pos]?.dir_check?.beVisibleIf(select)
@ -55,12 +60,12 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
updateTitle(selectedPositions.size) updateTitle(selectedPositions.size)
} }
fun updateTitle(cnt: Int) { private fun updateTitle(cnt: Int) {
actMode?.title = "$cnt / ${dirs.size}" actMode?.title = "$cnt / ${dirs.size}"
actMode?.invalidate() actMode?.invalidate()
} }
val adapterListener = object : MyAdapterListener { private val adapterListener = object : MyAdapterListener {
override fun toggleItemSelectionAdapter(select: Boolean, position: Int) { override fun toggleItemSelectionAdapter(select: Boolean, position: Int) {
toggleItemSelection(select, position) toggleItemSelection(select, position)
} }
@ -68,7 +73,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
override fun getSelectedPositions(): HashSet<Int> = selectedPositions override fun getSelectedPositions(): HashSet<Int> = selectedPositions
} }
val multiSelectorMode = object : ModalMultiSelectorCallback(multiSelector) { private val multiSelectorMode = object : ModalMultiSelectorCallback(multiSelector) {
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.cab_properties -> showProperties() R.id.cab_properties -> showProperties()
@ -118,11 +123,12 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
fun checkHideBtnVisibility(menu: Menu) { fun checkHideBtnVisibility(menu: Menu) {
var hiddenCnt = 0 var hiddenCnt = 0
var unhiddenCnt = 0 var unhiddenCnt = 0
selectedPositions.map { dirs.getOrNull(it)?.path }.filterNotNull().forEach { selectedPositions.mapNotNull { dirs.getOrNull(it)?.path }.forEach {
if (File(it).containsNoMedia()) if (File(it).containsNoMedia()) {
hiddenCnt++ hiddenCnt++
else } else {
unhiddenCnt++ unhiddenCnt++
}
} }
menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0 menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0
@ -133,11 +139,12 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
val pinnedFolders = config.pinnedFolders val pinnedFolders = config.pinnedFolders
var pinnedCnt = 0 var pinnedCnt = 0
var unpinnedCnt = 0 var unpinnedCnt = 0
selectedPositions.map { dirs.getOrNull(it)?.path }.filterNotNull().forEach { selectedPositions.mapNotNull { dirs.getOrNull(it)?.path }.forEach {
if (pinnedFolders.contains(it)) if (pinnedFolders.contains(it)) {
pinnedCnt++ pinnedCnt++
else } else {
unpinnedCnt++ unpinnedCnt++
}
} }
menu.findItem(R.id.cab_pin).isVisible = unpinnedCnt > 0 menu.findItem(R.id.cab_pin).isVisible = unpinnedCnt > 0
@ -211,13 +218,14 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
} }
private fun pinFolders(pin: Boolean) { private fun pinFolders(pin: Boolean) {
if (pin) if (pin) {
config.addPinnedFolders(getSelectedPaths()) config.addPinnedFolders(getSelectedPaths())
else } else {
config.removePinnedFolders(getSelectedPaths()) config.removePinnedFolders(getSelectedPaths())
}
pinnedFolders = config.pinnedFolders pinnedFolders = config.pinnedFolders
listener?.refreshItems() listener?.recheckPinnedFolders()
notifyDataSetChanged() notifyDataSetChanged()
actMode?.finish() actMode?.finish()
} }
@ -233,6 +241,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
} }
activity.tryCopyMoveFilesTo(files, isCopyOperation) { activity.tryCopyMoveFilesTo(files, isCopyOperation) {
config.tempFolderPath = ""
listener?.refreshItems() listener?.refreshItems()
actMode?.finish() actMode?.finish()
} }
@ -240,7 +249,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
fun selectAll() { fun selectAll() {
val cnt = dirs.size val cnt = dirs.size
for (i in 0..cnt - 1) { for (i in 0 until cnt) {
selectedPositions.add(i) selectedPositions.add(i)
notifyItemChanged(i) notifyItemChanged(i)
} }
@ -250,7 +259,6 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
private fun askConfirmDelete() { private fun askConfirmDelete() {
ConfirmationDialog(activity) { ConfirmationDialog(activity) {
deleteFiles() deleteFiles()
actMode?.finish()
} }
} }
@ -284,15 +292,12 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
listener?.tryDeleteFolders(folders) listener?.tryDeleteFolders(folders)
val newItems = SparseArray<View>() val newItems = SparseArray<View>()
var curIndex = 0 (0 until itemViews.size())
for (i in 0..itemViews.size() - 1) { .filter { itemViews[it] != null }
if (itemViews[i] != null) { .forEachIndexed { curIndex, i -> newItems.put(curIndex, itemViews[i]) }
newItems.put(curIndex, itemViews[i])
curIndex++
}
}
itemViews = newItems itemViews = newItems
actMode?.finish()
} }
} }
@ -301,20 +306,30 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
return return
val path = dirs[selectedPositions.first()].path val path = dirs[selectedPositions.first()].path
var albumCovers = config.parseAlbumCovers()
if (useDefault) { if (useDefault) {
albumCovers = albumCovers.filterNot { it.path == path } as ArrayList val albumCovers = getAlbumCoversWithout(path)
storeCovers(albumCovers) storeCovers(albumCovers)
} else { } else {
PickMediumDialog(activity, path) { pickMediumFrom(path, path)
albumCovers = albumCovers.filterNot { it.path == path } as ArrayList }
albumCovers.add(AlbumCover(path, it)) }
private fun pickMediumFrom(targetFolder: String, path: String) {
PickMediumDialog(activity, path) {
if (File(it).isDirectory) {
pickMediumFrom(targetFolder, it)
} else {
val albumCovers = getAlbumCoversWithout(path)
val cover = AlbumCover(targetFolder, it)
albumCovers.add(cover)
storeCovers(albumCovers) storeCovers(albumCovers)
} }
} }
} }
private fun getAlbumCoversWithout(path: String) = config.parseAlbumCovers().filterNot { it.path == path } as ArrayList
private fun storeCovers(albumCovers: ArrayList<AlbumCover>) { private fun storeCovers(albumCovers: ArrayList<AlbumCover>) {
activity.config.albumCovers = Gson().toJson(albumCovers) activity.config.albumCovers = Gson().toJson(albumCovers)
actMode?.finish() actMode?.finish()
@ -328,13 +343,14 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
} }
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent?.context).inflate(R.layout.directory_item, parent, false) val layoutType = if (isListViewType) R.layout.directory_item_list else R.layout.directory_item_grid
val view = LayoutInflater.from(parent?.context).inflate(layoutType, parent, false)
return ViewHolder(view, adapterListener, activity, multiSelectorMode, multiSelector, listener, isPickIntent, itemClick) return ViewHolder(view, adapterListener, activity, multiSelectorMode, multiSelector, listener, isPickIntent, itemClick)
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val dir = dirs[position] val dir = dirs[position]
itemViews.put(position, holder.bindView(dir, pinnedFolders.contains(dir.path), scrollVertically)) itemViews.put(position, holder.bindView(dir, pinnedFolders.contains(dir.path), scrollVertically, isListViewType, textColor))
toggleItemSelection(selectedPositions.contains(position), position) toggleItemSelection(selectedPositions.contains(position), position)
holder.itemView.tag = holder holder.itemView.tag = holder
} }
@ -349,6 +365,12 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
fun updateDirs(newDirs: ArrayList<Directory>) { fun updateDirs(newDirs: ArrayList<Directory>) {
dirs = newDirs dirs = newDirs
notifyDataSetChanged() notifyDataSetChanged()
actMode?.finish()
}
fun updateTextColor(textColor: Int) {
this.textColor = textColor
notifyDataSetChanged()
} }
fun selectItem(pos: Int) { fun selectItem(pos: Int) {
@ -367,7 +389,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
toggleItemSelection(true, i) toggleItemSelection(true, i)
if (min > -1 && min < to) { if (min > -1 && min < to) {
(min..to - 1).filter { it != from } (min until to).filter { it != from }
.forEach { toggleItemSelection(false, it) } .forEach { toggleItemSelection(false, it) }
} }
if (max > -1) { if (max > -1) {
@ -384,7 +406,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
} }
if (min > -1) { if (min > -1) {
for (i in min..from - 1) for (i in min until from)
toggleItemSelection(false, i) toggleItemSelection(false, i)
} }
} }
@ -393,44 +415,51 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
class ViewHolder(val view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, class ViewHolder(val view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback,
val multiSelector: MultiSelector, val listener: DirOperationsListener?, val isPickIntent: Boolean, val itemClick: (Directory) -> (Unit)) : val multiSelector: MultiSelector, val listener: DirOperationsListener?, val isPickIntent: Boolean, val itemClick: (Directory) -> (Unit)) :
SwappingHolder(view, MultiSelector()) { SwappingHolder(view, MultiSelector()) {
fun bindView(directory: Directory, isPinned: Boolean, scrollVertically: Boolean): View { fun bindView(directory: Directory, isPinned: Boolean, scrollVertically: Boolean, isListView: Boolean, textColor: Int): View {
itemView.apply { itemView.apply {
dir_name.text = directory.name dir_name.text = directory.name
dir_path?.text = "${directory.path.substringBeforeLast("/")}/"
photo_cnt.text = directory.mediaCnt.toString() photo_cnt.text = directory.mediaCnt.toString()
activity.loadImage(directory.tmb, dir_thumbnail, scrollVertically) activity.loadImage(directory.tmb, dir_thumbnail, scrollVertically)
dir_pin.beVisibleIf(isPinned) dir_pin.beVisibleIf(isPinned)
dir_sd_card.beVisibleIf(activity.isPathOnSD(directory.path)) dir_sd_card.beVisibleIf(activity.isPathOnSD(directory.path))
if (isListView) {
dir_name.setTextColor(textColor)
dir_path.setTextColor(textColor)
photo_cnt.setTextColor(textColor)
dir_pin.setColorFilter(textColor, PorterDuff.Mode.SRC_IN)
dir_sd_card.setColorFilter(textColor, PorterDuff.Mode.SRC_IN)
}
setOnClickListener { viewClicked(directory) } setOnClickListener { viewClicked(directory) }
setOnLongClickListener { if (isPickIntent) viewClicked(directory) else viewLongClicked(); true } setOnLongClickListener { if (isPickIntent) viewClicked(directory) else viewLongClicked(); true }
} }
return itemView return itemView
} }
fun viewClicked(directory: Directory) { private fun viewClicked(directory: Directory) {
if (multiSelector.isSelectable) { if (multiSelector.isSelectable) {
val isSelected = adapterListener.getSelectedPositions().contains(layoutPosition) val isSelected = adapterListener.getSelectedPositions().contains(adapterPosition)
adapterListener.toggleItemSelectionAdapter(!isSelected, layoutPosition) adapterListener.toggleItemSelectionAdapter(!isSelected, adapterPosition)
} else { } else {
itemClick(directory) itemClick(directory)
} }
} }
fun viewLongClicked() { private fun viewLongClicked() {
if (listener != null) { if (listener != null) {
if (!multiSelector.isSelectable) { if (!multiSelector.isSelectable) {
activity.startSupportActionMode(multiSelectorCallback) activity.startSupportActionMode(multiSelectorCallback)
adapterListener.toggleItemSelectionAdapter(true, layoutPosition) adapterListener.toggleItemSelectionAdapter(true, adapterPosition)
} }
listener.itemLongClicked(layoutPosition) listener.itemLongClicked(adapterPosition)
} }
} }
fun stopLoad() { fun stopLoad() {
if (!activity.isDestroyed) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !activity.isDestroyed)
Glide.with(activity).clear(view.dir_thumbnail) Glide.with(activity).clear(view.dir_thumbnail)
} }
} }
@ -447,5 +476,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
fun tryDeleteFolders(folders: ArrayList<File>) fun tryDeleteFolders(folders: ArrayList<File>)
fun itemLongClicked(position: Int) fun itemLongClicked(position: Int)
fun recheckPinnedFolders()
} }
} }

View file

@ -1,6 +1,7 @@
package com.simplemobiletools.gallery.adapters package com.simplemobiletools.gallery.adapters
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.os.Build
import android.support.v7.view.ActionMode import android.support.v7.view.ActionMode
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.util.SparseArray import android.util.SparseArray
@ -9,29 +10,33 @@ import com.bignerdranch.android.multiselector.ModalMultiSelectorCallback
import com.bignerdranch.android.multiselector.MultiSelector import com.bignerdranch.android.multiselector.MultiSelector
import com.bignerdranch.android.multiselector.SwappingHolder import com.bignerdranch.android.multiselector.SwappingHolder
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog
import com.simplemobiletools.commons.extensions.beGone import com.simplemobiletools.commons.extensions.beGone
import com.simplemobiletools.commons.extensions.beVisibleIf import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.dialogs.DeleteWithRememberDialog
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.photo_video_item.view.* import kotlinx.android.synthetic.main.photo_video_item_grid.view.*
import java.io.File import java.io.File
import java.util.* import java.util.*
class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>, val listener: MediaOperationsListener?, val isPickIntent: Boolean, class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>, val listener: MediaOperationsListener?, val isPickIntent: Boolean,
val itemClick: (Medium) -> Unit) : RecyclerView.Adapter<MediaAdapter.ViewHolder>() { val allowMultiplePicks: Boolean, val itemClick: (Medium) -> Unit) : RecyclerView.Adapter<MediaAdapter.ViewHolder>() {
val multiSelector = MultiSelector() val multiSelector = MultiSelector()
val config = activity.config val config = activity.config
val isListViewType = config.viewTypeFiles == VIEW_TYPE_LIST
var skipConfirmationDialog = false
var actMode: ActionMode? = null var actMode: ActionMode? = null
var itemViews = SparseArray<View>() var itemViews = SparseArray<View>()
val selectedPositions = HashSet<Int>() val selectedPositions = HashSet<Int>()
var primaryColor = config.primaryColor var primaryColor = config.primaryColor
var textColor = config.textColor
var displayFilenames = config.displayFileNames var displayFilenames = config.displayFileNames
var scrollVertically = !config.scrollHorizontally var scrollVertically = !config.scrollHorizontally
@ -39,8 +44,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
if (select) { if (select) {
itemViews[pos]?.medium_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN) itemViews[pos]?.medium_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
selectedPositions.add(pos) selectedPositions.add(pos)
} else } else {
selectedPositions.remove(pos) selectedPositions.remove(pos)
}
itemViews[pos]?.medium_check?.beVisibleIf(select) itemViews[pos]?.medium_check?.beVisibleIf(select)
@ -52,12 +58,12 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
updateTitle(selectedPositions.size) updateTitle(selectedPositions.size)
} }
fun updateTitle(cnt: Int) { private fun updateTitle(cnt: Int) {
actMode?.title = "$cnt / ${media.size}" actMode?.title = "$cnt / ${media.size}"
actMode?.invalidate() actMode?.invalidate()
} }
val adapterListener = object : MyAdapterListener { private val adapterListener = object : MyAdapterListener {
override fun toggleItemSelectionAdapter(select: Boolean, position: Int) { override fun toggleItemSelectionAdapter(select: Boolean, position: Int) {
toggleItemSelection(select, position) toggleItemSelection(select, position)
} }
@ -65,9 +71,10 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
override fun getSelectedPositions(): HashSet<Int> = selectedPositions override fun getSelectedPositions(): HashSet<Int> = selectedPositions
} }
val multiSelectorMode = object : ModalMultiSelectorCallback(multiSelector) { private val multiSelectorMode = object : ModalMultiSelectorCallback(multiSelector) {
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.cab_confirm_selection -> confirmSelection()
R.id.cab_properties -> showProperties() R.id.cab_properties -> showProperties()
R.id.cab_rename -> renameFile() R.id.cab_rename -> renameFile()
R.id.cab_edit -> editFile() R.id.cab_edit -> editFile()
@ -77,7 +84,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
R.id.cab_copy_to -> copyMoveTo(true) R.id.cab_copy_to -> copyMoveTo(true)
R.id.cab_move_to -> copyMoveTo(false) R.id.cab_move_to -> copyMoveTo(false)
R.id.cab_select_all -> selectAll() R.id.cab_select_all -> selectAll()
R.id.cab_delete -> askConfirmDelete() R.id.cab_delete -> checkDeleteConfirmation()
else -> return false else -> return false
} }
return true return true
@ -93,6 +100,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean { override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean {
menu.findItem(R.id.cab_rename).isVisible = selectedPositions.size <= 1 menu.findItem(R.id.cab_rename).isVisible = selectedPositions.size <= 1
menu.findItem(R.id.cab_edit).isVisible = selectedPositions.size == 1 && media.size > selectedPositions.first() && media[selectedPositions.first()].isImage() menu.findItem(R.id.cab_edit).isVisible = selectedPositions.size == 1 && media.size > selectedPositions.first() && media[selectedPositions.first()].isImage()
menu.findItem(R.id.cab_confirm_selection).isVisible = isPickIntent && allowMultiplePicks && selectedPositions.size > 0
checkHideBtnVisibility(menu) checkHideBtnVisibility(menu)
@ -111,11 +119,12 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
fun checkHideBtnVisibility(menu: Menu) { fun checkHideBtnVisibility(menu: Menu) {
var hiddenCnt = 0 var hiddenCnt = 0
var unhiddenCnt = 0 var unhiddenCnt = 0
selectedPositions.map { media.getOrNull(it) }.filterNotNull().forEach { selectedPositions.mapNotNull { media.getOrNull(it) }.forEach {
if (it.name.startsWith('.')) if (it.name.startsWith('.')) {
hiddenCnt++ hiddenCnt++
else } else {
unhiddenCnt++ unhiddenCnt++
}
} }
menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0 menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0
@ -123,6 +132,11 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
} }
} }
private fun confirmSelection() {
val paths = getSelectedMedia().map { it.path } as ArrayList<String>
listener?.selectedPaths(paths)
}
private fun showProperties() { private fun showProperties() {
if (selectedPositions.size <= 1) { if (selectedPositions.size <= 1) {
PropertiesDialog(activity, media[selectedPositions.first()].path, config.shouldShowHidden) PropertiesDialog(activity, media[selectedPositions.first()].path, config.shouldShowHidden)
@ -161,9 +175,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
} }
private fun shareMedia() { private fun shareMedia() {
if (selectedPositions.size <= 1) { if (selectedPositions.size == 1 && selectedPositions.first() != -1) {
activity.shareMedium(getSelectedMedia()[0]) activity.shareMedium(getSelectedMedia()[0])
} else { } else if (selectedPositions.size > 1) {
activity.shareMedia(getSelectedMedia()) activity.shareMedia(getSelectedMedia())
} }
} }
@ -173,6 +187,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
selectedPositions.forEach { files.add(File(media[it].path)) } selectedPositions.forEach { files.add(File(media[it].path)) }
activity.tryCopyMoveFilesTo(files, isCopyOperation) { activity.tryCopyMoveFilesTo(files, isCopyOperation) {
config.tempFolderPath = ""
if (!isCopyOperation) { if (!isCopyOperation) {
listener?.refreshItems() listener?.refreshItems()
} }
@ -182,7 +197,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
fun selectAll() { fun selectAll() {
val cnt = media.size val cnt = media.size
for (i in 0..cnt - 1) { for (i in 0 until cnt) {
selectedPositions.add(i) selectedPositions.add(i)
multiSelector.setSelected(i, 0, true) multiSelector.setSelected(i, 0, true)
notifyItemChanged(i) notifyItemChanged(i)
@ -190,18 +205,31 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
updateTitle(cnt) updateTitle(cnt)
} }
private fun askConfirmDelete() { private fun checkDeleteConfirmation() {
ConfirmationDialog(activity) { if (skipConfirmationDialog) {
deleteFiles() deleteConfirmed()
actMode?.finish() } else {
askConfirmDelete()
} }
} }
private fun askConfirmDelete() {
DeleteWithRememberDialog(activity) {
skipConfirmationDialog = it
deleteConfirmed()
}
}
private fun deleteConfirmed() {
deleteFiles()
}
private fun getCurrentFile() = File(media[selectedPositions.first()].path) private fun getCurrentFile() = File(media[selectedPositions.first()].path)
private fun deleteFiles() { private fun deleteFiles() {
if (selectedPositions.isEmpty()) if (selectedPositions.isEmpty()) {
return return
}
val files = ArrayList<File>(selectedPositions.size) val files = ArrayList<File>(selectedPositions.size)
val removeMedia = ArrayList<Medium>(selectedPositions.size) val removeMedia = ArrayList<Medium>(selectedPositions.size)
@ -225,15 +253,12 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
listener?.deleteFiles(files) listener?.deleteFiles(files)
val newItems = SparseArray<View>() val newItems = SparseArray<View>()
var curIndex = 0 (0 until itemViews.size())
for (i in 0..itemViews.size() - 1) { .filter { itemViews[it] != null }
if (itemViews[i] != null) { .forEachIndexed { curIndex, i -> newItems.put(curIndex, itemViews[i]) }
newItems.put(curIndex, itemViews[i])
curIndex++
}
}
itemViews = newItems itemViews = newItems
actMode?.finish()
} }
} }
@ -244,12 +269,13 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
} }
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent?.context).inflate(R.layout.photo_video_item, parent, false) val layoutType = if (isListViewType) R.layout.photo_video_item_list else R.layout.photo_video_item_grid
return ViewHolder(view, adapterListener, activity, multiSelectorMode, multiSelector, listener, isPickIntent, itemClick) val view = LayoutInflater.from(parent?.context).inflate(layoutType, parent, false)
return ViewHolder(view, adapterListener, activity, multiSelectorMode, multiSelector, listener, allowMultiplePicks || !isPickIntent, itemClick)
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
itemViews.put(position, holder.bindView(media[position], displayFilenames, scrollVertically)) itemViews.put(position, holder.bindView(media[position], displayFilenames, scrollVertically, isListViewType, textColor))
toggleItemSelection(selectedPositions.contains(position), position) toggleItemSelection(selectedPositions.contains(position), position)
holder.itemView.tag = holder holder.itemView.tag = holder
} }
@ -264,6 +290,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
fun updateMedia(newMedia: ArrayList<Medium>) { fun updateMedia(newMedia: ArrayList<Medium>) {
media = newMedia media = newMedia
notifyDataSetChanged() notifyDataSetChanged()
actMode?.finish()
} }
fun updateDisplayFilenames(display: Boolean) { fun updateDisplayFilenames(display: Boolean) {
@ -271,6 +298,11 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
notifyDataSetChanged() notifyDataSetChanged()
} }
fun updateTextColor(textColor: Int) {
this.textColor = textColor
notifyDataSetChanged()
}
fun selectItem(pos: Int) { fun selectItem(pos: Int) {
toggleItemSelection(true, pos) toggleItemSelection(true, pos)
} }
@ -287,7 +319,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
toggleItemSelection(true, i) toggleItemSelection(true, i)
if (min > -1 && min < to) { if (min > -1 && min < to) {
(min..to - 1).filter { it != from } (min until to).filter { it != from }
.forEach { toggleItemSelection(false, it) } .forEach { toggleItemSelection(false, it) }
} }
if (max > -1) { if (max > -1) {
@ -304,50 +336,56 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
} }
if (min > -1) { if (min > -1) {
for (i in min..from - 1) for (i in min until from)
toggleItemSelection(false, i) toggleItemSelection(false, i)
} }
} }
} }
class ViewHolder(val view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, class ViewHolder(val view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback,
val multiSelector: MultiSelector, val listener: MediaOperationsListener?, val isPickIntent: Boolean, val itemClick: (Medium) -> (Unit)) : val multiSelector: MultiSelector, val listener: MediaOperationsListener?, val allowMultiplePicks: Boolean,
val itemClick: (Medium) -> (Unit)) :
SwappingHolder(view, MultiSelector()) { SwappingHolder(view, MultiSelector()) {
fun bindView(medium: Medium, displayFilenames: Boolean, scrollVertically: Boolean): View { fun bindView(medium: Medium, displayFilenames: Boolean, scrollVertically: Boolean, isListViewType: Boolean, textColor: Int): View {
itemView.apply { itemView.apply {
play_outline.visibility = if (medium.video) View.VISIBLE else View.GONE play_outline.visibility = if (medium.video) View.VISIBLE else View.GONE
photo_name.beVisibleIf(displayFilenames) photo_name.beVisibleIf(displayFilenames || isListViewType)
photo_name.text = medium.name photo_name.text = medium.name
activity.loadImage(medium.path, medium_thumbnail, scrollVertically) activity.loadImage(medium.path, medium_thumbnail, scrollVertically)
if (isListViewType) {
photo_name.setTextColor(textColor)
play_outline.setColorFilter(textColor, PorterDuff.Mode.SRC_IN)
}
setOnClickListener { viewClicked(medium) } setOnClickListener { viewClicked(medium) }
setOnLongClickListener { if (isPickIntent) viewClicked(medium) else viewLongClicked(); true } setOnLongClickListener { if (allowMultiplePicks) viewLongClicked() else viewClicked(medium); true }
} }
return itemView return itemView
} }
fun viewClicked(medium: Medium) { private fun viewClicked(medium: Medium) {
if (multiSelector.isSelectable) { if (multiSelector.isSelectable) {
val isSelected = adapterListener.getSelectedPositions().contains(layoutPosition) val isSelected = adapterListener.getSelectedPositions().contains(adapterPosition)
adapterListener.toggleItemSelectionAdapter(!isSelected, layoutPosition) adapterListener.toggleItemSelectionAdapter(!isSelected, adapterPosition)
} else { } else {
itemClick(medium) itemClick(medium)
} }
} }
fun viewLongClicked() { private fun viewLongClicked() {
if (listener != null) { if (listener != null) {
if (!multiSelector.isSelectable) { if (!multiSelector.isSelectable) {
activity.startSupportActionMode(multiSelectorCallback) activity.startSupportActionMode(multiSelectorCallback)
adapterListener.toggleItemSelectionAdapter(true, layoutPosition) adapterListener.toggleItemSelectionAdapter(true, adapterPosition)
} }
listener.itemLongClicked(layoutPosition) listener.itemLongClicked(adapterPosition)
} }
} }
fun stopLoad() { fun stopLoad() {
if (!activity.isDestroyed) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !activity.isDestroyed)
Glide.with(activity).clear(view.medium_thumbnail) Glide.with(activity).clear(view.medium_thumbnail)
} }
} }
@ -364,5 +402,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
fun deleteFiles(files: ArrayList<File>) fun deleteFiles(files: ArrayList<File>)
fun itemLongClicked(position: Int) fun itemLongClicked(position: Int)
fun selectedPaths(paths: ArrayList<String>)
} }
} }

View file

@ -3,126 +3,74 @@ package com.simplemobiletools.gallery.asynctasks
import android.content.Context import android.content.Context
import android.os.AsyncTask import android.os.AsyncTask
import com.simplemobiletools.commons.extensions.getFilenameFromPath import com.simplemobiletools.commons.extensions.getFilenameFromPath
import com.simplemobiletools.commons.extensions.hasWriteStoragePermission import com.simplemobiletools.commons.extensions.hasPermission
import com.simplemobiletools.commons.extensions.internalStoragePath import com.simplemobiletools.commons.extensions.internalStoragePath
import com.simplemobiletools.commons.extensions.sdCardPath import com.simplemobiletools.commons.extensions.sdCardPath
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.containsNoMedia import com.simplemobiletools.gallery.extensions.containsNoMedia
import com.simplemobiletools.gallery.extensions.getFilesFrom import com.simplemobiletools.gallery.extensions.sumByLong
import com.simplemobiletools.gallery.helpers.MediaFetcher
import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Directory
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
import java.io.File import java.io.File
import java.util.*
class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, val isPickImage: Boolean, class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, val isPickImage: Boolean,
val callback: (dirs: ArrayList<Directory>) -> Unit) : AsyncTask<Void, Void, ArrayList<Directory>>() { val callback: (dirs: ArrayList<Directory>) -> Unit) : AsyncTask<Void, Void, ArrayList<Directory>>() {
var config = context.config val mediaFetcher = MediaFetcher(context)
var shouldStop = false
val showHidden = config.shouldShowHidden
override fun doInBackground(vararg params: Void): ArrayList<Directory> { override fun doInBackground(vararg params: Void): ArrayList<Directory> {
if (!context.hasWriteStoragePermission()) if (!context.hasPermission(PERMISSION_WRITE_STORAGE))
return ArrayList() return ArrayList()
val media = context.getFilesFrom("", isPickImage, isPickVideo) val config = context.config
val excludedPaths = config.excludedFolders val groupedMedia = mediaFetcher.getMediaByDirectories(isPickVideo, isPickImage)
val includedPaths = config.includedFolders val directories = ArrayList<Directory>()
val directories = groupDirectories(media)
val dirs = ArrayList(directories.values
.filter { File(it.path).exists() })
.filter { shouldFolderBeVisible(it.path, excludedPaths, includedPaths) } as ArrayList<Directory>
Directory.sorting = config.directorySorting
dirs.sort()
return movePinnedToFront(dirs)
}
private fun groupDirectories(media: ArrayList<Medium>): Map<String, Directory> {
val albumCovers = config.parseAlbumCovers()
val hidden = context.resources.getString(R.string.hidden) val hidden = context.resources.getString(R.string.hidden)
val directories = LinkedHashMap<String, Directory>() val albumCovers = config.parseAlbumCovers()
for ((name, path, isVideo, dateModified, dateTaken, size) in media) { for ((path, curMedia) in groupedMedia) {
if (shouldStop) Medium.sorting = config.getFileSorting(path)
cancel(true) curMedia.sort()
val parentDir = File(path).parent ?: continue val firstItem = curMedia.first()
if (directories.containsKey(parentDir.toLowerCase())) { val lastItem = curMedia.last()
val directory = directories[parentDir.toLowerCase()]!! val parentDir = File(firstItem.path).parent
val newImageCnt = directory.mediaCnt + 1 var thumbnail = firstItem.path
directory.mediaCnt = newImageCnt albumCovers.forEach {
directory.addSize(size) if (it.path == parentDir && File(it.tmb).exists()) {
} else { thumbnail = it.tmb
var dirName = parentDir.getFilenameFromPath()
if (parentDir == context.internalStoragePath) {
dirName = context.getString(R.string.internal)
} else if (parentDir == context.sdCardPath) {
dirName = context.getString(R.string.sd_card)
} }
if (File(parentDir).containsNoMedia()) {
dirName += " $hidden"
if (!showHidden)
continue
}
var thumbnail = path
albumCovers.forEach {
if (it.path == parentDir && File(it.tmb).exists()) {
thumbnail = it.tmb
}
}
val directory = Directory(parentDir, thumbnail, dirName, 1, dateModified, dateTaken, size)
directories.put(parentDir.toLowerCase(), directory)
} }
var dirName = when (parentDir) {
context.internalStoragePath -> context.getString(R.string.internal)
context.sdCardPath -> context.getString(R.string.sd_card)
else -> parentDir.getFilenameFromPath()
}
if (File(parentDir).containsNoMedia()) {
dirName += " $hidden"
}
val lastModified = if (config.directorySorting and SORT_DESCENDING > 0) Math.max(firstItem.modified, lastItem.modified) else Math.min(firstItem.modified, lastItem.modified)
val dateTaken = if (config.directorySorting and SORT_DESCENDING > 0) Math.max(firstItem.taken, lastItem.taken) else Math.min(firstItem.taken, lastItem.taken)
val size = curMedia.sumByLong { it.size }
val directory = Directory(parentDir, thumbnail, dirName, curMedia.size, lastModified, dateTaken, size)
directories.add(directory)
} }
return directories return directories
} }
private fun shouldFolderBeVisible(path: String, excludedPaths: MutableSet<String>, includedPaths: MutableSet<String>): Boolean {
val file = File(path)
return if (isThisOrParentExcluded(path, excludedPaths, includedPaths)) {
false
} else if (!config.shouldShowHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) {
var containsNoMediaOrDot = file.containsNoMedia() || path.contains("/.")
if (!containsNoMediaOrDot) {
containsNoMediaOrDot = checkParentHasNoMedia(file.parentFile)
}
!containsNoMediaOrDot
} else {
true
}
}
private fun checkParentHasNoMedia(file: File): Boolean {
var curFile = file
while (true) {
if (curFile.containsNoMedia()) {
return true
}
curFile = curFile.parentFile
if (curFile.absolutePath == "/")
break
}
return false
}
private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet<String>, includedPaths: MutableSet<String>) =
includedPaths.none { path.startsWith(it) } && excludedPaths.any { path.startsWith(it) }
private fun movePinnedToFront(dirs: ArrayList<Directory>): ArrayList<Directory> {
val foundFolders = ArrayList<Directory>()
val pinnedFolders = config.pinnedFolders
dirs.forEach { if (pinnedFolders.contains(it.path)) foundFolders.add(it) }
dirs.removeAll(foundFolders)
dirs.addAll(0, foundFolders)
return dirs
}
override fun onPostExecute(dirs: ArrayList<Directory>) { override fun onPostExecute(dirs: ArrayList<Directory>) {
super.onPostExecute(dirs) super.onPostExecute(dirs)
callback.invoke(dirs) callback(dirs)
}
fun stopFetching() {
mediaFetcher.shouldStop = true
cancel(true)
} }
} }

View file

@ -2,21 +2,40 @@ package com.simplemobiletools.gallery.asynctasks
import android.content.Context import android.content.Context
import android.os.AsyncTask import android.os.AsyncTask
import com.simplemobiletools.gallery.extensions.getFilesFrom import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.MediaFetcher
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
import java.util.* import java.util.*
class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo: Boolean = false, val isPickImage: Boolean = false, class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo: Boolean = false, val isPickImage: Boolean = false,
val showAll: Boolean, val callback: (media: ArrayList<Medium>) -> Unit) : val showAll: Boolean, val callback: (media: ArrayList<Medium>) -> Unit) :
AsyncTask<Void, Void, ArrayList<Medium>>() { AsyncTask<Void, Void, ArrayList<Medium>>() {
private val mediaFetcher = MediaFetcher(context)
override fun doInBackground(vararg params: Void): ArrayList<Medium> { override fun doInBackground(vararg params: Void): ArrayList<Medium> {
val path = if (showAll) "" else mPath return if (showAll) {
return context.getFilesFrom(path, isPickImage, isPickVideo) val mediaMap = mediaFetcher.getMediaByDirectories(isPickVideo, isPickImage)
val media = ArrayList<Medium>()
mediaMap.values.forEach {
media.addAll(it)
}
Medium.sorting = context.config.getFileSorting("")
media.sort()
media
} else {
mediaFetcher.getFilesFrom(mPath, isPickImage, isPickVideo)
}
} }
override fun onPostExecute(media: ArrayList<Medium>) { override fun onPostExecute(media: ArrayList<Medium>) {
super.onPostExecute(media) super.onPostExecute(media)
callback.invoke(media) callback(media)
}
fun stopFetching() {
mediaFetcher.shouldStop = true
cancel(true)
} }
} }

View file

@ -42,12 +42,12 @@ class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting:
val sortingRadio = view.sorting_dialog_radio_sorting val sortingRadio = view.sorting_dialog_radio_sorting
var sortBtn = sortingRadio.sorting_dialog_radio_name var sortBtn = sortingRadio.sorting_dialog_radio_name
if (currSorting and SORT_BY_SIZE != 0) { when {
sortBtn = sortingRadio.sorting_dialog_radio_size currSorting and SORT_BY_PATH != 0 -> sortBtn = sortingRadio.sorting_dialog_radio_path
} else if (currSorting and SORT_BY_DATE_MODIFIED != 0) { currSorting and SORT_BY_SIZE != 0 -> sortBtn = sortingRadio.sorting_dialog_radio_size
sortBtn = sortingRadio.sorting_dialog_radio_last_modified currSorting and SORT_BY_DATE_MODIFIED != 0 -> sortBtn = sortingRadio.sorting_dialog_radio_last_modified
} else if (currSorting and SORT_BY_DATE_TAKEN != 0) currSorting and SORT_BY_DATE_TAKEN != 0 -> sortBtn = sortingRadio.sorting_dialog_radio_date_taken
sortBtn = sortingRadio.sorting_dialog_radio_date_taken }
sortBtn.isChecked = true sortBtn.isChecked = true
} }
@ -65,6 +65,7 @@ class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting:
val sortingRadio = view.sorting_dialog_radio_sorting val sortingRadio = view.sorting_dialog_radio_sorting
var sorting = when (sortingRadio.checkedRadioButtonId) { var sorting = when (sortingRadio.checkedRadioButtonId) {
R.id.sorting_dialog_radio_name -> SORT_BY_NAME R.id.sorting_dialog_radio_name -> SORT_BY_NAME
R.id.sorting_dialog_radio_path -> SORT_BY_PATH
R.id.sorting_dialog_radio_size -> SORT_BY_SIZE R.id.sorting_dialog_radio_size -> SORT_BY_SIZE
R.id.sorting_dialog_radio_last_modified -> SORT_BY_DATE_MODIFIED R.id.sorting_dialog_radio_last_modified -> SORT_BY_DATE_MODIFIED
else -> SORT_BY_DATE_TAKEN else -> SORT_BY_DATE_TAKEN

View file

@ -0,0 +1,28 @@
package com.simplemobiletools.gallery.dialogs
import android.content.Context
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R
import kotlinx.android.synthetic.main.dialog_delete_with_remember.view.*
class DeleteWithRememberDialog(val context: Context, val callback: (remember: Boolean) -> Unit) {
var dialog: AlertDialog
val view = LayoutInflater.from(context).inflate(R.layout.dialog_delete_with_remember, null)
init {
val builder = AlertDialog.Builder(context)
.setPositiveButton(R.string.yes, { dialog, which -> dialogConfirmed() })
.setNegativeButton(R.string.no, null)
dialog = builder.create().apply {
context.setupDialogStuff(view, this)
}
}
private fun dialogConfirmed() {
dialog.dismiss()
callback(view.delete_remember_checkbox.isChecked)
}
}

View file

@ -0,0 +1,46 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.GIFS
import com.simplemobiletools.gallery.helpers.IMAGES
import com.simplemobiletools.gallery.helpers.VIDEOS
import kotlinx.android.synthetic.main.dialog_filter_media.view.*
class FilterMediaDialog(val activity: SimpleActivity, val callback: (result: Int) -> Unit) {
private var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_filter_media, null)
init {
val filterMedia = activity.config.filterMedia
view.apply {
filter_media_images.isChecked = filterMedia and IMAGES != 0
filter_media_videos.isChecked = filterMedia and VIDEOS != 0
filter_media_gifs.isChecked = filterMedia and GIFS != 0
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.filter_media)
}
}
private fun dialogConfirmed() {
var result = 0
if (view.filter_media_images.isChecked)
result += IMAGES
if (view.filter_media_videos.isChecked)
result += VIDEOS
if (view.filter_media_gifs.isChecked)
result += GIFS
activity.config.filterMedia = result
callback(result)
}
}

View file

@ -0,0 +1,70 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.*
import kotlinx.android.synthetic.main.dialog_manage_extended_details.view.*
class ManageExtendedDetailsDialog(val activity: SimpleActivity, val callback: (result: Int) -> Unit) {
private var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_manage_extended_details, null)
init {
val details = activity.config.extendedDetails
view.apply {
manage_extended_details_name.isChecked = details and EXT_NAME != 0
manage_extended_details_path.isChecked = details and EXT_PATH != 0
manage_extended_details_size.isChecked = details and EXT_SIZE != 0
manage_extended_details_resolution.isChecked = details and EXT_RESOLUTION != 0
manage_extended_details_last_modified.isChecked = details and EXT_LAST_MODIFIED != 0
manage_extended_details_date_taken.isChecked = details and EXT_DATE_TAKEN != 0
manage_extended_details_camera.isChecked = details and EXT_CAMERA_MODEL != 0
manage_extended_details_exif.isChecked = details and EXT_EXIF_PROPERTIES != 0
manage_extended_details_duration.isChecked = details and EXT_DURATION != 0
manage_extended_details_artist.isChecked = details and EXT_ARTIST != 0
manage_extended_details_album.isChecked = details and EXT_ALBUM != 0
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this)
}
}
private fun dialogConfirmed() {
var result = 0
view.apply {
if (manage_extended_details_name.isChecked)
result += EXT_NAME
if (manage_extended_details_path.isChecked)
result += EXT_PATH
if (manage_extended_details_size.isChecked)
result += EXT_SIZE
if (manage_extended_details_resolution.isChecked)
result += EXT_RESOLUTION
if (manage_extended_details_last_modified.isChecked)
result += EXT_LAST_MODIFIED
if (manage_extended_details_date_taken.isChecked)
result += EXT_DATE_TAKEN
if (manage_extended_details_camera.isChecked)
result += EXT_CAMERA_MODEL
if (manage_extended_details_exif.isChecked)
result += EXT_EXIF_PROPERTIES
if (manage_extended_details_duration.isChecked)
result += EXT_DURATION
if (manage_extended_details_artist.isChecked)
result += EXT_ARTIST
if (manage_extended_details_album.isChecked)
result += EXT_ALBUM
}
activity.config.extendedDetails = result
callback(result)
}
}

View file

@ -3,7 +3,6 @@ package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.support.v7.widget.GridLayoutManager import android.support.v7.widget.GridLayoutManager
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.extensions.beGoneIf import com.simplemobiletools.commons.extensions.beGoneIf
import com.simplemobiletools.commons.extensions.beVisibleIf import com.simplemobiletools.commons.extensions.beVisibleIf
@ -15,18 +14,21 @@ import com.simplemobiletools.gallery.adapters.DirectoryAdapter
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.getCachedDirectories import com.simplemobiletools.gallery.extensions.getCachedDirectories
import com.simplemobiletools.gallery.extensions.getSortedDirectories
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_GRID
import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Directory
import kotlinx.android.synthetic.main.dialog_directory_picker.view.* import kotlinx.android.synthetic.main.dialog_directory_picker.view.*
class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, val callback: (path: String) -> Unit) { class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, val callback: (path: String) -> Unit) {
var dialog: AlertDialog var dialog: AlertDialog
var shownDirectories: ArrayList<Directory> = ArrayList() var shownDirectories = ArrayList<Directory>()
var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null) var view = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null)
var isGridViewType = activity.config.viewTypeFolders == VIEW_TYPE_GRID
init { init {
(view.directories_grid.layoutManager as GridLayoutManager).apply { (view.directories_grid.layoutManager as GridLayoutManager).apply {
orientation = if (activity.config.scrollHorizontally) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL orientation = if (activity.config.scrollHorizontally && isGridViewType) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL
spanCount = activity.config.dirColumnCnt spanCount = if (isGridViewType) activity.config.dirColumnCnt else 1
} }
dialog = AlertDialog.Builder(activity) dialog = AlertDialog.Builder(activity)
@ -35,31 +37,32 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String,
.setNeutralButton(R.string.other_folder, { dialogInterface, i -> showOtherFolder() }) .setNeutralButton(R.string.other_folder, { dialogInterface, i -> showOtherFolder() })
.create().apply { .create().apply {
activity.setupDialogStuff(view, this, R.string.select_destination) activity.setupDialogStuff(view, this, R.string.select_destination)
val dirs = activity.getCachedDirectories()
if (dirs.isNotEmpty()) {
gotDirectories(dirs)
}
GetDirectoriesAsynctask(activity, false, false) {
gotDirectories(it)
}.execute()
} }
val dirs = activity.getCachedDirectories()
if (dirs.isNotEmpty()) {
gotDirectories(activity.addTempFolderIfNeeded(dirs))
}
GetDirectoriesAsynctask(activity, false, false) {
gotDirectories(activity.addTempFolderIfNeeded(it))
}.execute()
} }
fun showOtherFolder() { private fun showOtherFolder() {
val showHidden = activity.config.shouldShowHidden val showHidden = activity.config.shouldShowHidden
FilePickerDialog(activity, sourcePath, false, showHidden, true) { FilePickerDialog(activity, sourcePath, false, showHidden, true) {
callback(it) callback(it)
} }
} }
private fun gotDirectories(directories: ArrayList<Directory>) { private fun gotDirectories(newDirs: ArrayList<Directory>) {
if (directories.hashCode() == shownDirectories.hashCode()) val dirs = activity.getSortedDirectories(newDirs)
if (dirs.hashCode() == shownDirectories.hashCode())
return return
shownDirectories = directories shownDirectories = dirs
val adapter = DirectoryAdapter(activity, directories, null, true) { val adapter = DirectoryAdapter(activity, dirs, null, true) {
if (it.path.trimEnd('/') == sourcePath) { if (it.path.trimEnd('/') == sourcePath) {
activity.toast(R.string.source_and_destination_same) activity.toast(R.string.source_and_destination_same)
return@DirectoryAdapter return@DirectoryAdapter
@ -69,7 +72,7 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String,
} }
} }
val scrollHorizontally = activity.config.scrollHorizontally val scrollHorizontally = activity.config.scrollHorizontally && isGridViewType
view.apply { view.apply {
directories_grid.adapter = adapter directories_grid.adapter = adapter

View file

@ -1,44 +1,55 @@
package com.simplemobiletools.gallery.dialogs package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.support.v7.widget.RecyclerView import android.support.v7.widget.GridLayoutManager
import android.view.LayoutInflater import android.view.LayoutInflater
import com.google.gson.Gson import com.simplemobiletools.commons.extensions.beGoneIf
import com.google.gson.reflect.TypeToken import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.adapters.MediaAdapter import com.simplemobiletools.gallery.adapters.MediaAdapter
import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask
import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.getCachedMedia
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_GRID
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.dialog_medium_picker.view.* import kotlinx.android.synthetic.main.dialog_medium_picker.view.*
class PickMediumDialog(val activity: SimpleActivity, val path: String, val callback: (path: String) -> Unit) { class PickMediumDialog(val activity: SimpleActivity, val path: String, val callback: (path: String) -> Unit) {
var dialog: AlertDialog var dialog: AlertDialog
var mediaGrid: RecyclerView var shownMedia = ArrayList<Medium>()
var shownMedia: ArrayList<Medium> = ArrayList() val view = LayoutInflater.from(activity).inflate(R.layout.dialog_medium_picker, null)
var isGridViewType = activity.config.viewTypeFiles == VIEW_TYPE_GRID
init { init {
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_medium_picker, null) (view.media_grid.layoutManager as GridLayoutManager).apply {
mediaGrid = view.media_grid orientation = if (activity.config.scrollHorizontally && isGridViewType) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL
spanCount = if (isGridViewType) activity.config.mediaColumnCnt else 1
}
dialog = AlertDialog.Builder(activity) dialog = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null) .setNegativeButton(R.string.cancel, null)
.setNeutralButton(R.string.other_folder, { dialogInterface, i -> showOtherFolder() })
.create().apply { .create().apply {
activity.setupDialogStuff(view, this, R.string.select_photo) activity.setupDialogStuff(view, this, R.string.select_photo)
}
val token = object : TypeToken<List<Medium>>() {}.type val media = activity.getCachedMedia(path).filter { !it.video } as ArrayList
val media = Gson().fromJson<ArrayList<Medium>>(activity.config.loadFolderMedia(path), token) ?: ArrayList<Medium>(1) if (media.isNotEmpty()) {
gotMedia(media)
}
if (media.isNotEmpty()) { GetMediaAsynctask(activity, path, false, true, false) {
gotMedia(media) gotMedia(it)
} }.execute()
}
GetMediaAsynctask(activity, path, false, true, false) { private fun showOtherFolder() {
gotMedia(it) PickDirectoryDialog(activity, path) {
}.execute() callback(it)
dialog.dismiss()
} }
} }
@ -47,10 +58,26 @@ class PickMediumDialog(val activity: SimpleActivity, val path: String, val callb
return return
shownMedia = media shownMedia = media
val adapter = MediaAdapter(activity, media, null, true) { val adapter = MediaAdapter(activity, media, null, true, false) {
callback(it.path) callback(it.path)
dialog.dismiss() dialog.dismiss()
} }
mediaGrid.adapter = adapter
val scrollHorizontally = activity.config.scrollHorizontally && isGridViewType
view.apply {
media_grid.adapter = adapter
media_vertical_fastscroller.isHorizontal = false
media_vertical_fastscroller.beGoneIf(scrollHorizontally)
media_horizontal_fastscroller.isHorizontal = true
media_horizontal_fastscroller.beVisibleIf(scrollHorizontally)
if (scrollHorizontally) {
media_horizontal_fastscroller.setViews(media_grid)
} else {
media_vertical_fastscroller.setViews(media_grid)
}
}
} }
} }

View file

@ -6,15 +6,14 @@ import android.view.View
import android.view.WindowManager import android.view.WindowManager
import com.simplemobiletools.commons.extensions.hideKeyboard import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.SLIDESHOW_DEFAULT_INTERVAL import com.simplemobiletools.gallery.helpers.SLIDESHOW_DEFAULT_INTERVAL
import kotlinx.android.synthetic.main.dialog_slideshow.view.* import kotlinx.android.synthetic.main.dialog_slideshow.view.*
class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
val dialog: AlertDialog
val view: View val view: View
init { init {
@ -42,6 +41,11 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
include_videos.toggle() include_videos.toggle()
} }
include_gifs_holder.setOnClickListener {
interval_value.clearFocus()
include_gifs.toggle()
}
random_order_holder.setOnClickListener { random_order_holder.setOnClickListener {
interval_value.clearFocus() interval_value.clearFocus()
random_order.toggle() random_order.toggle()
@ -56,15 +60,30 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
interval_value.clearFocus() interval_value.clearFocus()
move_backwards.toggle() move_backwards.toggle()
} }
loop_slideshow_holder.setOnClickListener {
interval_value.clearFocus()
loop_slideshow.toggle()
}
} }
setupValues() setupValues()
dialog = AlertDialog.Builder(activity) AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() }) .setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null) .setNegativeButton(R.string.cancel, null)
.create().apply { .create().apply {
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
activity.setupDialogStuff(view, this) activity.setupDialogStuff(view, this)
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
if (!view.include_photos.isChecked && !view.include_videos.isChecked && !view.include_gifs.isChecked) {
activity.toast(R.string.no_media_for_slideshow)
return@setOnClickListener
}
storeValues()
callback()
dismiss()
})
} }
} }
@ -74,13 +93,15 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
interval_value.setText(config.slideshowInterval.toString()) interval_value.setText(config.slideshowInterval.toString())
include_photos.isChecked = config.slideshowIncludePhotos include_photos.isChecked = config.slideshowIncludePhotos
include_videos.isChecked = config.slideshowIncludeVideos include_videos.isChecked = config.slideshowIncludeVideos
include_gifs.isChecked = config.slideshowIncludeGIFs
random_order.isChecked = config.slideshowRandomOrder random_order.isChecked = config.slideshowRandomOrder
use_fade.isChecked = config.slideshowUseFade use_fade.isChecked = config.slideshowUseFade
move_backwards.isChecked = config.slideshowMoveBackwards move_backwards.isChecked = config.slideshowMoveBackwards
loop_slideshow.isChecked = config.loopSlideshow
} }
} }
private fun dialogConfirmed() { private fun storeValues() {
var interval = view.interval_value.text.toString() var interval = view.interval_value.text.toString()
if (interval.trim('0').isEmpty()) if (interval.trim('0').isEmpty())
interval = SLIDESHOW_DEFAULT_INTERVAL.toString() interval = SLIDESHOW_DEFAULT_INTERVAL.toString()
@ -89,11 +110,11 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
slideshowInterval = interval.toInt() slideshowInterval = interval.toInt()
slideshowIncludePhotos = view.include_photos.isChecked slideshowIncludePhotos = view.include_photos.isChecked
slideshowIncludeVideos = view.include_videos.isChecked slideshowIncludeVideos = view.include_videos.isChecked
slideshowIncludeGIFs = view.include_gifs.isChecked
slideshowRandomOrder = view.random_order.isChecked slideshowRandomOrder = view.random_order.isChecked
slideshowUseFade = view.use_fade.isChecked slideshowUseFade = view.use_fade.isChecked
slideshowMoveBackwards = view.move_backwards.isChecked slideshowMoveBackwards = view.move_backwards.isChecked
loopSlideshow = view.loop_slideshow.isChecked
} }
dialog.dismiss()
callback()
} }
} }

View file

@ -24,6 +24,7 @@ import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.BuildConfig
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.helpers.IS_FROM_GALLERY
import com.simplemobiletools.gallery.helpers.NOMEDIA import com.simplemobiletools.gallery.helpers.NOMEDIA
import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE
import com.simplemobiletools.gallery.helpers.REQUEST_SET_AS import com.simplemobiletools.gallery.helpers.REQUEST_SET_AS
@ -48,6 +49,7 @@ fun Activity.shareMedium(medium: Medium) {
val shareTitle = resources.getString(R.string.share_via) val shareTitle = resources.getString(R.string.share_via)
val file = File(medium.path) val file = File(medium.path)
val uri = Uri.fromFile(file) val uri = Uri.fromFile(file)
Intent().apply { Intent().apply {
action = Intent.ACTION_SEND action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_STREAM, uri) putExtra(Intent.EXTRA_STREAM, uri)
@ -59,14 +61,12 @@ fun Activity.shareMedium(medium: Medium) {
fun Activity.shareMedia(media: List<Medium>) { fun Activity.shareMedia(media: List<Medium>) {
val shareTitle = resources.getString(R.string.share_via) val shareTitle = resources.getString(R.string.share_via)
val uris = ArrayList<Uri>(media.size) val uris = media.map { Uri.fromFile(File(it.path)) } as ArrayList
Intent().apply { Intent().apply {
action = Intent.ACTION_SEND_MULTIPLE action = Intent.ACTION_SEND_MULTIPLE
type = "image/* video/*" type = "image/* video/*"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
media.map { File(it.path) }
.mapTo(uris) { Uri.fromFile(it) }
putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris) putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
startActivity(Intent.createChooser(this, shareTitle)) startActivity(Intent.createChooser(this, shareTitle))
} }
@ -92,14 +92,14 @@ fun Activity.setAs(uri: Uri, file: File, showToast: Boolean = true): Boolean {
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
val chooser = Intent.createChooser(this, getString(R.string.set_as)) val chooser = Intent.createChooser(this, getString(R.string.set_as))
if (resolveActivity(packageManager) != null) { success = if (resolveActivity(packageManager) != null) {
startActivityForResult(chooser, REQUEST_SET_AS) startActivityForResult(chooser, REQUEST_SET_AS)
success = true true
} else { } else {
if (showToast) { if (showToast) {
toast(R.string.no_capable_app_found) toast(R.string.no_capable_app_found)
} }
success = false false
} }
} }
@ -131,6 +131,7 @@ fun Activity.openWith(file: File, forceChooser: Boolean = true) {
action = Intent.ACTION_VIEW action = Intent.ACTION_VIEW
setDataAndType(uri, file.getMimeType()) setDataAndType(uri, file.getMimeType())
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
putExtra(IS_FROM_GALLERY, true)
if (resolveActivity(packageManager) != null) { if (resolveActivity(packageManager) != null) {
val chooser = Intent.createChooser(this, getString(R.string.open_with)) val chooser = Intent.createChooser(this, getString(R.string.open_with))
@ -223,9 +224,10 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
if (needsStupidWritePermissions(path)) { if (needsStupidWritePermissions(path)) {
handleSAFDialog(file) { handleSAFDialog(file) {
try { val fileDocument = getFileDocument(path)
getFileDocument(path)?.createFile("", NOMEDIA) if (fileDocument?.exists() == true && fileDocument.isDirectory) {
} catch (e: Exception) { fileDocument.createFile("", NOMEDIA)
} else {
toast(R.string.unknown_error_occurred) toast(R.string.unknown_error_occurred)
} }
} }
@ -233,9 +235,10 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
try { try {
file.createNewFile() file.createNewFile()
} catch (e: Exception) { } catch (e: Exception) {
toast(R.string.unknown_error_occurred) showErrorToast(e)
} }
} }
scanFile(file) { scanFile(file) {
callback() callback()
} }
@ -251,10 +254,10 @@ fun SimpleActivity.removeNoMedia(path: String, callback: () -> Unit) {
fun SimpleActivity.toggleFileVisibility(oldFile: File, hide: Boolean, callback: (newFile: File) -> Unit) { fun SimpleActivity.toggleFileVisibility(oldFile: File, hide: Boolean, callback: (newFile: File) -> Unit) {
val path = oldFile.parent val path = oldFile.parent
var filename = oldFile.name var filename = oldFile.name
if (hide) { filename = if (hide) {
filename = ".${filename.trimStart('.')}" ".${filename.trimStart('.')}"
} else { } else {
filename = filename.substring(1, filename.length) filename.substring(1, filename.length)
} }
val newFile = File(path, filename) val newFile = File(path, filename)
renameFile(oldFile, newFile) { renameFile(oldFile, newFile) {
@ -336,3 +339,8 @@ fun Activity.getCachedDirectories(): ArrayList<Directory> {
val token = object : TypeToken<List<Directory>>() {}.type val token = object : TypeToken<List<Directory>>() {}.type
return Gson().fromJson<ArrayList<Directory>>(config.directories, token) ?: ArrayList<Directory>(1) return Gson().fromJson<ArrayList<Directory>>(config.directories, token) ?: ArrayList<Directory>(1)
} }
fun Activity.getCachedMedia(path: String): ArrayList<Medium> {
val token = object : TypeToken<List<Medium>>() {}.type
return Gson().fromJson<ArrayList<Medium>>(config.loadFolderMedia(path), token) ?: ArrayList(1)
}

View file

@ -0,0 +1,5 @@
package com.simplemobiletools.gallery.extensions
import java.util.*
fun <E> ArrayList<E>.sumByLong(selector: (E) -> Long) = map { selector(it) }.sum()

View file

@ -4,25 +4,45 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.res.Configuration import android.content.res.Configuration
import android.database.Cursor import android.database.Cursor
import android.graphics.Point
import android.media.AudioManager import android.media.AudioManager
import android.net.Uri import android.net.Uri
import android.os.Build
import android.provider.MediaStore import android.provider.MediaStore
import com.simplemobiletools.commons.extensions.* import android.view.WindowManager
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.extensions.humanizePath
import com.simplemobiletools.commons.helpers.SORT_BY_NAME
import com.simplemobiletools.commons.helpers.SORT_BY_SIZE
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
import com.simplemobiletools.gallery.activities.SettingsActivity import com.simplemobiletools.gallery.activities.SettingsActivity
import com.simplemobiletools.gallery.helpers.Config import com.simplemobiletools.gallery.helpers.Config
import com.simplemobiletools.gallery.helpers.IMAGES import com.simplemobiletools.gallery.models.Directory
import com.simplemobiletools.gallery.helpers.NOMEDIA
import com.simplemobiletools.gallery.helpers.VIDEOS
import com.simplemobiletools.gallery.models.Medium
import java.io.File
import java.util.*
val Context.portrait get() = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT val Context.portrait get() = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
val Context.audioManager get() = getSystemService(Context.AUDIO_SERVICE) as AudioManager val Context.audioManager get() = getSystemService(Context.AUDIO_SERVICE) as AudioManager
val Context.windowManager: WindowManager get() = getSystemService(Context.WINDOW_SERVICE) as WindowManager
val Context.navigationBarRight: Boolean get() = usableScreenSize.x < realScreenSize.x
val Context.navigationBarBottom: Boolean get() = usableScreenSize.y < realScreenSize.y
val Context.navigationBarHeight: Int get() = if (navigationBarBottom) navigationBarSize.y else 0
internal val Context.navigationBarSize: Point
get() = when {
navigationBarRight -> Point(realScreenSize.x - usableScreenSize.x, usableScreenSize.y)
navigationBarBottom -> Point(usableScreenSize.x, realScreenSize.y - usableScreenSize.y)
else -> Point()
}
val Context.usableScreenSize: Point
get() {
val size = Point()
windowManager.defaultDisplay.getSize(size)
return size
}
val Context.realScreenSize: Point
get() {
val size = Point()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
windowManager.defaultDisplay.getRealSize(size)
return size
}
fun Context.getRealPathFromURI(uri: Uri): String? { fun Context.getRealPathFromURI(uri: Uri): String? {
var cursor: Cursor? = null var cursor: Cursor? = null
@ -51,197 +71,24 @@ fun Context.launchSettings() {
val Context.config: Config get() = Config.newInstance(this) val Context.config: Config get() = Config.newInstance(this)
fun Context.getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean): ArrayList<Medium> { fun Context.movePinnedDirectoriesToFront(dirs: ArrayList<Directory>): ArrayList<Directory> {
val projection = arrayOf(MediaStore.Images.Media._ID, val foundFolders = ArrayList<Directory>()
MediaStore.Images.Media.DISPLAY_NAME, val pinnedFolders = config.pinnedFolders
MediaStore.Images.Media.DATE_TAKEN,
MediaStore.Images.Media.DATE_MODIFIED,
MediaStore.Images.Media.DATA,
MediaStore.Images.Media.SIZE)
val uri = MediaStore.Files.getContentUri("external")
val selection = if (curPath.isEmpty()) null else "(${MediaStore.Images.Media.DATA} LIKE ? AND ${MediaStore.Images.Media.DATA} NOT LIKE ?)"
val selectionArgs = if (curPath.isEmpty()) null else arrayOf("$curPath/%", "$curPath/%/%")
try { dirs.forEach {
val cur = contentResolver.query(uri, projection, selection, selectionArgs, getSortingForFolder(curPath)) if (pinnedFolders.contains(it.path))
return parseCursor(this, cur, isPickImage, isPickVideo, curPath) foundFolders.add(it)
} catch (e: Exception) {
return ArrayList()
}
}
private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isPickVideo: Boolean, curPath: String): ArrayList<Medium> {
val curMedia = ArrayList<Medium>()
val config = context.config
val showMedia = config.showMedia
val showHidden = config.shouldShowHidden
val includedFolders = config.includedFolders
val excludedFolders = config.excludedFolders
val noMediaFolders = context.getNoMediaFolders()
cur.use { cur ->
if (cur.moveToFirst()) {
do {
try {
val path = cur.getStringValue(MediaStore.Images.Media.DATA)
var size = cur.getLongValue(MediaStore.Images.Media.SIZE)
if (size == 0L) {
size = File(path).length()
}
if (size <= 0L) {
continue
}
var filename = cur.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) ?: ""
if (filename.isEmpty())
filename = path.getFilenameFromPath()
val isImage = filename.isImageFast() || filename.isGif()
val isVideo = if (isImage) false else filename.isVideoFast()
if (!isImage && !isVideo)
continue
if (isVideo && (isPickImage || showMedia == IMAGES))
continue
if (isImage && (isPickVideo || showMedia == VIDEOS))
continue
if (!showHidden && filename.startsWith('.'))
continue
var isExcluded = false
excludedFolders.forEach {
if (path.startsWith("$it/")) {
isExcluded = true
includedFolders.forEach {
if (path.startsWith("$it/")) {
isExcluded = false
}
}
}
}
if (!isExcluded && !showHidden) {
noMediaFolders.forEach {
if (path.startsWith("$it/")) {
isExcluded = true
}
}
}
if (!isExcluded && !showHidden && path.contains("/.")) {
isExcluded = true
}
if (!isExcluded) {
val dateTaken = cur.getLongValue(MediaStore.Images.Media.DATE_TAKEN)
val dateModified = cur.getIntValue(MediaStore.Images.Media.DATE_MODIFIED) * 1000L
val medium = Medium(filename, path, isVideo, dateModified, dateTaken, size)
curMedia.add(medium)
}
} catch (e: Exception) {
continue
}
} while (cur.moveToNext())
}
} }
config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.mapNotNull { File(it).listFiles() }.forEach { dirs.removeAll(foundFolders)
for (file in it) { dirs.addAll(0, foundFolders)
val size = file.length() return dirs
if (size <= 0L) {
continue
}
val filename = file.name
val isImage = filename.isImageFast() || filename.isGif()
val isVideo = if (isImage) false else filename.isVideoFast()
if (!isImage && !isVideo)
continue
if (isVideo && (isPickImage || showMedia == IMAGES))
continue
if (isImage && (isPickVideo || showMedia == VIDEOS))
continue
val dateTaken = file.lastModified()
val dateModified = file.lastModified()
val medium = Medium(filename, file.absolutePath, isVideo, dateModified, dateTaken, size)
val isAlreadyAdded = curMedia.any { it.path == file.absolutePath }
if (!isAlreadyAdded)
curMedia.add(medium)
}
}
Medium.sorting = config.getFileSorting(curPath)
curMedia.sort()
return curMedia
} }
fun Context.getSortingForFolder(path: String): String { @Suppress("UNCHECKED_CAST")
val sorting = config.getFileSorting(path) fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Directory> {
val sortValue = if (sorting and SORT_BY_NAME > 0) Directory.sorting = config.directorySorting
MediaStore.Images.Media.DISPLAY_NAME val dirs = source.clone() as ArrayList<Directory>
else if (sorting and SORT_BY_SIZE > 0) dirs.sort()
MediaStore.Images.Media.SIZE return movePinnedDirectoriesToFront(dirs)
else if (sorting and SORT_BY_DATE_MODIFIED > 0)
MediaStore.Images.Media.DATE_MODIFIED
else
MediaStore.Images.Media.DATE_TAKEN
return if (sorting and SORT_DESCENDING > 0)
"$sortValue DESC"
else
"$sortValue ASC"
}
fun Context.getNoMediaFolders(): ArrayList<String> {
val folders = ArrayList<String>()
val noMediaCondition = "${MediaStore.Files.FileColumns.MEDIA_TYPE} = ${MediaStore.Files.FileColumns.MEDIA_TYPE_NONE}"
val uri = MediaStore.Files.getContentUri("external")
val columns = arrayOf(MediaStore.Files.FileColumns.DATA)
val where = "$noMediaCondition AND ${MediaStore.Files.FileColumns.TITLE} LIKE ?"
val args = arrayOf("%$NOMEDIA%")
var cursor: Cursor? = null
try {
cursor = contentResolver.query(uri, columns, where, args, null)
if (cursor?.moveToFirst() == true) {
do {
val path = cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA)) ?: continue
val noMediaFile = File(path)
if (noMediaFile.exists())
folders.add(noMediaFile.parent)
} while (cursor.moveToNext())
}
} finally {
cursor?.close()
}
return folders
}
fun Context.getLastMediaModified(): Int {
val max = "max"
val uri = MediaStore.Files.getContentUri("external")
val projection = arrayOf(MediaStore.Images.Media._ID, "MAX(${MediaStore.Images.Media.DATE_MODIFIED}) AS $max")
var cursor: Cursor? = null
try {
cursor = contentResolver.query(uri, projection, null, null, null)
if (cursor?.moveToFirst() == true) {
return cursor.getIntValue(max)
}
} finally {
cursor?.close()
}
return 0
} }

View file

@ -24,15 +24,10 @@ import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.Target import com.bumptech.glide.request.target.Target
import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.ImageSource
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.simplemobiletools.commons.extensions.beGone import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.beVisible
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.activities.ViewPagerActivity
import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.extensions.getFileSignature
import com.simplemobiletools.gallery.extensions.getRealPathFromURI
import com.simplemobiletools.gallery.extensions.portrait
import com.simplemobiletools.gallery.helpers.GlideRotateTransformation import com.simplemobiletools.gallery.helpers.GlideRotateTransformation
import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.helpers.MEDIUM
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
@ -43,10 +38,13 @@ import java.io.FileOutputStream
import java.io.IOException import java.io.IOException
class PhotoFragment : ViewPagerFragment() { class PhotoFragment : ViewPagerFragment() {
lateinit var medium: Medium
lateinit var view: ViewGroup
private var isFragmentVisible = false private var isFragmentVisible = false
private var wasInit = false private var wasInit = false
private var storedShowExtendedDetails = false
private var storedExtendedDetails = 0
lateinit var view: ViewGroup
lateinit var medium: Medium
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
view = inflater.inflate(R.layout.pager_photo_item, container, false) as ViewGroup view = inflater.inflate(R.layout.pager_photo_item, container, false) as ViewGroup
@ -101,12 +99,26 @@ class PhotoFragment : ViewPagerFragment() {
} }
} }
loadImage() loadImage()
checkExtendedDetails()
wasInit = true wasInit = true
return view return view
} }
override fun onPause() {
super.onPause()
storedShowExtendedDetails = context.config.showExtendedDetails
storedExtendedDetails = context.config.extendedDetails
}
override fun onResume() {
super.onResume()
if (wasInit && (context.config.showExtendedDetails != storedShowExtendedDetails || context.config.extendedDetails != storedExtendedDetails)) {
checkExtendedDetails()
}
}
override fun setMenuVisibility(menuVisible: Boolean) { override fun setMenuVisibility(menuVisible: Boolean) {
super.setMenuVisibility(menuVisible) super.setMenuVisibility(menuVisible)
isFragmentVisible = menuVisible isFragmentVisible = menuVisible
@ -123,13 +135,11 @@ class PhotoFragment : ViewPagerFragment() {
} }
} }
private fun degreesForRotation(orientation: Int): Int { private fun degreesForRotation(orientation: Int) = when (orientation) {
return when (orientation) { 8 -> 270
8 -> 270 3 -> 180
3 -> 180 6 -> 90
6 -> 90 else -> 0
else -> 0
}
} }
private fun rotateViaMatrix(original: Bitmap, orientation: Int): Bitmap { private fun rotateViaMatrix(original: Bitmap, orientation: Int): Bitmap {
@ -168,7 +178,7 @@ class PhotoFragment : ViewPagerFragment() {
val options = RequestOptions() val options = RequestOptions()
.signature(medium.path.getFileSignature()) .signature(medium.path.getFileSignature())
.format(DecodeFormat.PREFER_ARGB_8888) .format(DecodeFormat.PREFER_ARGB_8888)
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.override(targetWidth, targetHeight) .override(targetWidth, targetHeight)
Glide.with(this) Glide.with(this)
@ -176,9 +186,7 @@ class PhotoFragment : ViewPagerFragment() {
.load(medium.path) .load(medium.path)
.apply(options) .apply(options)
.listener(object : RequestListener<Bitmap> { .listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean) = false
return false
}
override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
if (isFragmentVisible) if (isFragmentVisible)
@ -203,6 +211,7 @@ class PhotoFragment : ViewPagerFragment() {
private fun addZoomableView() { private fun addZoomableView() {
if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.visibility == View.GONE) { if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.visibility == View.GONE) {
view.subsampling_view.apply { view.subsampling_view.apply {
//setBitmapDecoderClass(GlideDecoder::class.java) // causing random crashes on Android 7+
maxScale = 10f maxScale = 10f
beVisible() beVisible()
setImage(ImageSource.uri(medium.path)) setImage(ImageSource.uri(medium.path))
@ -222,7 +231,7 @@ class PhotoFragment : ViewPagerFragment() {
override fun onPreviewReleased() { override fun onPreviewReleased() {
} }
override fun onImageLoadError(e: Exception?) { override fun onImageLoadError(e: Exception) {
background = ColorDrawable(Color.TRANSPARENT) background = ColorDrawable(Color.TRANSPARENT)
beGone() beGone()
} }
@ -256,18 +265,32 @@ class PhotoFragment : ViewPagerFragment() {
} }
} }
fun refreshBitmap() {
view.subsampling_view.beGone()
loadBitmap()
}
fun rotateImageViewBy(degrees: Float) { fun rotateImageViewBy(degrees: Float) {
view.subsampling_view.beGone() view.subsampling_view.beGone()
loadBitmap(degrees) loadBitmap(degrees)
} }
private fun checkExtendedDetails() {
if (context.config.showExtendedDetails) {
view.photo_details.apply {
text = getMediumExtendedDetails(medium)
setTextColor(context.config.textColor)
beVisible()
onGlobalLayout {
if (height != 0) {
val smallMargin = resources.getDimension(R.dimen.small_margin)
y = context.usableScreenSize.y - height - if (context.navigationBarHeight == 0) smallMargin else 0f
}
}
}
} else {
view.photo_details.beGone()
}
}
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
context.isKitkatPlus()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !activity.isDestroyed) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !activity.isDestroyed) {
Glide.with(context).clear(view.photo_view) Glide.with(context).clear(view.photo_view)
} }
@ -276,6 +299,7 @@ class PhotoFragment : ViewPagerFragment() {
override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig)
loadImage() loadImage()
checkExtendedDetails()
} }
private fun photoClicked() { private fun photoClicked() {
@ -283,6 +307,13 @@ class PhotoFragment : ViewPagerFragment() {
} }
override fun fullscreenToggled(isFullscreen: Boolean) { override fun fullscreenToggled(isFullscreen: Boolean) {
view.photo_details.apply {
if (visibility == View.VISIBLE) {
val smallMargin = resources.getDimension(R.dimen.small_margin)
val fullscreenOffset = context.navigationBarHeight.toFloat() - smallMargin
val newY = context.usableScreenSize.y - height + if (isFullscreen) fullscreenOffset else -(if (context.navigationBarHeight == 0) smallMargin else 0f)
animate().y(newY)
}
}
} }
} }

View file

@ -14,15 +14,10 @@ import android.view.*
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import android.widget.SeekBar import android.widget.SeekBar
import android.widget.TextView import android.widget.TextView
import com.simplemobiletools.commons.extensions.getFormattedDuration import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.activities.ViewPagerActivity
import com.simplemobiletools.gallery.extensions.audioManager import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.getNavBarHeight
import com.simplemobiletools.gallery.extensions.hasNavBar
import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.helpers.MEDIUM
import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.pager_video_item.view.* import kotlinx.android.synthetic.main.pager_video_item.view.*
@ -38,13 +33,14 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
private var mCurrTimeView: TextView? = null private var mCurrTimeView: TextView? = null
private var mTimerHandler: Handler? = null private var mTimerHandler: Handler? = null
private var mSeekBar: SeekBar? = null private var mSeekBar: SeekBar? = null
private var mTimeHolder: View? = null
private var mIsPlaying = false private var mIsPlaying = false
private var mIsDragged = false private var mIsDragged = false
private var mIsFullscreen = false private var mIsFullscreen = false
private var mIsFragmentVisible = false private var mIsFragmentVisible = false
private var mPlayOnPrepare = false private var mPlayOnPrepare = false
private var mStoredShowExtendedDetails = false
private var mStoredExtendedDetails = 0
private var mCurrTime = 0 private var mCurrTime = 0
private var mDuration = 0 private var mDuration = 0
@ -61,6 +57,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
lateinit var mView: View lateinit var mView: View
lateinit var medium: Medium lateinit var medium: Medium
lateinit var mTimeHolder: View
companion object { companion object {
private val TAG = VideoFragment::class.java.simpleName private val TAG = VideoFragment::class.java.simpleName
@ -69,9 +66,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mView = inflater.inflate(R.layout.pager_video_item, container, false) mView = inflater.inflate(R.layout.pager_video_item, container, false)
setupPlayer() mTimeHolder = mView.video_time_holder
medium = arguments.getSerializable(MEDIUM) as Medium medium = arguments.getSerializable(MEDIUM) as Medium
setupPlayer()
if (savedInstanceState != null) { if (savedInstanceState != null) {
mCurrTime = savedInstanceState.getInt(PROGRESS) mCurrTime = savedInstanceState.getInt(PROGRESS)
} }
@ -85,6 +83,27 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
activity.updateTextColors(mView.video_holder) activity.updateTextColors(mView.video_holder)
mView.video_volume_controller.beVisibleIf(context.config.allowVideoGestures)
mView.video_brightness_controller.beVisibleIf(context.config.allowVideoGestures)
if (context.config.showExtendedDetails != mStoredShowExtendedDetails || context.config.extendedDetails != mStoredExtendedDetails) {
checkExtendedDetails()
}
}
override fun onPause() {
super.onPause()
pauseVideo()
mIsFragmentVisible = false
mStoredShowExtendedDetails = context.config.showExtendedDetails
mStoredExtendedDetails = context.config.extendedDetails
}
override fun onDestroy() {
super.onDestroy()
if (activity?.isChangingConfigurations == false) {
cleanup()
}
} }
private fun setupPlayer() { private fun setupPlayer() {
@ -109,6 +128,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} }
initTimeHolder() initTimeHolder()
checkExtendedDetails()
} }
override fun setMenuVisibility(menuVisible: Boolean) { override fun setMenuVisibility(menuVisible: Boolean) {
@ -131,6 +151,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig)
setVideoSize() setVideoSize()
initTimeHolder() initTimeHolder()
checkExtendedDetails()
} }
private fun toggleFullscreen() { private fun toggleFullscreen() {
@ -151,7 +172,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
val diffX = mTouchDownX - event.x val diffX = mTouchDownX - event.x
val diffY = mTouchDownY - event.y val diffY = mTouchDownY - event.y
if (Math.abs(diffY) > Math.abs(diffX)) { if (Math.abs(diffY) > 20 && Math.abs(diffY) > Math.abs(diffX)) {
var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3
percent = Math.min(100, Math.max(-100, percent)) percent = Math.min(100, Math.max(-100, percent))
@ -165,7 +186,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mLastTouchY = event.y mLastTouchY = event.y
} }
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { val diffX = Math.abs(event.x - mTouchDownX)
val diffY = Math.abs(event.y - mTouchDownY)
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) {
mView.video_holder.performClick() mView.video_holder.performClick()
} }
} }
@ -187,7 +210,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
val diffX = mTouchDownX - event.x val diffX = mTouchDownX - event.x
val diffY = mTouchDownY - event.y val diffY = mTouchDownY - event.y
if (Math.abs(diffY) > Math.abs(diffX)) { if (Math.abs(diffY) > 20 && Math.abs(diffY) > Math.abs(diffX)) {
var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3
percent = Math.min(100, Math.max(-100, percent)) percent = Math.min(100, Math.max(-100, percent))
@ -201,7 +224,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mLastTouchY = event.y mLastTouchY = event.y
} }
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { val diffX = Math.abs(event.x - mTouchDownX)
val diffY = Math.abs(event.y - mTouchDownY)
if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) {
mView.video_holder.performClick() mView.video_holder.performClick()
} }
mTouchDownBrightness = mTempBrightness mTouchDownBrightness = mTempBrightness
@ -257,11 +282,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} }
private fun initTimeHolder() { private fun initTimeHolder() {
mTimeHolder = mView.video_time_holder
val res = resources val res = resources
val height = res.getNavBarHeight() val height = context.navigationBarHeight
val left = mTimeHolder!!.paddingLeft val left = mTimeHolder.paddingLeft
val top = mTimeHolder!!.paddingTop val top = mTimeHolder.paddingTop
var right = res.getDimension(R.dimen.timer_padding).toInt() var right = res.getDimension(R.dimen.timer_padding).toInt()
var bottom = 0 var bottom = 0
@ -270,8 +294,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
bottom += height bottom += height
} else { } else {
right += height right += height
bottom += context.navigationBarHeight
} }
mTimeHolder!!.setPadding(left, top, right, bottom) mTimeHolder.setPadding(left, top, right, bottom)
} }
mCurrTimeView = mView.video_curr_time mCurrTimeView = mView.video_curr_time
@ -279,7 +304,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mSeekBar!!.setOnSeekBarChangeListener(this) mSeekBar!!.setOnSeekBarChangeListener(this)
if (mIsFullscreen) if (mIsFullscreen)
mTimeHolder!!.visibility = View.INVISIBLE mTimeHolder.beInvisible()
} }
private fun setupTimeHolder() { private fun setupTimeHolder() {
@ -323,7 +348,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
AnimationUtils.loadAnimation(activity, anim).apply { AnimationUtils.loadAnimation(activity, anim).apply {
duration = 150 duration = 150
fillAfter = true fillAfter = true
mTimeHolder!!.startAnimation(this) mTimeHolder.startAnimation(this)
} }
} }
@ -388,19 +413,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
mMediaPlayer!!.pause() mMediaPlayer!!.pause()
} }
override fun onPause() {
super.onPause()
pauseVideo()
mIsFragmentVisible = false
}
override fun onDestroy() {
super.onDestroy()
if (activity?.isChangingConfigurations == false) {
cleanup()
}
}
private fun cleanup() { private fun cleanup() {
pauseVideo() pauseVideo()
mCurrTimeView?.text = 0.getFormattedDuration() mCurrTimeView?.text = 0.getFormattedDuration()
@ -489,6 +501,25 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} }
} }
private fun checkExtendedDetails() {
if (context.config.showExtendedDetails) {
mView.video_details.apply {
text = getMediumExtendedDetails(medium)
setTextColor(context.config.textColor)
beVisible()
onGlobalLayout {
if (height != 0) {
val smallMargin = resources.getDimension(R.dimen.small_margin)
val timeHolderHeight = mTimeHolder.height - context.navigationBarHeight
y = context.usableScreenSize.y - height - timeHolderHeight - if (context.navigationBarHeight == 0) smallMargin else 0f
}
}
}
} else {
mView.video_details.beGone()
}
}
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
if (mMediaPlayer != null && fromUser) { if (mMediaPlayer != null && fromUser) {
setProgress(progress) setProgress(progress)
@ -517,5 +548,14 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
override fun fullscreenToggled(isFullscreen: Boolean) { override fun fullscreenToggled(isFullscreen: Boolean) {
mIsFullscreen = isFullscreen mIsFullscreen = isFullscreen
checkFullscreen() checkFullscreen()
mView.video_details.apply {
if (visibility == View.VISIBLE) {
val smallMargin = resources.getDimension(R.dimen.small_margin)
val timeHolderHeight = mTimeHolder.height - context.navigationBarHeight.toFloat()
val fullscreenOffset = context.navigationBarHeight.toFloat() - smallMargin
val newY = context.usableScreenSize.y - height + if (mIsFullscreen) fullscreenOffset else -(timeHolderHeight + if (context.navigationBarHeight == 0) smallMargin else 0f)
animate().y(newY)
}
}
} }
} }

View file

@ -1,6 +1,11 @@
package com.simplemobiletools.gallery.fragments package com.simplemobiletools.gallery.fragments
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Medium
import java.io.File
abstract class ViewPagerFragment : Fragment() { abstract class ViewPagerFragment : Fragment() {
var listener: FragmentListener? = null var listener: FragmentListener? = null
@ -12,4 +17,44 @@ abstract class ViewPagerFragment : Fragment() {
fun videoEnded(): Boolean fun videoEnded(): Boolean
} }
fun getMediumExtendedDetails(medium: Medium): String {
val file = File(medium.path)
val path = "${file.parent.trimEnd('/')}/"
val exif = android.media.ExifInterface(medium.path)
val details = StringBuilder()
val detailsFlag = context.config.extendedDetails
if (detailsFlag and EXT_NAME != 0) {
medium.name.let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_PATH != 0) {
path.let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_SIZE != 0) {
file.length().formatSize().let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_RESOLUTION != 0) {
file.getResolution().formatAsResolution().let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_LAST_MODIFIED != 0) {
file.lastModified().formatLastModified().let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_DATE_TAKEN != 0) {
path.getExifDateTaken(exif).let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_CAMERA_MODEL != 0) {
path.getExifCameraModel(exif).let { if (it.isNotEmpty()) details.appendln(it) }
}
if (detailsFlag and EXT_EXIF_PROPERTIES != 0) {
path.getExifProperties(exif).let { if (it.isNotEmpty()) details.appendln(it) }
}
return details.toString().trim()
}
} }

View file

@ -28,17 +28,17 @@ class Config(context: Context) : BaseConfig(context) {
if (path.isEmpty()) { if (path.isEmpty()) {
fileSorting = value fileSorting = value
} else { } else {
prefs.edit().putInt(SORT_FOLDER_PREFIX + path, value).apply() prefs.edit().putInt(SORT_FOLDER_PREFIX + path.toLowerCase(), value).apply()
} }
} }
fun getFileSorting(path: String) = prefs.getInt(SORT_FOLDER_PREFIX + path, fileSorting) fun getFileSorting(path: String) = prefs.getInt(SORT_FOLDER_PREFIX + path.toLowerCase(), fileSorting)
fun removeFileSorting(path: String) { fun removeFileSorting(path: String) {
prefs.edit().remove(SORT_FOLDER_PREFIX + path).apply() prefs.edit().remove(SORT_FOLDER_PREFIX + path.toLowerCase()).apply()
} }
fun hasCustomSorting(path: String) = prefs.contains(SORT_FOLDER_PREFIX + path) fun hasCustomSorting(path: String) = prefs.contains(SORT_FOLDER_PREFIX + path.toLowerCase())
var wasHideFolderTooltipShown: Boolean var wasHideFolderTooltipShown: Boolean
get() = prefs.getBoolean(HIDE_FOLDER_TOOLTIP_SHOWN, false) get() = prefs.getBoolean(HIDE_FOLDER_TOOLTIP_SHOWN, false)
@ -54,6 +54,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(TEMPORARILY_SHOW_HIDDEN, false) get() = prefs.getBoolean(TEMPORARILY_SHOW_HIDDEN, false)
set(temporarilyShowHidden) = prefs.edit().putBoolean(TEMPORARILY_SHOW_HIDDEN, temporarilyShowHidden).apply() set(temporarilyShowHidden) = prefs.edit().putBoolean(TEMPORARILY_SHOW_HIDDEN, temporarilyShowHidden).apply()
var isThirdPartyIntent: Boolean
get() = prefs.getBoolean(IS_THIRD_PARTY_INTENT, false)
set(isThirdPartyIntent) = prefs.edit().putBoolean(IS_THIRD_PARTY_INTENT, isThirdPartyIntent).apply()
var pinnedFolders: Set<String> var pinnedFolders: Set<String>
get() = prefs.getStringSet(PINNED_FOLDERS, HashSet<String>()) get() = prefs.getStringSet(PINNED_FOLDERS, HashSet<String>())
set(pinnedFolders) = prefs.edit().putStringSet(PINNED_FOLDERS, pinnedFolders).apply() set(pinnedFolders) = prefs.edit().putStringSet(PINNED_FOLDERS, pinnedFolders).apply()
@ -156,9 +160,9 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(DARK_BACKGROUND, false) get() = prefs.getBoolean(DARK_BACKGROUND, false)
set(darkBackground) = prefs.edit().putBoolean(DARK_BACKGROUND, darkBackground).apply() set(darkBackground) = prefs.edit().putBoolean(DARK_BACKGROUND, darkBackground).apply()
var showMedia: Int var filterMedia: Int
get() = prefs.getInt(SHOW_MEDIA, IMAGES_AND_VIDEOS) get() = prefs.getInt(FILTER_MEDIA, IMAGES or VIDEOS or GIFS)
set(showMedia) = prefs.edit().putInt(SHOW_MEDIA, showMedia).apply() set(filterMedia) = prefs.edit().putInt(FILTER_MEDIA, filterMedia).apply()
var dirColumnCnt: Int var dirColumnCnt: Int
get() = prefs.getInt(getDirectoryColumnsField(), getDefaultDirectoryColumnCount()) get() = prefs.getInt(getDirectoryColumnsField(), getDefaultDirectoryColumnCount())
@ -233,6 +237,14 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false) get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false)
set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply()
var deleteEmptyFolders: Boolean
get() = prefs.getBoolean(DELETE_EMPTY_FOLDERS, true)
set(deleteEmptyFolders) = prefs.edit().putBoolean(DELETE_EMPTY_FOLDERS, deleteEmptyFolders).apply()
var allowVideoGestures: Boolean
get() = prefs.getBoolean(ALLOW_VIDEO_GESTURES, true)
set(allowVideoGestures) = prefs.edit().putBoolean(ALLOW_VIDEO_GESTURES, allowVideoGestures).apply()
var slideshowInterval: Int var slideshowInterval: Int
get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL) get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL)
set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply() set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply()
@ -245,6 +257,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(SLIDESHOW_INCLUDE_VIDEOS, false) get() = prefs.getBoolean(SLIDESHOW_INCLUDE_VIDEOS, false)
set(slideshowIncludeVideos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_VIDEOS, slideshowIncludeVideos).apply() set(slideshowIncludeVideos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_VIDEOS, slideshowIncludeVideos).apply()
var slideshowIncludeGIFs: Boolean
get() = prefs.getBoolean(SLIDESHOW_INCLUDE_GIFS, false)
set(slideshowIncludeGIFs) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_GIFS, slideshowIncludeGIFs).apply()
var slideshowRandomOrder: Boolean var slideshowRandomOrder: Boolean
get() = prefs.getBoolean(SLIDESHOW_RANDOM_ORDER, false) get() = prefs.getBoolean(SLIDESHOW_RANDOM_ORDER, false)
set(slideshowRandomOrder) = prefs.edit().putBoolean(SLIDESHOW_RANDOM_ORDER, slideshowRandomOrder).apply() set(slideshowRandomOrder) = prefs.edit().putBoolean(SLIDESHOW_RANDOM_ORDER, slideshowRandomOrder).apply()
@ -256,4 +272,28 @@ class Config(context: Context) : BaseConfig(context) {
var slideshowMoveBackwards: Boolean var slideshowMoveBackwards: Boolean
get() = prefs.getBoolean(SLIDESHOW_MOVE_BACKWARDS, false) get() = prefs.getBoolean(SLIDESHOW_MOVE_BACKWARDS, false)
set(slideshowMoveBackwards) = prefs.edit().putBoolean(SLIDESHOW_MOVE_BACKWARDS, slideshowMoveBackwards).apply() set(slideshowMoveBackwards) = prefs.edit().putBoolean(SLIDESHOW_MOVE_BACKWARDS, slideshowMoveBackwards).apply()
var loopSlideshow: Boolean
get() = prefs.getBoolean(SLIDESHOW_LOOP, false)
set(loopSlideshow) = prefs.edit().putBoolean(SLIDESHOW_LOOP, loopSlideshow).apply()
var tempFolderPath: String
get() = prefs.getString(TEMP_FOLDER_PATH, "")
set(tempFolderPath) = prefs.edit().putString(TEMP_FOLDER_PATH, tempFolderPath).apply()
var viewTypeFolders: Int
get() = prefs.getInt(VIEW_TYPE_FOLDERS, VIEW_TYPE_GRID)
set(viewTypeFolders) = prefs.edit().putInt(VIEW_TYPE_FOLDERS, viewTypeFolders).apply()
var viewTypeFiles: Int
get() = prefs.getInt(VIEW_TYPE_FILES, VIEW_TYPE_GRID)
set(viewTypeFiles) = prefs.edit().putInt(VIEW_TYPE_FILES, viewTypeFiles).apply()
var showExtendedDetails: Boolean
get() = prefs.getBoolean(SHOW_EXTENDED_DETAILS, false)
set(showExtendedDetails) = prefs.edit().putBoolean(SHOW_EXTENDED_DETAILS, showExtendedDetails).apply()
var extendedDetails: Int
get() = prefs.getInt(EXTENDED_DETAILS, EXT_RESOLUTION or EXT_LAST_MODIFIED or EXT_EXIF_PROPERTIES)
set(extendedDetails) = prefs.edit().putInt(EXTENDED_DETAILS, extendedDetails).apply()
} }

View file

@ -6,6 +6,7 @@ val DIRECTORY_SORT_ORDER = "directory_sort_order"
val SORT_FOLDER_PREFIX = "sort_folder_" val SORT_FOLDER_PREFIX = "sort_folder_"
val SHOW_HIDDEN_MEDIA = "show_hidden_media" val SHOW_HIDDEN_MEDIA = "show_hidden_media"
val TEMPORARILY_SHOW_HIDDEN = "temporarily_show_hidden" val TEMPORARILY_SHOW_HIDDEN = "temporarily_show_hidden"
val IS_THIRD_PARTY_INTENT = "is_third_party_intent"
val AUTOPLAY_VIDEOS = "autoplay_videos" val AUTOPLAY_VIDEOS = "autoplay_videos"
val LOOP_VIDEOS = "loop_videos" val LOOP_VIDEOS = "loop_videos"
val ANIMATE_GIFS = "animate_gifs" val ANIMATE_GIFS = "animate_gifs"
@ -15,6 +16,7 @@ val SCREEN_ROTATION = "screen_rotation"
val DISPLAY_FILE_NAMES = "display_file_names" val DISPLAY_FILE_NAMES = "display_file_names"
val DARK_BACKGROUND = "dark_background" val DARK_BACKGROUND = "dark_background"
val PINNED_FOLDERS = "pinned_folders" val PINNED_FOLDERS = "pinned_folders"
val FILTER_MEDIA = "filter_media"
val DIR_COLUMN_CNT = "dir_column_cnt" val DIR_COLUMN_CNT = "dir_column_cnt"
val DIR_LANDSCAPE_COLUMN_CNT = "dir_landscape_column_cnt" val DIR_LANDSCAPE_COLUMN_CNT = "dir_landscape_column_cnt"
val DIR_HORIZONTAL_COLUMN_CNT = "dir_horizontal_column_cnt" val DIR_HORIZONTAL_COLUMN_CNT = "dir_horizontal_column_cnt"
@ -24,7 +26,6 @@ val MEDIA_LANDSCAPE_COLUMN_CNT = "media_landscape_column_cnt"
val MEDIA_HORIZONTAL_COLUMN_CNT = "media_horizontal_column_cnt" val MEDIA_HORIZONTAL_COLUMN_CNT = "media_horizontal_column_cnt"
val MEDIA_LANDSCAPE_HORIZONTAL_COLUMN_CNT = "media_landscape_horizontal_column_cnt" val MEDIA_LANDSCAPE_HORIZONTAL_COLUMN_CNT = "media_landscape_horizontal_column_cnt"
val SHOW_ALL = "show_all" // display images and videos from all folders together val SHOW_ALL = "show_all" // display images and videos from all folders together
val SHOW_MEDIA = "show_media"
val SAVE_FOLDER_PREFIX = "folder2_" val SAVE_FOLDER_PREFIX = "folder2_"
val HIDE_FOLDER_TOOLTIP_SHOWN = "hide_folder_tooltip_shown" val HIDE_FOLDER_TOOLTIP_SHOWN = "hide_folder_tooltip_shown"
val EXCLUDED_FOLDERS = "excluded_folders" val EXCLUDED_FOLDERS = "excluded_folders"
@ -33,15 +34,25 @@ val ALBUM_COVERS = "album_covers"
val SCROLL_HORIZONTALLY = "scroll_horizontally" val SCROLL_HORIZONTALLY = "scroll_horizontally"
val HIDE_SYSTEM_UI = "hide_system_ui" val HIDE_SYSTEM_UI = "hide_system_ui"
val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate"
val DELETE_EMPTY_FOLDERS = "delete_empty_folders"
val ALLOW_VIDEO_GESTURES = "allow_video_gestures"
val TEMP_FOLDER_PATH = "temp_folder_path"
val VIEW_TYPE_FOLDERS = "view_type_folders"
val VIEW_TYPE_FILES = "view_type_files"
val SHOW_EXTENDED_DETAILS = "show_extended_details"
val EXTENDED_DETAILS = "extended_details"
// slideshow // slideshow
val SLIDESHOW_INTERVAL = "slideshow_interval" val SLIDESHOW_INTERVAL = "slideshow_interval"
val SLIDESHOW_INCLUDE_PHOTOS = "slideshow_include_photos" val SLIDESHOW_INCLUDE_PHOTOS = "slideshow_include_photos"
val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos" val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos"
val SLIDESHOW_INCLUDE_GIFS = "slideshow_include_gifs"
val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order" val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order"
val SLIDESHOW_USE_FADE = "slideshow_use_fade" val SLIDESHOW_USE_FADE = "slideshow_use_fade"
val SLIDESHOW_MOVE_BACKWARDS = "slideshow_move_backwards" val SLIDESHOW_MOVE_BACKWARDS = "slideshow_move_backwards"
val SLIDESHOW_LOOP = "loop_slideshow"
val SLIDESHOW_DEFAULT_INTERVAL = 5 val SLIDESHOW_DEFAULT_INTERVAL = 5
val SLIDESHOW_SCROLL_DURATION = 500L
val NOMEDIA = ".nomedia" val NOMEDIA = ".nomedia"
@ -53,15 +64,12 @@ val GET_ANY_INTENT = "get_any_intent"
val SET_WALLPAPER_INTENT = "set_wallpaper_intent" val SET_WALLPAPER_INTENT = "set_wallpaper_intent"
val DIRECTORIES = "directories2" val DIRECTORIES = "directories2"
val IS_VIEW_INTENT = "is_view_intent" val IS_VIEW_INTENT = "is_view_intent"
val IS_FROM_GALLERY = "is_from_gallery"
val PICKED_PATHS = "picked_paths"
val REQUEST_EDIT_IMAGE = 1 val REQUEST_EDIT_IMAGE = 1
val REQUEST_SET_AS = 2 val REQUEST_SET_AS = 2
// show media
val IMAGES_AND_VIDEOS = 0
val IMAGES = 1
val VIDEOS = 2
// rotations // rotations
val ROTATE_BY_SYSTEM_SETTING = 0 val ROTATE_BY_SYSTEM_SETTING = 0
val ROTATE_BY_DEVICE_ROTATION = 1 val ROTATE_BY_DEVICE_ROTATION = 1
@ -70,4 +78,25 @@ val ROTATE_BY_ASPECT_RATIO = 2
val ORIENT_PORTRAIT = 0 val ORIENT_PORTRAIT = 0
val ORIENT_LANDSCAPE_LEFT = 1 val ORIENT_LANDSCAPE_LEFT = 1
val ORIENT_LANDSCAPE_RIGHT = 2 val ORIENT_LANDSCAPE_RIGHT = 2
val ORIENT_UPSIDE_DOWN = 3
// filter media
val IMAGES = 1
val VIDEOS = 2
val GIFS = 4
// view types
val VIEW_TYPE_GRID = 1
val VIEW_TYPE_LIST = 2
// extended details values
val EXT_NAME = 1
val EXT_PATH = 2
val EXT_SIZE = 4
val EXT_RESOLUTION = 8
val EXT_LAST_MODIFIED = 16
val EXT_DATE_TAKEN = 32
val EXT_CAMERA_MODEL = 64
val EXT_EXIF_PROPERTIES = 128
val EXT_DURATION = 256
val EXT_ARTIST = 512
val EXT_ALBUM = 1024

View file

@ -0,0 +1,70 @@
package com.simplemobiletools.gallery.helpers
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.media.ExifInterface
import android.net.Uri
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.Target
import com.davemorrissey.labs.subscaleview.decoder.ImageDecoder
import com.simplemobiletools.gallery.activities.ViewPagerActivity
import com.simplemobiletools.gallery.extensions.getFileSignature
class GlideDecoder : ImageDecoder {
override fun decode(context: Context, uri: Uri): Bitmap {
val exif = android.media.ExifInterface(uri.path)
val orientation = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL)
val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth
val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight
val options = RequestOptions()
.signature(uri.path.getFileSignature())
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.override(targetWidth, targetHeight)
val degrees = getRotationDegrees(orientation)
if (degrees != 0f)
options.transform(GlideRotateTransformation(context, getRotationDegrees(orientation)))
val drawable = Glide.with(context)
.load(uri)
.apply(options)
.submit()
.get()
return drawableToBitmap(drawable)
}
private fun drawableToBitmap(drawable: Drawable): Bitmap {
if (drawable is BitmapDrawable) {
if (drawable.bitmap != null) {
return drawable.bitmap
}
}
val bitmap = if (drawable.intrinsicWidth <= 0 || drawable.intrinsicHeight <= 0) {
Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888)
} else {
Bitmap.createBitmap(drawable.intrinsicWidth, drawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
}
val canvas = Canvas(bitmap)
drawable.setBounds(0, 0, canvas.width, canvas.height)
drawable.draw(canvas)
return bitmap
}
// rotating backwards intentionally, as SubsamplingScaleImageView will rotate it properly at displaying
private fun getRotationDegrees(orientation: Int) = when (orientation) {
ExifInterface.ORIENTATION_ROTATE_270 -> 90f
ExifInterface.ORIENTATION_ROTATE_180 -> 180f
ExifInterface.ORIENTATION_ROTATE_90 -> 270f
else -> 0f
}
}

View file

@ -0,0 +1,331 @@
package com.simplemobiletools.gallery.helpers
import android.content.Context
import android.database.Cursor
import android.provider.MediaStore
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED
import com.simplemobiletools.commons.helpers.SORT_BY_NAME
import com.simplemobiletools.commons.helpers.SORT_BY_SIZE
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.extensions.containsNoMedia
import com.simplemobiletools.gallery.models.Medium
import java.io.File
import java.util.LinkedHashMap
import kotlin.collections.ArrayList
import kotlin.collections.component1
import kotlin.collections.component2
class MediaFetcher(val context: Context) {
var shouldStop = false
fun getMediaByDirectories(isPickVideo: Boolean, isPickImage: Boolean): HashMap<String, ArrayList<Medium>> {
val media = getFilesFrom("", isPickImage, isPickVideo)
val excludedPaths = context.config.excludedFolders
val includedPaths = context.config.includedFolders
val showHidden = context.config.shouldShowHidden
val directories = groupDirectories(media)
val removePaths = ArrayList<String>()
for ((path, curMedia) in directories) {
// make sure the path has uppercase letters wherever appropriate
val groupPath = File(curMedia.first().path).parent
if (!File(groupPath).exists() || !shouldFolderBeVisible(groupPath, excludedPaths, includedPaths, showHidden)) {
removePaths.add(groupPath.toLowerCase())
}
}
removePaths.forEach {
directories.remove(it)
}
return directories
}
fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean): ArrayList<Medium> {
val projection = arrayOf(MediaStore.Images.Media._ID,
MediaStore.Images.Media.DISPLAY_NAME,
MediaStore.Images.Media.DATE_TAKEN,
MediaStore.Images.Media.DATE_MODIFIED,
MediaStore.Images.Media.DATA,
MediaStore.Images.Media.SIZE)
val uri = MediaStore.Files.getContentUri("external")
val selection = getSelectionQuery(curPath)
val selectionArgs = getSelectionArgsQuery(curPath)
return try {
val cur = context.contentResolver.query(uri, projection, selection, selectionArgs, getSortingForFolder(curPath))
parseCursor(context, cur, isPickImage, isPickVideo, curPath)
} catch (e: Exception) {
ArrayList()
}
}
private fun getSelectionQuery(path: String): String? {
val dataQuery = "${MediaStore.Images.Media.DATA} LIKE ?"
return if (path.isEmpty()) {
if (context.isAndroidFour())
return null
var query = "($dataQuery)"
if (context.hasExternalSDCard()) {
query += " OR ($dataQuery)"
}
query
} else {
"($dataQuery AND ${MediaStore.Images.Media.DATA} NOT LIKE ?)"
}
}
private fun getSelectionArgsQuery(path: String): Array<String>? {
return if (path.isEmpty()) {
if (context.isAndroidFour())
return null
if (context.hasExternalSDCard()) {
arrayOf("${context.internalStoragePath}/%", "${context.sdCardPath}/%")
} else {
arrayOf("${context.internalStoragePath}/%")
}
} else {
arrayOf("$path/%", "$path/%/%")
}
}
private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isPickVideo: Boolean, curPath: String): ArrayList<Medium> {
val curMedia = ArrayList<Medium>()
val config = context.config
val filterMedia = config.filterMedia
val showHidden = config.shouldShowHidden
val includedFolders = config.includedFolders.map { "${it.trimEnd('/')}/" }
val excludedFolders = config.excludedFolders.map { "${it.trimEnd('/')}/" }
val noMediaFolders = getNoMediaFolders()
val isThirdPartyIntent = config.isThirdPartyIntent
cur.use {
if (cur.moveToFirst()) {
do {
try {
if (shouldStop)
break
val path = cur.getStringValue(MediaStore.Images.Media.DATA).trim()
var filename = cur.getStringValue(MediaStore.Images.Media.DISPLAY_NAME)?.trim() ?: ""
if (filename.isEmpty())
filename = path.getFilenameFromPath()
val isImage = filename.isImageFast()
val isVideo = if (isImage) false else filename.isVideoFast()
val isGif = if (isImage || isVideo) false else filename.isGif()
if (!isImage && !isVideo && !isGif)
continue
if (isVideo && (isPickImage || filterMedia and VIDEOS == 0))
continue
if (isImage && (isPickVideo || filterMedia and IMAGES == 0))
continue
if (isGif && filterMedia and GIFS == 0)
continue
if (!showHidden && filename.startsWith('.'))
continue
var size = cur.getLongValue(MediaStore.Images.Media.SIZE)
val file = File(path)
if (size == 0L) {
size = file.length()
}
if (size <= 0L)
continue
var isExcluded = false
excludedFolders.forEach {
if (path.startsWith(it)) {
isExcluded = true
includedFolders.forEach {
if (path.startsWith(it)) {
isExcluded = false
}
}
}
}
if (!isExcluded && !showHidden) {
noMediaFolders.forEach {
if (path.startsWith(it)) {
isExcluded = true
}
}
}
if (!isExcluded && !showHidden && path.contains("/.")) {
isExcluded = true
}
if (!isExcluded || isThirdPartyIntent) {
if (!file.exists())
continue
val dateTaken = cur.getLongValue(MediaStore.Images.Media.DATE_TAKEN)
val dateModified = cur.getIntValue(MediaStore.Images.Media.DATE_MODIFIED) * 1000L
val medium = Medium(filename, path, isVideo, dateModified, dateTaken, size)
curMedia.add(medium)
}
} catch (e: Exception) {
continue
}
} while (cur.moveToNext())
}
}
config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.forEach {
getMediaInFolder(it, curMedia, isPickImage, isPickVideo, filterMedia)
}
if (isThirdPartyIntent && curPath.isNotEmpty() && curMedia.isEmpty()) {
getMediaInFolder(curPath, curMedia, isPickImage, isPickVideo, filterMedia)
}
Medium.sorting = config.getFileSorting(curPath)
curMedia.sort()
return curMedia
}
private fun groupDirectories(media: ArrayList<Medium>): HashMap<String, ArrayList<Medium>> {
val directories = LinkedHashMap<String, ArrayList<Medium>>()
for (medium in media) {
if (shouldStop)
break
val parentDir = File(medium.path).parent?.toLowerCase() ?: continue
if (directories.containsKey(parentDir)) {
directories[parentDir]!!.add(medium)
} else {
directories.put(parentDir, arrayListOf(medium))
}
}
return directories
}
private fun shouldFolderBeVisible(path: String, excludedPaths: MutableSet<String>, includedPaths: MutableSet<String>, showHidden: Boolean): Boolean {
val file = File(path)
return if (includedPaths.contains(path)) {
true
} else if (isThisOrParentExcluded(path, excludedPaths, includedPaths)) {
false
} else if (!showHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) {
var containsNoMediaOrDot = file.containsNoMedia() || path.contains("/.")
if (!containsNoMediaOrDot) {
containsNoMediaOrDot = checkParentHasNoMedia(file.parentFile)
}
!containsNoMediaOrDot
} else {
true
}
}
private fun checkParentHasNoMedia(file: File): Boolean {
var curFile = file
while (true) {
if (curFile.containsNoMedia()) {
return true
}
curFile = curFile.parentFile
if (curFile.absolutePath == "/")
break
}
return false
}
private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet<String>, includedPaths: MutableSet<String>) =
includedPaths.none { path.startsWith(it) } && excludedPaths.any { path.startsWith(it) }
private fun getMediaInFolder(folder: String, curMedia: ArrayList<Medium>, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int) {
val files = File(folder).listFiles() ?: return
for (file in files) {
if (shouldStop)
break
val filename = file.name
val isImage = filename.isImageFast()
val isVideo = if (isImage) false else filename.isVideoFast()
val isGif = if (isImage || isVideo) false else filename.isGif()
if (!isImage && !isVideo)
continue
if (isVideo && (isPickImage || filterMedia and VIDEOS == 0))
continue
if (isImage && (isPickVideo || filterMedia and IMAGES == 0))
continue
if (isGif && filterMedia and GIFS == 0)
continue
val size = file.length()
if (size <= 0L)
continue
val dateTaken = file.lastModified()
val dateModified = file.lastModified()
val medium = Medium(filename, file.absolutePath, isVideo, dateModified, dateTaken, size)
val isAlreadyAdded = curMedia.any { it.path == file.absolutePath }
if (!isAlreadyAdded) {
curMedia.add(medium)
context.scanPath(file.absolutePath) {}
}
}
}
private fun getSortingForFolder(path: String): String {
val sorting = context.config.getFileSorting(path)
val sortValue = when {
sorting and SORT_BY_NAME > 0 -> MediaStore.Images.Media.DISPLAY_NAME
sorting and SORT_BY_SIZE > 0 -> MediaStore.Images.Media.SIZE
sorting and SORT_BY_DATE_MODIFIED > 0 -> MediaStore.Images.Media.DATE_MODIFIED
else -> MediaStore.Images.Media.DATE_TAKEN
}
return if (sorting and SORT_DESCENDING > 0)
"$sortValue DESC"
else
"$sortValue ASC"
}
private fun getNoMediaFolders(): ArrayList<String> {
val folders = ArrayList<String>()
val noMediaCondition = "${MediaStore.Files.FileColumns.MEDIA_TYPE} = ${MediaStore.Files.FileColumns.MEDIA_TYPE_NONE}"
val uri = MediaStore.Files.getContentUri("external")
val columns = arrayOf(MediaStore.Files.FileColumns.DATA)
val where = "$noMediaCondition AND ${MediaStore.Files.FileColumns.TITLE} LIKE ?"
val args = arrayOf("%$NOMEDIA%")
var cursor: Cursor? = null
try {
cursor = context.contentResolver.query(uri, columns, where, args, null)
if (cursor?.moveToFirst() == true) {
do {
val path = cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA)) ?: continue
val noMediaFile = File(path)
if (noMediaFile.exists())
folders.add("${noMediaFile.parent}/")
} while (cursor.moveToNext())
}
} finally {
cursor?.close()
}
return folders
}
}

View file

@ -4,41 +4,32 @@ import com.simplemobiletools.commons.helpers.*
import java.io.Serializable import java.io.Serializable
data class Directory(val path: String, val tmb: String, val name: String, var mediaCnt: Int, val modified: Long, val taken: Long, data class Directory(val path: String, val tmb: String, val name: String, var mediaCnt: Int, val modified: Long, val taken: Long,
var size: Long) : Serializable, Comparable<Directory> { val size: Long) : Serializable, Comparable<Directory> {
companion object { companion object {
private val serialVersionUID = -6553345863555455L private val serialVersionUID = -6553345863555455L
var sorting: Int = 0 var sorting: Int = 0
} }
fun addSize(bytes: Long) {
size += bytes
}
override fun compareTo(other: Directory): Int { override fun compareTo(other: Directory): Int {
var result: Int var result: Int
if (sorting and SORT_BY_NAME != 0) { when {
result = AlphanumComparator().compare(name.toLowerCase(), other.name.toLowerCase()) sorting and SORT_BY_NAME != 0 -> result = AlphanumericComparator().compare(name.toLowerCase(), other.name.toLowerCase())
} else if (sorting and SORT_BY_SIZE != 0) { sorting and SORT_BY_PATH != 0 -> result = AlphanumericComparator().compare(path.toLowerCase(), other.path.toLowerCase())
result = if (size == other.size) sorting and SORT_BY_SIZE != 0 -> result = when {
0 size == other.size -> 0
else if (size > other.size) size > other.size -> 1
1 else -> -1
else }
-1 sorting and SORT_BY_DATE_MODIFIED != 0 -> result = when {
} else if (sorting and SORT_BY_DATE_MODIFIED != 0) { modified == other.modified -> 0
result = if (modified == other.modified) modified > other.modified -> 1
0 else -> -1
else if (modified > other.modified) }
1 else -> result = when {
else taken == other.taken -> 0
-1 taken > other.taken -> 1
} else { else -> -1
result = if (taken == other.taken) }
0
else if (taken > other.taken)
1
else
-1
} }
if (sorting and SORT_DESCENDING != 0) { if (sorting and SORT_DESCENDING != 0) {

View file

@ -25,29 +25,23 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo
override fun compareTo(other: Medium): Int { override fun compareTo(other: Medium): Int {
var result: Int var result: Int
if (sorting and SORT_BY_NAME != 0) { when {
result = AlphanumComparator().compare(name.toLowerCase(), other.name.toLowerCase()) sorting and SORT_BY_NAME != 0 -> result = AlphanumericComparator().compare(name.toLowerCase(), other.name.toLowerCase())
} else if (sorting and SORT_BY_SIZE != 0) { sorting and SORT_BY_SIZE != 0 -> result = when {
result = if (size == other.size) size == other.size -> 0
0 size > other.size -> 1
else if (size > other.size) else -> -1
1 }
else sorting and SORT_BY_DATE_MODIFIED != 0 -> result = when {
-1 modified == other.modified -> 0
} else if (sorting and SORT_BY_DATE_MODIFIED != 0) { modified > other.modified -> 1
result = if (modified == other.modified) else -> -1
0 }
else if (modified > other.modified) else -> result = when {
1 taken == other.taken -> 0
else taken > other.taken -> 1
-1 else -> -1
} else { }
result = if (taken == other.taken)
0
else if (taken > other.taken)
1
else
-1
} }
if (sorting and SORT_DESCENDING != 0) { if (sorting and SORT_DESCENDING != 0) {

View file

@ -14,8 +14,7 @@ class MySquareImageView : ImageView {
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle)
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec) val spec = if (isVerticalScrolling) widthMeasureSpec else heightMeasureSpec
val spec = if (isVerticalScrolling) measuredWidth else measuredHeight super.onMeasure(spec, spec)
setMeasuredDimension(spec, spec)
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -11,6 +11,28 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/directories_empty_text_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingLeft="@dimen/big_margin"
android:paddingRight="@dimen/big_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/no_media_with_filters"
android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/directories_empty_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/directories_empty_text_label"
android:layout_centerHorizontal="true"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin"
android:text="@string/change_filters_underlined"
android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyScalableRecyclerView <com.simplemobiletools.commons.views.MyScalableRecyclerView
android:id="@+id/directories_grid" android:id="@+id/directories_grid"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -11,6 +11,28 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/media_empty_text_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingLeft="@dimen/big_margin"
android:paddingRight="@dimen/big_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/no_media_with_filters"
android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/media_empty_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/media_empty_text_label"
android:layout_centerHorizontal="true"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin"
android:text="@string/change_filters_underlined"
android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyScalableRecyclerView <com.simplemobiletools.commons.views.MyScalableRecyclerView
android:id="@+id/media_grid" android:id="@+id/media_grid"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -288,6 +288,85 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_delete_empty_folders_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_delete_empty_folders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/delete_empty_folders"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_allow_video_gestures_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_allow_video_gestures"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/allow_video_gestures"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_extended_details_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_show_extended_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/show_extended_details"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_extended_details_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_extended_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/manage_extended_details"/>
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/settings_screen_rotation_holder" android:id="@+id/settings_screen_rotation_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -322,40 +401,5 @@
android:clickable="false"/> android:clickable="false"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_media_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/bigger_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/bigger_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_media_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/settings_show_media"
android:layout_toStartOf="@+id/settings_show_media"
android:paddingLeft="@dimen/medium_margin"
android:paddingRight="@dimen/medium_margin"
android:text="@string/show_media"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_media"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="@dimen/small_margin"
android:layout_marginRight="@dimen/small_margin"
android:background="@null"
android:clickable="false"/>
</RelativeLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View file

@ -28,6 +28,14 @@
android:paddingTop="@dimen/medium_margin" android:paddingTop="@dimen/medium_margin"
android:text="@string/name"/> android:text="@string/name"/>
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/sorting_dialog_radio_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/medium_margin"
android:paddingTop="@dimen/medium_margin"
android:text="@string/path"/>
<com.simplemobiletools.commons.views.MyCompatRadioButton <com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/sorting_dialog_radio_size" android:id="@+id/sorting_dialog_radio_size"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/delete_remember_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/big_margin"
android:paddingRight="@dimen/big_margin"
android:paddingTop="@dimen/big_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/delete_remember_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:text="@string/proceed_with_deletion"
android:textSize="@dimen/bigger_text_size"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/delete_remember_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/delete_remember_title"
android:text="@string/do_not_ask_again"/>
</RelativeLayout>

View file

@ -10,7 +10,7 @@
<com.simplemobiletools.commons.views.MyScalableRecyclerView <com.simplemobiletools.commons.views.MyScalableRecyclerView
android:id="@+id/directories_grid" android:id="@+id/directories_grid"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:scrollbars="none" android:scrollbars="none"
app:layoutManager="android.support.v7.widget.GridLayoutManager" app:layoutManager="android.support.v7.widget.GridLayoutManager"
app:spanCount="@integer/directory_columns_vertical_scroll"/> app:spanCount="@integer/directory_columns_vertical_scroll"/>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/filter_media_dialog_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/filter_media_images"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/images"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/filter_media_videos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/videos"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/filter_media_gifs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/gifs"/>
</LinearLayout>

View file

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/manage_extended_details_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/manage_extended_details_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/filename"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/path"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/size"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_resolution"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/resolution"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_last_modified"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/last_modified"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_date_taken"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/date_taken"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_camera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/camera"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_exif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/exif"/>
<ImageView
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/divider_weak"
android:importantForAccessibility="no"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_duration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/duration"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_artist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/artist"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/manage_extended_details_album"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/album"/>
</LinearLayout>
</ScrollView>

View file

@ -1,10 +1,54 @@
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/media_grid" android:id="@+id/media_grid_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin" android:paddingTop="@dimen/activity_margin">
app:layoutManager="android.support.v7.widget.GridLayoutManager"
app:spanCount="@integer/media_columns_vertical_scroll"/> <com.simplemobiletools.commons.views.MyScalableRecyclerView
android:id="@+id/media_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
app:layoutManager="android.support.v7.widget.GridLayoutManager"
app:spanCount="@integer/media_columns_vertical_scroll"/>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_vertical_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:paddingLeft="@dimen/normal_margin"
android:paddingStart="@dimen/normal_margin">
<ImageView
android:id="@+id/fastscroller_handle_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:alpha="0"
android:background="@drawable/fastscroller_handle_vertical"/>
</com.simplemobiletools.commons.views.FastScroller>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_horizontal_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:paddingTop="@dimen/normal_margin">
<ImageView
android:id="@+id/fastscroller_handle_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:alpha="0"
android:background="@drawable/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</RelativeLayout>

View file

@ -78,7 +78,7 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/random_order_holder" android:id="@+id/include_gifs_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/include_videos_holder" android:layout_below="@+id/include_videos_holder"
@ -88,6 +88,27 @@
android:paddingStart="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin"
android:paddingTop="@dimen/activity_margin"> android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/include_gifs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:text="@string/include_gifs"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/random_order_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/include_gifs_holder"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat <com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/random_order" android:id="@+id/random_order"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -140,5 +161,26 @@
android:text="@string/move_backwards"/> android:text="@string/move_backwards"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/loop_slideshow_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/move_backwards_holder"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/loop_slideshow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:text="@string/loop_slideshow"/>
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>

View file

@ -39,7 +39,9 @@
android:id="@+id/dir_shadow_holder" android:id="@+id/dir_shadow_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/tmb_shadow_height" android:layout_height="@dimen/tmb_shadow_height"
android:layout_alignLeft="@+id/dir_bottom_holder"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/dir_bottom_holder"
android:background="@drawable/gradient_background"/> android:background="@drawable/gradient_background"/>
<LinearLayout <LinearLayout
@ -80,8 +82,7 @@
android:layout_width="@dimen/sd_card_icon_size" android:layout_width="@dimen/sd_card_icon_size"
android:layout_height="@dimen/sd_card_icon_size" android:layout_height="@dimen/sd_card_icon_size"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true" android:layout_alignRight="@+id/dir_bottom_holder"
android:layout_alignParentRight="true"
android:alpha="0.8" android:alpha="0.8"
android:paddingBottom="@dimen/small_margin" android:paddingBottom="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin" android:paddingEnd="@dimen/small_margin"

View file

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dir_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
<com.simplemobiletools.gallery.views.MySquareImageView
android:id="@+id/dir_thumbnail"
android:layout_width="@dimen/list_view_folder_thumbnail_size"
android:layout_height="@dimen/list_view_folder_thumbnail_size"/>
<ImageView
android:id="@+id/dir_check"
android:layout_width="@dimen/selection_check_size"
android:layout_height="@dimen/selection_check_size"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="@dimen/small_margin"
android:background="@drawable/circle_background"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_check"/>
<TextView
android:id="@+id/dir_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/dir_thumbnail"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@android:color/white"
android:textSize="@dimen/bigger_text_size"/>
<TextView
android:id="@+id/dir_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/dir_name"
android:layout_below="@+id/dir_name"
android:layout_marginRight="@dimen/activity_margin"
android:alpha="0.4"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="6dp"
android:textColor="@android:color/white"
android:textSize="@dimen/smaller_text_size"/>
<TextView
android:id="@+id/photo_cnt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/dir_name"
android:layout_toRightOf="@+id/dir_name"
android:alpha="0.4"
android:textColor="@android:color/white"
android:textSize="@dimen/smaller_text_size"/>
<LinearLayout
android:id="@+id/dir_icon_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/small_margin"
android:gravity="end"
android:orientation="horizontal"
android:paddingBottom="@dimen/tiny_margin">
<ImageView
android:id="@+id/dir_sd_card"
android:layout_width="@dimen/sd_card_icon_size"
android:layout_height="@dimen/sd_card_icon_size"
android:paddingBottom="@dimen/small_margin"
android:src="@drawable/ic_sd_card"
android:visibility="gone"/>
<ImageView
android:id="@+id/dir_pin"
android:layout_width="@dimen/sd_card_icon_size"
android:layout_height="@dimen/sd_card_icon_size"
android:paddingBottom="@dimen/small_margin"
android:src="@drawable/ic_pin"
android:visibility="gone"/>
</LinearLayout>
<TextView
android:id="@+id/dir_list_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignBottom="@+id/dir_thumbnail"
android:layout_marginTop="2dp"
android:layout_toRightOf="@+id/dir_thumbnail"
android:background="@drawable/divider"/>
</RelativeLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/photo_holder" android:id="@+id/photo_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -16,4 +17,17 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone"/> android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/photo_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginRight="@dimen/small_margin"
android:background="@color/gradient_grey_start"
android:padding="@dimen/small_margin"
android:textSize="@dimen/smaller_text_size"
android:visibility="gone"
tools:text="My image\nAnother line"/>
</RelativeLayout> </RelativeLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/video_holder" android:id="@+id/video_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -50,6 +51,19 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/extra_big_text_size"/> android:textSize="@dimen/extra_big_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/video_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginRight="@dimen/small_margin"
android:background="@color/gradient_grey_start"
android:padding="@dimen/small_margin"
android:textSize="@dimen/smaller_text_size"
android:visibility="gone"
tools:text="My video\nAnother line"/>
<RelativeLayout <RelativeLayout
android:id="@+id/video_time_holder" android:id="@+id/video_time_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/media_item_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
<com.simplemobiletools.gallery.views.MySquareImageView
android:id="@+id/medium_thumbnail"
android:layout_width="@dimen/list_view_folder_thumbnail_size"
android:layout_height="@dimen/list_view_folder_thumbnail_size"/>
<ImageView
android:id="@+id/medium_check"
android:layout_width="@dimen/selection_check_size"
android:layout_height="@dimen/selection_check_size"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="@dimen/small_margin"
android:background="@drawable/circle_background"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_check"/>
<TextView
android:id="@+id/photo_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/medium_thumbnail"
android:layout_alignTop="@+id/medium_thumbnail"
android:layout_toRightOf="@+id/medium_thumbnail"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="3"
android:paddingLeft="6dp"
android:paddingRight="@dimen/normal_margin"
android:textColor="@android:color/white"
android:textSize="@dimen/bigger_text_size"/>
<ImageView
android:id="@+id/play_outline"
android:layout_width="@dimen/play_outline_icon_size"
android:layout_height="@dimen/play_outline_icon_size"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/small_margin"
android:paddingBottom="6dp"
android:src="@drawable/img_play_outline_empty"
android:visibility="gone"/>
<TextView
android:id="@+id/dir_list_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignBottom="@+id/medium_thumbnail"
android:layout_marginTop="2dp"
android:layout_toRightOf="@+id/medium_thumbnail"
android:background="@drawable/divider"/>
</RelativeLayout>

View file

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/cab_confirm_selection"
android:icon="@drawable/ic_check"
android:title="@string/confirm_selection"
app:showAsAction="ifRoom"/>
<item <item
android:id="@+id/cab_delete" android:id="@+id/cab_delete"
android:icon="@drawable/ic_delete" android:icon="@drawable/ic_delete"

View file

@ -11,6 +11,15 @@
android:icon="@drawable/ic_camera" android:icon="@drawable/ic_camera"
android:title="@string/open_camera" android:title="@string/open_camera"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item
android:id="@+id/filter"
android:icon="@drawable/ic_filter"
android:title="@string/filter_media"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/change_view_type"
android:title="@string/change_view_type"
app:showAsAction="never"/>
<item <item
android:id="@+id/show_all" android:id="@+id/show_all"
android:title="@string/show_all" android:title="@string/show_all"
@ -23,6 +32,10 @@
android:id="@+id/stop_showing_hidden" android:id="@+id/stop_showing_hidden"
android:title="@string/stop_showing_hidden" android:title="@string/stop_showing_hidden"
app:showAsAction="never"/> app:showAsAction="never"/>
<item
android:id="@+id/create_new_folder"
android:title="@string/create_new_folder"
app:showAsAction="never"/>
<item <item
android:id="@+id/increase_column_count" android:id="@+id/increase_column_count"
android:title="@string/increase_column_count" android:title="@string/increase_column_count"

View file

@ -11,6 +11,11 @@
android:icon="@drawable/ic_label" android:icon="@drawable/ic_label"
android:title="@string/toggle_filename" android:title="@string/toggle_filename"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item
android:id="@+id/filter"
android:icon="@drawable/ic_filter"
android:title="@string/filter_media"
app:showAsAction="ifRoom"/>
<item <item
android:id="@+id/folder_view" android:id="@+id/folder_view"
android:title="@string/folder_view" android:title="@string/folder_view"
@ -20,6 +25,10 @@
android:icon="@drawable/ic_camera" android:icon="@drawable/ic_camera"
android:title="@string/open_camera" android:title="@string/open_camera"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item
android:id="@+id/change_view_type"
android:title="@string/change_view_type"
app:showAsAction="never"/>
<item <item
android:id="@+id/hide_folder" android:id="@+id/hide_folder"
android:title="@string/hide_folder" android:title="@string/hide_folder"

View file

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Simple Gallery</string>
<string name="app_launcher_name">Gallery</string>
<string name="edit">Edit</string>
<string name="open_camera">Open camera</string>
<string name="open_with">Open with</string>
<string name="no_app_found">No valid app found</string>
<string name="hidden">(hidden)</string>
<string name="pin_folder">Pin folder</string>
<string name="unpin_folder">Unpin folder</string>
<string name="show_all">Show all folders content</string>
<string name="all_folders">All folders</string>
<string name="folder_view">Switch to folder view</string>
<string name="other_folder">Other folder</string>
<string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<string name="no_camera_app_found">No Camera app has been found</string>
<string name="increase_column_count">Increase column count</string>
<string name="reduce_column_count">Reduce column count</string>
<string name="change_cover_image">Change cover image</string>
<string name="select_photo">Select photo</string>
<string name="use_default">Use default</string>
<string name="set_as">Set as</string>
<string name="volume">Volume</string>
<string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude -->
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string>
<string name="manage_excluded_folders">Manage excluded folders</string>
<string name="exclude_folder_description">This will exclude the selection together with its subfolders from Simple Gallery only. You can manage excluded folders in Settings.</string>
<string name="exclude_folder_parent">Exclude a parent instead?</string>
<string name="excluded_activity_placeholder">Excluding folders will make them together with their subfolders hidden just in Simple Gallery, they will still be visible in other applications.\n\nIf you want to hide them from other apps too, use the Hide function.</string>
<string name="remove_all">Remove all</string>
<string name="remove_all_description">Remove all folders from the list of excluded? This will not delete the folders.</string>
<!-- Include folders -->
<string name="include_folders">Included folders</string>
<string name="manage_included_folders">Manage included folders</string>
<string name="add_folder">Add folder</string>
<string name="included_activity_placeholder">If you have some folders which contain media, but were not recognized by the app, you can add them manually here.\n\nAdding some items here will not exclude any other folder.</string>
<!-- Resizing -->
<string name="resize">Resize</string>
<string name="resize_and_save">Resize selection and save</string>
<string name="width">Width</string>
<string name="height">Height</string>
<string name="keep_aspect_ratio">Keep aspect ratio</string>
<string name="invalid_values">Please enter a valid resolution</string>
<!-- Editor -->
<string name="editor">Editor</string>
<string name="save">Save</string>
<string name="rotate">Rotate</string>
<string name="path">Path</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>
<string name="no_editor_found">No image editor found</string>
<string name="unknown_file_location">Unknown file location</string>
<string name="error_saving_file">Could not overwrite the source file</string>
<string name="rotate_left">Rotate left</string>
<string name="rotate_right">Rotate right</string>
<string name="rotate_one_eighty">Rotate by 180º</string>
<string name="flip">Flip</string>
<string name="flip_horizontally">Flip horizontally</string>
<string name="flip_vertically">Flip vertically</string>
<string name="edit_with">Edit with</string>
<!-- Set wallpaper -->
<string name="simple_wallpaper">Simple Wallpaper</string>
<string name="set_as_wallpaper">Set as Wallpaper</string>
<string name="set_as_wallpaper_failed">Setting as Wallpaper failed</string>
<string name="set_as_wallpaper_with">Set as wallpaper with:</string>
<string name="no_capable_app_found">No app capable of it has been found</string>
<string name="setting_wallpaper">Setting wallpaper&#8230;</string>
<string name="wallpaper_set_successfully">Wallpaper set successfully</string>
<string name="portrait_aspect_ratio">Portrait aspect ratio</string>
<string name="landscape_aspect_ratio">Landscape aspect ratio</string>
<!-- Slideshow -->
<string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings -->
<string name="show_hidden_media">Show hidden media</string>
<string name="autoplay_videos">Play videos automatically</string>
<string name="toggle_filename">Toggle filename visibility</string>
<string name="loop_videos">Loop videos</string>
<string name="animate_gifs">Animate GIFs at thumbnails</string>
<string name="max_brightness">Max brightness when viewing media</string>
<string name="crop_thumbnails">Crop thumbnails into squares</string>
<string name="screen_rotation_by">Rotate fullscreen media by</string>
<string name="screen_rotation_system_setting">System setting</string>
<string name="screen_rotation_device_rotation">Device rotation</string>
<string name="screen_rotation_aspect_ratio">Aspect ratio</string>
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->
<string name="app_short_description">A gallery for viewing photos and videos without ads.</string>
<string name="app_long_description">
A simple tool usable for viewing photos and videos. Items can be sorted by date, size, name both ascending or descending, photos can be zoomed in. Media files are shown in multiple columns depending on the size of the display, you can change the column count by pinch gestures. They can be renamed, shared, deleted, copied, moved. Images can also be cropped, rotated, flipped or set as Wallpaper directly from the app.
The Gallery is also offered for third party usage for previewing images / videos, adding attachments at email clients etc. It\'s perfect for everyday usage.
Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.
This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View file

@ -25,6 +25,15 @@
<string name="set_as">Nastavit jako</string> <string name="set_as">Nastavit jako</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brightness</string> <string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Tato funkce skryje složku, včetně podsložek, přidáním souboru \'.nomedia\'. Zobrazíte je zvolením možnosti \'Zobrazit skryté složky\' v nastavení. Pokračovat?</string> <string name="hide_folder_description">Tato funkce skryje složku, včetně podsložek, přidáním souboru \'.nomedia\'. Zobrazíte je zvolením možnosti \'Zobrazit skryté složky\' v nastavení. Pokračovat?</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string> <string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string> <string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Zobrazit skryté média</string> <string name="show_hidden_media">Zobrazit skryté média</string>
<string name="autoplay_videos">Automaticky přehrávat videa</string> <string name="autoplay_videos">Automaticky přehrávat videa</string>
<string name="toggle_filename">Přepnout viditelnost názvů souborů</string> <string name="toggle_filename">Přepnout viditelnost názvů souborů</string>
<string name="show_media">Zobrazit média</string>
<string name="images">Jen obrázky</string>
<string name="videos">Jen videa</string>
<string name="gifs">GIFs only</string>
<string name="images_videos_gifs">Images, videos, GIFs</string>
<string name="images_and_videos">Obrázky i videa</string>
<string name="loop_videos">Přehrávat videa ve smyčce</string> <string name="loop_videos">Přehrávat videa ve smyčce</string>
<string name="animate_gifs">Animovat náhledy souborů GIF</string> <string name="animate_gifs">Animovat náhledy souborů GIF</string>
<string name="max_brightness">Nastavit jas obrazovky na max při zobrazení médií</string> <string name="max_brightness">Nastavit jas obrazovky na max při zobrazení médií</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string> <string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -19,19 +19,28 @@
<string name="no_camera_app_found">Keine Kamera-App gefunden</string> <string name="no_camera_app_found">Keine Kamera-App gefunden</string>
<string name="increase_column_count">Kacheln verkleinern</string> <string name="increase_column_count">Kacheln verkleinern</string>
<string name="reduce_column_count">Kacheln vergrößern</string> <string name="reduce_column_count">Kacheln vergrößern</string>
<string name="change_cover_image">Cover-Bild ändern</string> <string name="change_cover_image">Coverbild ändern</string>
<string name="select_photo">Auswählen</string> <string name="select_photo">Auswählen</string>
<string name="use_default">Standard</string> <string name="use_default">Standard</string>
<string name="set_as">Festlegen als</string> <string name="set_as">Festlegen als</string>
<string name="volume">Lautstärke</string> <string name="volume">Lautstärke</string>
<string name="brightness">Helligkeit</string> <string name="brightness">Helligkeit</string>
<string name="do_not_ask_again">Nicht erneut fragen (in dieser Session)</string>
<!-- Filter -->
<string name="filter_media">Filter</string>
<string name="images">Bilder</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">Keine Medien für die ausgewählten Filter gefunden</string>
<string name="change_filters_underlined"><u>Filter ändern</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Diese Funktion versteckt ausgewählte Ordner (auch für andere Apps), indem dort im Dateisystem eine \'.nomedia\'-Datei abgelegt wird. Dadurch werden auch deren Unterordner versteckt. Solche Ordner werden nur gezeigt, wenn die Einstellung \'Versteckte Ordner zeigen\' aktiv ist (auch andere Apps bieten üblicherweise eine solche Option). Fortfahren?</string> <string name="hide_folder_description">Diese Funktion versteckt die ausgewählten Ordner (auch für andere Apps), indem dort im Dateisystem eine \'.nomedia\'-Datei abgelegt wird. Dadurch werden auch deren Unterordner versteckt. Solche Ordner werden nur gezeigt, wenn die Einstellung \'Versteckte Ordner zeigen\' aktiv ist (auch andere Apps bieten üblicherweise eine solche Option). Fortfahren?</string>
<string name="exclude">Ordner ausblenden</string> <string name="exclude">Ordner ausblenden</string>
<string name="excluded_folders">Ausgeblendete Ordner</string> <string name="excluded_folders">Ausgeblendete Ordner</string>
<string name="manage_excluded_folders">Ausgeblendete Ordner verwalten</string> <string name="manage_excluded_folders">Ausgeblendete Ordner verwalten</string>
<string name="exclude_folder_description">Diese Funktion blendet ausgewählte Ordner und deren Unterordner aus (nur in dieser App). Ausgeblendete Ordner können in den Einstellungen verwaltet werden.</string> <string name="exclude_folder_description">Diese Funktion blendet die ausgewählten Ordner und deren Unterordner aus (nur in dieser App). Ausgeblendete Ordner können in den Einstellungen verwaltet werden.</string>
<string name="exclude_folder_parent">Möchten Sie stattdessen einen höherliegenden Ordner ausblenden?</string> <string name="exclude_folder_parent">Möchten Sie stattdessen einen höherliegenden Ordner ausblenden?</string>
<string name="excluded_activity_placeholder">\'Ordner ausblenden\' wird ausgewählte Ordner und deren Unterordner nur in dieser App ausblenden. Andere Apps werden solche Ordner weiterhin anzeigen.\\n\\nWenn Sie Ordner auch für andere Apps verstecken wollen, verwenden Sie dafür die Funktion \'Ordner verstecken\'.</string> <string name="excluded_activity_placeholder">\'Ordner ausblenden\' wird ausgewählte Ordner und deren Unterordner nur in dieser App ausblenden. Andere Apps werden solche Ordner weiterhin anzeigen.\\n\\nWenn Sie Ordner auch für andere Apps verstecken wollen, verwenden Sie dafür die Funktion \'Ordner verstecken\'.</string>
<string name="remove_all">Alle entfernen</string> <string name="remove_all">Alle entfernen</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Diashow</string> <string name="slideshow">Diashow</string>
<string name="interval">Intervall (Sekunden):</string> <string name="interval">Intervall (Sekunden):</string>
<string name="include_photos">Bilder/GIFs verwenden</string> <string name="include_photos">Bilder verwenden</string>
<string name="include_videos">Videos verwenden</string> <string name="include_videos">Videos verwenden</string>
<string name="include_gifs">GIFs verwenden</string>
<string name="random_order">Zufällige Reihenfolge</string> <string name="random_order">Zufällige Reihenfolge</string>
<string name="use_fade">Übergänge animieren</string> <string name="use_fade">Übergänge animieren</string>
<string name="move_backwards">Rückwärts abspielen</string> <string name="move_backwards">Rückwärts abspielen</string>
<string name="loop_slideshow">Endlos abspielen</string>
<string name="slideshow_ended">Diashow beendet</string> <string name="slideshow_ended">Diashow beendet</string>
<string name="no_media_for_slideshow">Keine Medien für Diashow gefunden</string> <string name="no_media_for_slideshow">Keine Medien für Diashow gefunden</string>
<!-- View types -->
<string name="change_view_type">Darstellung ändern</string>
<string name="grid">Gitter</string>
<string name="list">Liste</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Versteckte Ordner zeigen</string> <string name="show_hidden_media">Versteckte Ordner zeigen</string>
<string name="autoplay_videos">Videos automatisch abspielen</string> <string name="autoplay_videos">Videos automatisch abspielen</string>
<string name="toggle_filename">Beschriftungen ein/aus</string> <string name="toggle_filename">Beschriftungen ein/aus</string>
<string name="show_media">Medien auswählen</string>
<string name="images">Nur Bilder</string>
<string name="videos">Nur Videos</string>
<string name="gifs">Nur GIFs</string>
<string name="images_videos_gifs">Bilder, Videos und GIFs</string>
<string name="images_and_videos">Bilder und Videos</string>
<string name="loop_videos">Videos in Endlosschleife spielen</string> <string name="loop_videos">Videos in Endlosschleife spielen</string>
<string name="animate_gifs">Kacheln von GIFs animieren</string> <string name="animate_gifs">Kacheln von GIFs animieren</string>
<string name="max_brightness">Helligkeit beim Betrachten maximieren</string> <string name="max_brightness">Helligkeit beim Betrachten maximieren</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Schwarzer Hintergrund im Vollbild</string> <string name="dark_background_at_fullscreen">Schwarzer Hintergrund im Vollbild</string>
<string name="scroll_thumbnails_horizontally">Kacheln horizontal scrollen</string> <string name="scroll_thumbnails_horizontally">Kacheln horizontal scrollen</string>
<string name="hide_system_ui_at_fullscreen">Systemleisten ausblenden im Vollbild</string> <string name="hide_system_ui_at_fullscreen">Systemleisten ausblenden im Vollbild</string>
<string name="delete_empty_folders">Nach Löschen leere Ordner löschen</string>
<string name="allow_video_gestures">Gesten für Videolautstärke/Helligkeit</string>
<string name="replace_share_with_rotate">Teilen/Drehen im Vollbild-Menü vertauschen</string> <string name="replace_share_with_rotate">Teilen/Drehen im Vollbild-Menü vertauschen</string>
<string name="show_extended_details">Eigenschaften anzeigen im Vollbild</string>
<string name="manage_extended_details">Eigenschaften auswählen</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -25,6 +25,15 @@
<string name="set_as">Establecer como</string> <string name="set_as">Establecer como</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brightness</string> <string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Esta función oculta la carpeta agregando un archivo \'.nomedia\' en ella, y ocultará también las subcarpetas. Puede mostrarlas cambiando la opción \'Mostrar carpetas ocultas\' en los Ajustes. ¿Continuar?</string> <string name="hide_folder_description">Esta función oculta la carpeta agregando un archivo \'.nomedia\' en ella, y ocultará también las subcarpetas. Puede mostrarlas cambiando la opción \'Mostrar carpetas ocultas\' en los Ajustes. ¿Continuar?</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string> <string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string> <string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Mostrar carpetas ocultas</string> <string name="show_hidden_media">Mostrar carpetas ocultas</string>
<string name="autoplay_videos">Reproducir vídeos automáticamente</string> <string name="autoplay_videos">Reproducir vídeos automáticamente</string>
<string name="toggle_filename">Cambiar la visibilidad del nombre de archivo</string> <string name="toggle_filename">Cambiar la visibilidad del nombre de archivo</string>
<string name="show_media">Mostrar multimedia</string>
<string name="images">Solo imágenes</string>
<string name="videos">Solo vídeos</string>
<string name="gifs">solo GIFs</string>
<string name="images_videos_gifs">Imágenes, vídeos, GIFs</string>
<string name="images_and_videos">Imágenes y vídeos</string>
<string name="loop_videos">Reproducción continua de vídeos</string> <string name="loop_videos">Reproducción continua de vídeos</string>
<string name="animate_gifs">Animar las miniaturas de GIFs</string> <string name="animate_gifs">Animar las miniaturas de GIFs</string>
<string name="max_brightness">Brillo máximo cuando se muestra multimedia</string> <string name="max_brightness">Brillo máximo cuando se muestra multimedia</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Utilizar siempre fondo oscuro en pantalla completa</string> <string name="dark_background_at_fullscreen">Utilizar siempre fondo oscuro en pantalla completa</string>
<string name="scroll_thumbnails_horizontally">Desplazar miniaturas horizontalmente</string> <string name="scroll_thumbnails_horizontally">Desplazar miniaturas horizontalmente</string>
<string name="hide_system_ui_at_fullscreen">Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa</string> <string name="hide_system_ui_at_fullscreen">Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Reemplazar Compartir con Girar en el menú de pantalla completa</string> <string name="replace_share_with_rotate">Reemplazar Compartir con Girar en el menú de pantalla completa</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Simple Gallery</string>
<string name="app_launcher_name">Galleria</string>
<string name="edit">Muokkaa</string>
<string name="open_camera">Avaa kamera</string>
<string name="open_with">Avaa</string>
<string name="no_app_found">Sovelluksia ei löydetty</string>
<string name="hidden">(piilotettu)</string>
<string name="pin_folder">Kiinnitä kansio</string>
<string name="unpin_folder">Poista kiinnitys</string>
<string name="show_all">Näytä kaikkien kansioiden sisältö</string>
<string name="all_folders">Kaikki kansiot</string>
<string name="folder_view">Vaihda kansionäkymään</string>
<string name="other_folder">Muu kansio</string>
<string name="show_on_map">Näytä kartalla</string>
<string name="unknown_location">Tuntematon sijainti</string>
<string name="no_map_application">Karttasovellusta ei löytynyt</string>
<string name="no_camera_app_found">Kamerasovellusta ei löytynyt</string>
<string name="increase_column_count">Increase column count</string>
<string name="reduce_column_count">Reduce column count</string>
<string name="change_cover_image">Vaihda kansikuva</string>
<string name="select_photo">Valitse kuva</string>
<string name="use_default">Käytä oletuksia</string>
<string name="set_as">Aseta</string>
<string name="volume">Äänenvoimakkuus</string>
<string name="brightness">Kirkkaus</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Suodata media</string>
<string name="images">Kuvat</string>
<string name="videos">Videot</string>
<string name="gifs">GIFit</string>
<string name="no_media_with_filters">Mediaa ei löytynyt valituilla suotimilla.</string>
<string name="change_filters_underlined"><u>Muuta suotimia</u></string>
<!-- Hide / Exclude -->
<string name="hide_folder_description">Tämä piilottaa kansion ja alikansiot lisäämällä \'.nomedia\' tiedoston kansioon. Näet ne valitsemalla \'Näytä piilotetut kansiot\' asetuksissa. Continue?</string>
<string name="exclude">Poissulje</string>
<string name="excluded_folders">Poissuljetut kansiot</string>
<string name="manage_excluded_folders">Hallitse poissuljettuja kansioita</string>
<string name="exclude_folder_description">Tämä poissulkee valitun ja alikansiot vain Simple Gallerysta. Voit hallinnoida poissuljettuja kansioita asetuksista.</string>
<string name="exclude_folder_parent">Poissulje yläkansio tämän sijaan?</string>
<string name="excluded_activity_placeholder">Kansion poissulkeminen piilottaa kansion alikansioineen vain Simple Galleryssa, ne jäävät näkyviin muihin sovelluksiin.\n\nJos haluat piilottaa kansion myös muissa sovelluksissa, käytä piilota-funktiota.</string>
<string name="remove_all">Poista kaikki</string>
<string name="remove_all_description">Poista kaikki kansiot poissuljettujen listasta? Tämä ei poista kansioita.</string>
<!-- Include folders -->
<string name="include_folders">Sisällytä kansiot</string>
<string name="manage_included_folders">Hallitse sisällettyjä kansioita</string>
<string name="add_folder">Lisää kansio</string>
<string name="included_activity_placeholder">Jos sinulla on kansioita, jotka sisältää mediaa, mutta sovellus ei tunnistanut, voit lisätä ne manuaalisesti tähän.\n\Lisääminen ei poissulje muita kansioita.</string>
<!-- Resizing -->
<string name="resize">Rajaa</string>
<string name="resize_and_save">Rajaa valinta ja tallenna</string>
<string name="width">Leveys</string>
<string name="height">Korkeus</string>
<string name="keep_aspect_ratio">Säilytä kuvasuhde</string>
<string name="invalid_values">Aseta oikea resoluutio.</string>
<!-- Editor -->
<string name="editor">Editori</string>
<string name="save">Tallenna</string>
<string name="rotate">Käännä</string>
<string name="path">Polku</string>
<string name="invalid_image_path">Kuvan polkua ei ole</string>
<string name="image_editing_failed">Kuvan muokkaus epäonnistui</string>
<string name="edit_image_with">Muokkaa kuvaa:</string>
<string name="no_editor_found">Kuvamuokkainta ei löytynyt</string>
<string name="unknown_file_location">Tuntematon tiedostosijainti</string>
<string name="error_saving_file">Lähdetiedoston ylikirjoitus epäonnistui</string>
<string name="rotate_left">Käännä vasemmalle</string>
<string name="rotate_right">Käännä oikealle</string>
<string name="rotate_one_eighty">Käännä 180º</string>
<string name="flip">Pyöräytä</string>
<string name="flip_horizontally">Pyöräytä vaakasuoraan</string>
<string name="flip_vertically">Pyöräytä pystysuoraan</string>
<string name="edit_with">Muokkaa sovelluksella</string>
<!-- Set wallpaper -->
<string name="simple_wallpaper">Simple Wallpaper</string>
<string name="set_as_wallpaper">Aseta taustakuvaksi</string>
<string name="set_as_wallpaper_failed">Taustakuvan asetus epäonnistui</string>
<string name="set_as_wallpaper_with">Aseta taustakuvaksi sovelluksella:</string>
<string name="no_capable_app_found">Toimivaa sovellusta ei löydetty</string>
<string name="setting_wallpaper">Asetetaan taustakuvaa&#8230;</string>
<string name="wallpaper_set_successfully">Taustakuva asetettu onnistuneesti</string>
<string name="portrait_aspect_ratio">Kuvasuhde pystyssä</string>
<string name="landscape_aspect_ratio">Kuvasuhde vaakatasossa</string>
<!-- Slideshow -->
<string name="slideshow">Diaesitys</string>
<string name="interval">Aikaväli (sekunteja):</string>
<string name="include_photos">Sisällytä Kuvat</string>
<string name="include_videos">Sisällytä Videot</string>
<string name="include_gifs">Sisällytä GIFit</string>
<string name="random_order">Satunnainen järjestys</string>
<string name="use_fade">Käytä häivitys-animaatiota</string>
<string name="move_backwards">Liiku takaisinpäin</string>
<string name="loop_slideshow">Jatkuva diaesitys</string>
<string name="slideshow_ended">Diaesitys päättyi</string>
<string name="no_media_for_slideshow">Mediaa diaesitykseen ei löytynyt</string>
<!-- View types -->
<string name="change_view_type">Vaihda näkymää</string>
<string name="grid">Ruudukko</string>
<string name="list">Lista</string>
<!-- Settings -->
<string name="show_hidden_media">Näytä piilotettu media</string>
<string name="autoplay_videos">Toista videot automaattisesti</string>
<string name="toggle_filename">Tiedostonimien näkyvyys</string>
<string name="loop_videos">Jatkuvat videot</string>
<string name="animate_gifs">Animoi GIFit pienoiskuvissa</string>
<string name="max_brightness">Täysi kirkkaus mediaa katsoessa</string>
<string name="crop_thumbnails">Leikkaa pienoiskuvat neliöiksi</string>
<string name="screen_rotation_by">Käännä koko ruudun mediaa</string>
<string name="screen_rotation_system_setting">Järjestelmän asetukset</string>
<string name="screen_rotation_device_rotation">Laitteen kierto</string>
<string name="screen_rotation_aspect_ratio">Kuvasuhde</string>
<string name="dark_background_at_fullscreen">Tumma tausta koko ruudun medioissa</string>
<string name="scroll_thumbnails_horizontally">Vieritä pienoiskuvia vaakasuorassa</string>
<string name="hide_system_ui_at_fullscreen">Piilota järjestelmän UI automaattisesti koko näytön mediassa</string>
<string name="delete_empty_folders">Poista tyhjät kansiot kansion tyhjennyksen jälkeen</string>
<string name="allow_video_gestures">Salli videon äänenvoimakkuuden ja kirkkauden säätö pystysuorilla eleillä</string>
<string name="replace_share_with_rotate">Korvaa jakaminen kääntämisellä koko näytön tilassa</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->
<string name="app_short_description">Galleria kuvien ja videoiden katsomiseen ilman mainoksia.</string>
<string name="app_long_description">
Yksinkertainen työkalu kuvien ja videoiden katsomiseen. Kohteita voidaan lajitella päivän, koon, nimen mukaan, nousevassa ja laskevassa järjestyksessä. Kuvia voidaan zoomata. Mediatiedostot näkyvät useissa sarakkeissa joiden määrää muutetaan nipistys-eleellä. Tiedostoja voidaan uudelleennimetä, jakaa, poistaa, kopioida. Kuvia voi rajata, pyörittää tai asettaa taustakuvaksi suoraan sovelluksesta.
Galleriaa tarjotaan myös kolmansille osapuolille kuvien / videoiden tarkasteluun, liitteiden lisäämiseksi sähköpostiin yms. Täydellinen jokapäiväiseen käyttöön.
Ei sisällä mainoksia tai turhia käyttöoikeuksia. Täysin avointa lähdekoodia, tarjoaa muokattavat värit.
Tämä sovellus on vain yksi osa suurempaa kokoelmaa. Löydät loput osoitteesta http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View file

@ -7,7 +7,7 @@
<string name="open_with">Ouvrir avec</string> <string name="open_with">Ouvrir avec</string>
<string name="no_app_found">Aucune application valide trouvée</string> <string name="no_app_found">Aucune application valide trouvée</string>
<string name="hidden">(caché)</string> <string name="hidden">(caché)</string>
<string name="pin_folder">Épingler les dossiers</string> <string name="pin_folder">Épingler le dossier</string>
<string name="unpin_folder">Désépingler le dossier</string> <string name="unpin_folder">Désépingler le dossier</string>
<string name="show_all">Afficher le contenu de tous les dossiers</string> <string name="show_all">Afficher le contenu de tous les dossiers</string>
<string name="all_folders">Tous les dossiers</string> <string name="all_folders">Tous les dossiers</string>
@ -15,16 +15,25 @@
<string name="other_folder">Autre dossier</string> <string name="other_folder">Autre dossier</string>
<string name="show_on_map">Afficher sur la carte</string> <string name="show_on_map">Afficher sur la carte</string>
<string name="unknown_location">Position inconnue</string> <string name="unknown_location">Position inconnue</string>
<string name="no_map_application">Aucune application de cartes n\'a été trouvée</string> <string name="no_map_application">Aucune application de carte n\'a été trouvée</string>
<string name="no_camera_app_found">Aucune application d\\appareil photo n\'a été trouvée</string> <string name="no_camera_app_found">Aucune application d\'appareil photo n\'a été trouvée</string>
<string name="increase_column_count">Augmenter le nombre de colonnes</string> <string name="increase_column_count">Augmenter le nombre de colonnes</string>
<string name="reduce_column_count">Réduire le nombre de colonnes</string> <string name="reduce_column_count">Réduire le nombre de colonnes</string>
<string name="change_cover_image">Change cover image</string> <string name="change_cover_image">Changer l\'image de couverture</string>
<string name="select_photo">Sélectionner une photo</string> <string name="select_photo">Sélectionner une photo</string>
<string name="use_default">Use default</string> <string name="use_default">Utiliser par défaut</string>
<string name="set_as">Set as</string> <string name="set_as">Définir comme</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Luminosité</string> <string name="brightness">Luminosité</string>
<string name="do_not_ask_again">Ne pas redemander pour cette session</string>
<!-- Filter -->
<string name="filter_media">Filtrer les médias</string>
<string name="images">Images</string>
<string name="videos">Vidéos</string>
<string name="gifs">GIF</string>
<string name="no_media_with_filters">Aucun fichier média trouvé avec les filtres sélectionnés.</string>
<string name="change_filters_underlined"><u>Changer les filtres</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">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 ?</string> <string name="hide_folder_description">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 ?</string>
@ -41,7 +50,7 @@
<string name="include_folders">Dossiers inclus</string> <string name="include_folders">Dossiers inclus</string>
<string name="manage_included_folders">Gérer les dossiers inclus</string> <string name="manage_included_folders">Gérer les dossiers inclus</string>
<string name="add_folder">Ajouter un dossier</string> <string name="add_folder">Ajouter un dossier</string>
<string name="included_activity_placeholder">Si vous avez des dossiers contenant du media et qui ne sont pas reconnus par l\'application alors, vous pouvez les ajouter manuellement ici.</string> <string name="included_activity_placeholder">Si vous avez des dossiers contenant des médias et qui ne sont pas reconnus par l\'application alors, vous pouvez les ajouter manuellement ici.</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Redimensionner</string> <string name="resize">Redimensionner</string>
@ -49,7 +58,7 @@
<string name="width">Largeur</string> <string name="width">Largeur</string>
<string name="height">Hauteur</string> <string name="height">Hauteur</string>
<string name="keep_aspect_ratio">Garder le ratio</string> <string name="keep_aspect_ratio">Garder le ratio</string>
<string name="invalid_values">Veuillez entrez une résolution valide</string> <string name="invalid_values">Veuillez entrer une résolution valide</string>
<!-- Editor --> <!-- Editor -->
<string name="editor">Éditeur</string> <string name="editor">Éditeur</string>
@ -78,47 +87,60 @@
<string name="no_capable_app_found">Aucune application trouvée pour continuer cette action</string> <string name="no_capable_app_found">Aucune application trouvée pour continuer cette action</string>
<string name="setting_wallpaper">Paramètres de fond d\'écran…</string> <string name="setting_wallpaper">Paramètres de fond d\'écran…</string>
<string name="wallpaper_set_successfully">Fond d\'écran défini avec succès</string> <string name="wallpaper_set_successfully">Fond d\'écran défini avec succès</string>
<string name="portrait_aspect_ratio">Ratio aspect Portrait</string> <string name="portrait_aspect_ratio">Ratio d\'aspect portrait</string>
<string name="landscape_aspect_ratio">Ratio aspect Paysage</string> <string name="landscape_aspect_ratio">Ratio d\'aspect paysage</string>
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Diaporama</string> <string name="slideshow">Diaporama</string>
<string name="interval">Intervalle (secondes):</string> <string name="interval">Intervalle (secondes) :</string>
<string name="include_photos">Inclure photos et GIFs</string> <string name="include_photos">Inclure photos</string>
<string name="include_videos">Inclure vidéos</string> <string name="include_videos">Inclure vidéos</string>
<string name="include_gifs">Inclure GIF</string>
<string name="random_order">Ordre aléatoire</string> <string name="random_order">Ordre aléatoire</string>
<string name="use_fade">Utiliser un fondu</string> <string name="use_fade">Utiliser un fondu</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Revenir en arrière</string>
<string name="loop_slideshow">Diaporama en boucle</string>
<string name="slideshow_ended">Diaporama terminé</string> <string name="slideshow_ended">Diaporama terminé</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">Aucun média trouvé pour le diaporama</string>
<!-- View types -->
<string name="change_view_type">Changer le type de vue</string>
<string name="grid">Grille</string>
<string name="list">Liste</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Afficher les dossiers cachés</string> <string name="show_hidden_media">Afficher les dossiers cachés</string>
<string name="autoplay_videos">Lecture automatique des vidéos</string> <string name="autoplay_videos">Lecture automatique des vidéos</string>
<string name="toggle_filename">Permuter la visibilité des noms de fichier</string> <string name="toggle_filename">Permuter la visibilité des noms de fichier</string>
<string name="show_media">Afficher les médias</string> <string name="loop_videos">Lire en boucle les vidéos</string>
<string name="images">Seulement les images</string> <string name="animate_gifs">GIF animés sur les miniatures</string>
<string name="videos">Vidéos uniquement</string>
<string name="gifs">GIFs seulement</string>
<string name="images_videos_gifs">Images, vidéos, GIFs</string>
<string name="images_and_videos">Images et vidéos</string>
<string name="loop_videos">Tourner en boucle les vidéos</string>
<string name="animate_gifs">GIFs animés sur les miniatures</string>
<string name="max_brightness">Luminosité maximale lors de l\'affichage de media</string> <string name="max_brightness">Luminosité maximale lors de l\'affichage de media</string>
<string name="crop_thumbnails">Rogner les miniatures en carrés</string> <string name="crop_thumbnails">Rogner les miniatures en carrés</string>
<string name="screen_rotation_by">Pivoter les medias plein écran selon</string> <string name="screen_rotation_by">Pivoter les medias plein écran selon</string>
<string name="screen_rotation_system_setting">Paramètres système</string> <string name="screen_rotation_system_setting">Paramètres système</string>
<string name="screen_rotation_device_rotation">Rotation de l\'appareil</string> <string name="screen_rotation_device_rotation">Rotation de l\'appareil</string>
<string name="screen_rotation_aspect_ratio">Ratio d\'aspect</string> <string name="screen_rotation_aspect_ratio">Ratio d\'aspect</string>
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="dark_background_at_fullscreen">Arrière-plan sombre pour média plein écran</string>
<string name="scroll_thumbnails_horizontally">Défilement des mignatures horizontalement</string> <string name="scroll_thumbnails_horizontally">Défilement des miniatures horizontalement</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Masquer automatiquement l\'interface utilisateur si média plein écran</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="delete_empty_folders">Supprimer les dossiers vides après avoir supprimé leur contenu</string>
<string name="allow_video_gestures">Permettre le contrôle du volume vidéo et de la luminosité avec des gestes verticaux</string>
<string name="replace_share_with_rotate">Remplacer Partager par Pivoter si menu en plein écran</string>
<string name="show_extended_details">Afficher les détails supplémentaires par dessus le média en plein écran</string>
<string name="manage_extended_details">Gérer les détails supplémentaires</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->
<string name="app_short_description">Un album pour visionner photos et vidéos sans publicité.</string> <string name="app_short_description">Un album pour visionner photos et vidéos sans publicité.</string>
<string name="app_long_description">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 multiple 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. La galerie est aussi offerte pour l\'utiliser comme une tierce partie pour de la prévisualisation des images/vidéos, joindre aux clients mail etc. C\'est parfait pour un usage au quotidien. L\'application ne contient ni de publicité ni d\'autorisation inutile. Elle est totalement OpenSource et est aussi fournie avec un thème sombre. Cette application est juste l\'une des applications d\'une plus grande suite. Vous pouvez trouver les autres sur http://www.simplemobiletools.com</string> <string name="app_long_description">
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 multiple 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.
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.
L\'application ne contient ni publicité ni autorisation inutile. Elle est totalement opensource et est aussi fournie avec des couleurs personnalisables.
Cette application est juste l\'une des applications d\'une plus grande suite. Vous pouvez trouver les autres sur http://www.simplemobiletools.com
</string>
<!-- <!--
Haven't found some strings? There's more at Haven't found some strings? There's more at

View file

@ -25,6 +25,15 @@
<string name="set_as">Set as</string> <string name="set_as">Set as</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brightness</string> <string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue?</string>
@ -41,7 +50,7 @@
<string name="include_folders">Included folders</string> <string name="include_folders">Included folders</string>
<string name="manage_included_folders">Manage included folders</string> <string name="manage_included_folders">Manage included folders</string>
<string name="add_folder">Add folder</string> <string name="add_folder">Add folder</string>
<string name="included_activity_placeholder">If you have some folders which contain media, but were not recognized by the app, you can add them manually here.</string> <string name="included_activity_placeholder">If you have some folders which contain media, but were not recognized by the app, you can add them manually here.\n\nAdding some items here will not exclude any other folder.</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string> <string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string> <string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Show hidden media</string> <string name="show_hidden_media">Show hidden media</string>
<string name="autoplay_videos">Play videos automatically</string> <string name="autoplay_videos">Play videos automatically</string>
<string name="toggle_filename">Toggle filename visibility</string> <string name="toggle_filename">Toggle filename visibility</string>
<string name="show_media">Show media</string>
<string name="images">Images only</string>
<string name="videos">Videos only</string>
<string name="gifs">GIFs only</string>
<string name="images_videos_gifs">Images, videos, GIFs</string>
<string name="images_and_videos">Images and videos</string>
<string name="loop_videos">Loop videos</string> <string name="loop_videos">Loop videos</string>
<string name="animate_gifs">Animate GIFs at thumbnails</string> <string name="animate_gifs">Animate GIFs at thumbnails</string>
<string name="max_brightness">Max brightness when viewing media</string> <string name="max_brightness">Max brightness when viewing media</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string> <string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -25,6 +25,15 @@
<string name="set_as">Imposta come</string> <string name="set_as">Imposta come</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Luminosità</string> <string name="brightness">Luminosità</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filtra i media</string>
<string name="images">Immagini</string>
<string name="videos">Video</string>
<string name="gifs">GIF</string>
<string name="no_media_with_filters">Nessun file trovato per il filtro selezionato.</string>
<string name="change_filters_underlined"><u>Cambia filtro</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Questa funzione nasconde la cartella aggiungendo un file \'.nomedia\' all\'interno, nasconderà anche tutte le sottocartelle. Puoi vederle attivando l\'opzione \'Mostra cartelle nascoste\' nelle impostazioni. Continuare?</string> <string name="hide_folder_description">Questa funzione nasconde la cartella aggiungendo un file \'.nomedia\' all\'interno, nasconderà anche tutte le sottocartelle. Puoi vederle attivando l\'opzione \'Mostra cartelle nascoste\' nelle impostazioni. Continuare?</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Presentazione</string> <string name="slideshow">Presentazione</string>
<string name="interval">Intervallo (secondi):</string> <string name="interval">Intervallo (secondi):</string>
<string name="include_photos">Includi foto e GIF</string> <string name="include_photos">Includi foto</string>
<string name="include_videos">Includi video</string> <string name="include_videos">Includi video</string>
<string name="include_gifs">Includi GIF</string>
<string name="random_order">Ordine sparso</string> <string name="random_order">Ordine sparso</string>
<string name="use_fade">Usa animazioni a dissolvenza</string> <string name="use_fade">Usa animazioni a dissolvenza</string>
<string name="move_backwards">Scorri al contrario</string> <string name="move_backwards">Scorri al contrario</string>
<string name="loop_slideshow">Ripeti presentazione</string>
<string name="slideshow_ended">La presentazione è terminata</string> <string name="slideshow_ended">La presentazione è terminata</string>
<string name="no_media_for_slideshow">Nessun media trovato per la presentazione</string> <string name="no_media_for_slideshow">Nessun media trovato per la presentazione</string>
<!-- View types -->
<string name="change_view_type">Cambia modalità visualizzazione</string>
<string name="grid">Griglia</string>
<string name="list">Elenco</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Mostra cartelle nascoste</string> <string name="show_hidden_media">Mostra cartelle nascoste</string>
<string name="autoplay_videos">Riproduci video automaticamente</string> <string name="autoplay_videos">Riproduci video automaticamente</string>
<string name="toggle_filename">Visibilità nome del file</string> <string name="toggle_filename">Visibilità nome del file</string>
<string name="show_media">Mostra tipo di media</string>
<string name="images">Solo immagini</string>
<string name="videos">Solo video</string>
<string name="gifs">Solo GIF</string>
<string name="images_videos_gifs">Immagini, video, GIF</string>
<string name="images_and_videos">Immagini e video</string>
<string name="loop_videos">Ripeti i video</string> <string name="loop_videos">Ripeti i video</string>
<string name="animate_gifs">Anima le GIF in miniatura</string> <string name="animate_gifs">Anima le GIF in miniatura</string>
<string name="max_brightness">Luminosità max durante visualizzazione</string> <string name="max_brightness">Luminosità max durante visualizzazione</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Sfondo scuro a schermo intero</string> <string name="dark_background_at_fullscreen">Sfondo scuro a schermo intero</string>
<string name="scroll_thumbnails_horizontally">Scorri miniature orizzontalmente</string> <string name="scroll_thumbnails_horizontally">Scorri miniature orizzontalmente</string>
<string name="hide_system_ui_at_fullscreen">Nascondi UI di sistema con media a schermo intero</string> <string name="hide_system_ui_at_fullscreen">Nascondi UI di sistema con media a schermo intero</string>
<string name="delete_empty_folders">Elimina cartelle vuote dopo averne eliminato il contenuto</string>
<string name="allow_video_gestures">Gestisci il volume e la luminosità dei video con gesti verticali</string>
<string name="replace_share_with_rotate">Sostituisci Condividi con Ruota a schermo intero</string> <string name="replace_share_with_rotate">Sostituisci Condividi con Ruota a schermo intero</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -4,116 +4,130 @@
<string name="app_launcher_name">ギャラリー</string> <string name="app_launcher_name">ギャラリー</string>
<string name="edit">編集</string> <string name="edit">編集</string>
<string name="open_camera">カメラを開く</string> <string name="open_camera">カメラを開く</string>
<string name="open_with">&#8230;で開く</string> <string name="open_with">別のアプリで開く</string>
<string name="no_app_found">有効なアプリが見つかりません</string> <string name="no_app_found">有効なアプリが見つかりません</string>
<string name="hidden">(非表示)</string> <string name="hidden">(非表示)</string>
<string name="pin_folder">Pin folder</string> <string name="pin_folder">フォルダーをピン留めする</string>
<string name="unpin_folder">Unpin folder</string> <string name="unpin_folder">フォルダーのピン留めを外す</string>
<string name="show_all">Show all folders content</string> <string name="show_all">全てを表示</string>
<string name="all_folders">All media</string> <string name="all_folders">すべてのフォルダー</string>
<string name="folder_view">Switch to folder view</string> <string name="folder_view">フォルダーを選択する</string>
<string name="other_folder">Other folder</string> <string name="other_folder">その他のフォルダー</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">地図で表示</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">位置情報がありません</string>
<string name="no_map_application">No application with maps has been found</string> <string name="no_map_application">地図アプリが見つかりません</string>
<string name="no_camera_app_found">No Camera app has been found</string> <string name="no_camera_app_found">カメラアプリが見つかりません</string>
<string name="increase_column_count">Increase column count</string> <string name="increase_column_count">列数を増やす</string>
<string name="reduce_column_count">Reduce column count</string> <string name="reduce_column_count">列数を減らす</string>
<string name="change_cover_image">Change cover image</string> <string name="change_cover_image">カバー画像を変更</string>
<string name="select_photo">Select photo</string> <string name="select_photo">写真を選択</string>
<string name="use_default">Use default</string> <string name="use_default">デフォルトに戻す</string>
<string name="set_as">Set as</string> <string name="set_as">他で使う</string>
<string name="volume">Volume</string> <string name="volume">音量</string>
<string name="brightness">Brightness</string> <string name="brightness">明るさ</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">表示メディア種</string>
<string name="images">画像</string>
<string name="videos">ビデオ</string>
<string name="gifs">GIF</string>
<string name="no_media_with_filters">絞り込み条件に該当するメディアがありません。</string>
<string name="change_filters_underlined"><u>絞り込み条件を変更</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">対象のフォルダーに「.nomedia」というファイルを作成し、フォルダーを非表示にします。そのフォルダー以下のすべてのサブフォルダーも、同様に非表示となります。非表示となったフォルダーを見るには、「設定」の中にある「非表示のフォルダーを表示」オプションを切り替えてください。このフォルダーを非表示にしますか</string>
<string name="exclude">Exclude</string> <string name="exclude">除外する</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">除外フォルダー</string>
<string name="manage_excluded_folders">Manage excluded folders</string> <string name="manage_excluded_folders">除外フォルダーを管理</string>
<string name="exclude_folder_description">This will exclude the selection together with its subfolders from Simple Gallery only. You can manage excluded folders in Settings.</string> <string name="exclude_folder_description">選択したフォルダーとそのサブフォルダーを、Simple Galleyの一覧から除外します。除外したフォルダーは「設定」で管理できます。</string>
<string name="exclude_folder_parent">Exclude a parent instead?</string> <string name="exclude_folder_parent">親フォルダーを選択して除外することもできます。</string>
<string name="excluded_activity_placeholder">Excluding folders will make them together with their subfolders hidden just in Simple Gallery, they will still be visible in other applications.\\n\\nIf you want to hide them from other apps too, use the Hide function.</string> <string name="excluded_activity_placeholder">フォルダーを除外すると、サブフォルダーも含めSimple Galleyの一覧から除外します。他のアプリでは引き続き表示されます。\\n\\n他のアプリでも非表示にしたい場合は、「非表示」機能を使用してください。</string>
<string name="remove_all">Remove all</string> <string name="remove_all">すべて解除</string>
<string name="remove_all_description">Remove all folders from the list of excluded? This will not delete the folders.</string> <string name="remove_all_description">除外するフォルダーの登録をすべて解除しますか? フォルダー自体は削除されません。</string>
<!-- Include folders --> <!-- Include folders -->
<string name="include_folders">Included folders</string> <string name="include_folders">追加フォルダー</string>
<string name="manage_included_folders">Manage included folders</string> <string name="manage_included_folders">追加フォルダーを管理</string>
<string name="add_folder">Add folder</string> <string name="add_folder">フォルダーを追加</string>
<string name="included_activity_placeholder">If you have some folders which contain media, but were not recognized by the app, you can add them manually here.</string> <string name="included_activity_placeholder">メディアを含んでいるフォルダーがアプリから認識されていない場合は、手動で追加できます。</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">リサイズ</string>
<string name="resize_and_save">Resize selection and save</string> <string name="resize_and_save">選択領域をリサイズして保存</string>
<string name="width">Width</string> <string name="width"></string>
<string name="height">Height</string> <string name="height">高さ</string>
<string name="keep_aspect_ratio">Keep aspect ratio</string> <string name="keep_aspect_ratio">縦横比を固定</string>
<string name="invalid_values">Please enter a valid resolution</string> <string name="invalid_values">解像度を正しく入力してください</string>
<!-- Editor --> <!-- Editor -->
<string name="editor">エディター</string> <string name="editor">エディター</string>
<string name="save">保存</string> <string name="save">保存</string>
<string name="rotate">回転</string> <string name="rotate">回転</string>
<string name="path">Path</string> <string name="path">パス</string>
<string name="invalid_image_path">無効な画像パス</string> <string name="invalid_image_path">無効な画像パス</string>
<string name="image_editing_failed">画像の編集に失敗しました</string> <string name="image_editing_failed">画像の編集に失敗しました</string>
<string name="edit_image_with">画像を編集:</string> <string name="edit_image_with">画像を編集:</string>
<string name="no_editor_found">画像エディターが見つかりません</string> <string name="no_editor_found">画像エディターが見つかりません</string>
<string name="unknown_file_location">ファイルの場所が不明です</string> <string name="unknown_file_location">ファイルの場所が不明です</string>
<string name="error_saving_file">元のファイルを上書きできません</string> <string name="error_saving_file">元のファイルを上書きできません</string>
<string name="rotate_left">Rotate left</string> <string name="rotate_left">左に回転</string>
<string name="rotate_right">Rotate right</string> <string name="rotate_right">右に回転</string>
<string name="rotate_one_eighty">Rotate by 180º</string> <string name="rotate_one_eighty">180º回転</string>
<string name="flip">Flip</string> <string name="flip">反転</string>
<string name="flip_horizontally">Flip horizontally</string> <string name="flip_horizontally">水平方向に反転</string>
<string name="flip_vertically">Flip vertically</string> <string name="flip_vertically">垂直方向に反転</string>
<string name="edit_with">Edit with</string> <string name="edit_with">他のアプリで編集</string>
<!-- Set wallpaper --> <!-- Set wallpaper -->
<string name="simple_wallpaper">シンプル壁紙</string> <string name="simple_wallpaper">シンプル壁紙</string>
<string name="set_as_wallpaper">壁紙として設定</string> <string name="set_as_wallpaper">壁紙設定</string>
<string name="set_as_wallpaper_failed">壁紙としての設定に失敗しました</string> <string name="set_as_wallpaper_failed">壁紙の設定に失敗しました</string>
<string name="set_as_wallpaper_with">壁紙として設定:</string> <string name="set_as_wallpaper_with">壁紙設定:</string>
<string name="no_capable_app_found">対応できるアプリが見つかりません</string> <string name="no_capable_app_found">対応できるアプリが見つかりません</string>
<string name="setting_wallpaper">壁紙の設定&#8230;</string> <string name="setting_wallpaper">壁紙に設定中&#8230;</string>
<string name="wallpaper_set_successfully">壁紙を正常に設定しました</string> <string name="wallpaper_set_successfully">壁紙を正常に設定しました</string>
<string name="portrait_aspect_ratio">Portrait aspect ratio</string> <string name="portrait_aspect_ratio">縦向きの縦横比</string>
<string name="landscape_aspect_ratio">Landscape aspect ratio</string> <string name="landscape_aspect_ratio">横向きの縦横比</string>
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">スライドショー</string>
<string name="interval">Interval (seconds):</string> <string name="interval">間隔 (秒):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">写真を含める</string>
<string name="include_videos">Include videos</string> <string name="include_videos">ビデオを含める</string>
<string name="random_order">Random order</string> <string name="include_gifs">GIFを含める</string>
<string name="use_fade">Use fade animations</string> <string name="random_order">ランダムな順序</string>
<string name="move_backwards">Move backwards</string> <string name="use_fade">フェードアニメーションを使用する</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="move_backwards">逆方向に進む</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="loop_slideshow">スライドショーをリピート再生する</string>
<string name="slideshow_ended">スライドショーが終了しました</string>
<string name="no_media_for_slideshow">スライドショーに表示するメディアがありません</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">非表示フォルダーを表示</string> <string name="show_hidden_media">非表示フォルダーを表示</string>
<string name="autoplay_videos">自動的にビデオを再生</string> <string name="autoplay_videos">ビデオを自動再生する</string>
<string name="toggle_filename">ファイル名の表示を切り替え</string> <string name="toggle_filename">ファイル名の表示を切り替え</string>
<string name="show_media">Show media</string> <string name="loop_videos">ビデオをリピート再生する</string>
<string name="images">Images only</string> <string name="animate_gifs">GIF画像のサムネイルをアニメーション表示する</string>
<string name="videos">Videos only</string> <string name="max_brightness">メディア再生時に明るさを最大にする</string>
<string name="gifs">GIFs only</string> <string name="crop_thumbnails">サムネイルを正方形に切り取る</string>
<string name="images_videos_gifs">Images, videos, GIFs</string> <string name="screen_rotation_by">メディア再生時のフルスクリーン表示切り替え</string>
<string name="images_and_videos">Images and videos</string> <string name="screen_rotation_system_setting">システム設定に従う</string>
<string name="loop_videos">Loop videos</string> <string name="screen_rotation_device_rotation">端末の向きに従う</string>
<string name="animate_gifs">Animate GIFs at thumbnails</string> <string name="screen_rotation_aspect_ratio">メディアの縦横比に従う</string>
<string name="max_brightness">Max brightness when viewing media</string> <string name="dark_background_at_fullscreen">黒背景でフルスクリーン表示</string>
<string name="crop_thumbnails">Crop thumbnails into squares</string> <string name="scroll_thumbnails_horizontally">サムネイル画面を横方向にスクロール</string>
<string name="screen_rotation_by">Rotate fullscreen media by</string> <string name="hide_system_ui_at_fullscreen">フルスクリーン時にシステムUIを非表示にする</string>
<string name="screen_rotation_system_setting">System setting</string> <string name="delete_empty_folders">メディアの削除後にフォルダーが空になった場合、そのフォルダーを削除する</string>
<string name="screen_rotation_device_rotation">Device rotation</string> <string name="allow_video_gestures">ビデオ再生中に、音量と明るさを縦方向のジェスチャーで変更する</string>
<string name="screen_rotation_aspect_ratio">Aspect ratio</string> <string name="replace_share_with_rotate">フルスクリーンメニューの「共有」を「回転」に置き換える</string>
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string> <string name="manage_extended_details">Manage extended details</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -25,6 +25,15 @@
<string name="set_as">Ustaw jako</string> <string name="set_as">Ustaw jako</string>
<string name="volume">Głośność</string> <string name="volume">Głośność</string>
<string name="brightness">Jasność</string> <string name="brightness">Jasność</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filtruj multimedia</string>
<string name="images">Obrazy</string>
<string name="videos">Filmy</string>
<string name="gifs">GIFy</string>
<string name="no_media_with_filters">Nie znalazłem multimediów z wybranymi filtrami.</string>
<string name="change_filters_underlined"><u>Zmień filtry</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Ta funkcja ukrywa foldery dodając do nich pusty plik .nomedia. Aby móc je zobaczyć, należy włączyć opcję \'Pokazuj ukryte foldery\' w ustawieniach. Kontyntynuować?</string> <string name="hide_folder_description">Ta funkcja ukrywa foldery dodając do nich pusty plik .nomedia. Aby móc je zobaczyć, należy włączyć opcję \'Pokazuj ukryte foldery\' w ustawieniach. Kontyntynuować?</string>
@ -49,7 +58,7 @@
<string name="width">Szerokość</string> <string name="width">Szerokość</string>
<string name="height">Wysokość</string> <string name="height">Wysokość</string>
<string name="keep_aspect_ratio">Zachowaj proporcje</string> <string name="keep_aspect_ratio">Zachowaj proporcje</string>
<string name="invalid_values">Wpisz poprawną rozdzielczość</string>    <string name="invalid_values">Podaj poprawną rozdzielczość</string>
<!-- Editor --> <!-- Editor -->
<string name="editor">Edycja</string> <string name="editor">Edycja</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Pokaz slajdów</string> <string name="slideshow">Pokaz slajdów</string>
<string name="interval">Przedział (sekundy):</string> <string name="interval">Przedział (sekundy):</string>
<string name="include_photos">Dołączaj zdjęcia i GIFy</string> <string name="include_photos">Dołączaj zdjęcia</string>
<string name="include_videos">Dołączaj filmy</string> <string name="include_videos">Dołączaj filmy</string>
<string name="include_gifs">Dołączaj GIFy</string>
<string name="random_order">Losowa kolejność</string> <string name="random_order">Losowa kolejność</string>
<string name="use_fade">Używaj płynnych przejść</string> <string name="use_fade">Używaj płynnych przejść</string>
   <string name="move_backwards">Odwrotna kolejność</string>    <string name="move_backwards">Odwrotna kolejność</string>
   <string name="loop_slideshow">Zapętlaj</string>
<string name="slideshow_ended">Pokaz slajdów zakończony</string> <string name="slideshow_ended">Pokaz slajdów zakończony</string>
<string name="no_media_for_slideshow">Nie znalazłem multimediów do pokazu slajdów</string> <string name="no_media_for_slideshow">Nie znalazłem multimediów do pokazu slajdów</string>
<!-- View types -->
   <string name="change_view_type">Zmień typ widoku</string>
   <string name="grid">Siatka</string>
   <string name="list">Lista</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Pokazuj ukryte foldery</string> <string name="show_hidden_media">Pokazuj ukryte foldery</string>
<string name="autoplay_videos">Odtwarzaj filmy automatycznie</string> <string name="autoplay_videos">Odtwarzaj filmy automatycznie</string>
<string name="toggle_filename">Pokazuj / ukrywaj nazwy plików</string> <string name="toggle_filename">Pokazuj / ukrywaj nazwy plików</string>
<string name="show_media">Pokazywane typy multimediów</string>
<string name="images">Tylko obrazy</string>
<string name="videos">Tylko filmy</string>
<string name="gifs">Tylko GIFy</string>
<string name="images_videos_gifs">Obrazy, filmy i GIFy</string>
<string name="images_and_videos">Obrazy i filmy</string>
<string name="loop_videos">Zapętlaj odtwarzanie filmów</string> <string name="loop_videos">Zapętlaj odtwarzanie filmów</string>
<string name="animate_gifs">Animowane miniatury GIFów</string> <string name="animate_gifs">Animowane miniatury GIFów</string>
<string name="max_brightness">Maksymalna jasność podczas wyświetlania multimediów</string> <string name="max_brightness">Maksymalna jasność podczas wyświetlania multimediów</string>
@ -113,13 +123,17 @@
<string name="dark_background_at_fullscreen">Czarne tło przy podglądzie pełnoekranowym</string> <string name="dark_background_at_fullscreen">Czarne tło przy podglądzie pełnoekranowym</string>
<string name="scroll_thumbnails_horizontally">Przewijaj miniatury poziomo</string> <string name="scroll_thumbnails_horizontally">Przewijaj miniatury poziomo</string>
<string name="hide_system_ui_at_fullscreen">Ukrywaj interfejs przy pełnoekranowym podglądzie</string> <string name="hide_system_ui_at_fullscreen">Ukrywaj interfejs przy pełnoekranowym podglądzie</string>
<string name="delete_empty_folders">Usuwaj puste foldery po usunięciu ich zawartości</string>
<string name="allow_video_gestures">Zezwalaj na kontrolę jasności i głośności filmów pionowymi gestami</string>
<string name="replace_share_with_rotate">Zamień funkcję udostępniania na obracanie w menu pełnoekranowym</string> <string name="replace_share_with_rotate">Zamień funkcję udostępniania na obracanie w menu pełnoekranowym</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->
<string name="app_short_description">Darmowa galeria bez reklam do przeglądania obrazów i filmów.</string> <string name="app_short_description">Darmowa galeria bez reklam do przeglądania obrazów i filmów.</string>
<string name="app_long_description"> <string name="app_long_description">
Prosta aplikacja galerii do oglądania obrazów i filmów. Pliki mogą być sortowane według daty, rozmiaru i nazwy, zarówno w porządku rosnącym jak i malejącym. W zależności od wielkości ekranu wyświetlane mogą być w wielu kolumnach. Liczbę kolumn można zmieniać za pomocą gestów. Zdjęcia mogą być powiększane, przycinane, obracane lub ustawiane jako tapeta bezpośrednio z poziomu aplikacji. Kolory aplikacji można dowolnie ustawiać. Prosta aplikacja galerii do oglądania obrazów i filmów. Pliki mogą być sortowane według daty, rozmiaru i nazwy, zarówno w porządku rosnącym, jak i malejącym. W zależności od wielkości ekranu wyświetlane mogą być w wielu kolumnach. Liczbę kolumn można zmieniać za pomocą gestów. Zdjęcia mogą być powiększane, przycinane, obracane lub ustawiane jako tapeta bezpośrednio z poziomu aplikacji. Kolory aplikacji można dowolnie ustawiać.
Aplikacja nie zawiera żadnych reklam ani niepotrzebnych uprawnień. Jest też w pełni otawrtoźrodłowa. Aplikacja nie zawiera żadnych reklam ani niepotrzebnych uprawnień. Jest też w pełni otawrtoźrodłowa.

View file

@ -5,8 +5,7 @@
<string name="edit">Editar</string> <string name="edit">Editar</string>
<string name="open_camera">Abrir câmera</string> <string name="open_camera">Abrir câmera</string>
<string name="open_with">Abrir com</string> <string name="open_with">Abrir com</string>
<string name="no_app_found">Nenhum aplicativo encontrado</string> <string name="no_app_found">Nenhum aplicativo encontrado</string>    
   
<string name="hidden">(oculto)</string> <string name="hidden">(oculto)</string>
<string name="pin_folder">Fixar pasta</string> <string name="pin_folder">Fixar pasta</string>
<string name="unpin_folder">Desfixar pasta</string> <string name="unpin_folder">Desfixar pasta</string>
@ -26,6 +25,15 @@
<string name="set_as">Set as</string> <string name="set_as">Set as</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brightness</string> <string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Esta opção oculta uma pasta com a adição de um arquivo \'.nomedia\' dentro dela, e irá ocultar todas as subpastas que estejam dentro da mesma. Você poderá rever essas pastas com a opção \'Mostrar pastas ocultas\'. Continuar?</string> <string name="hide_folder_description">Esta opção oculta uma pasta com a adição de um arquivo \'.nomedia\' dentro dela, e irá ocultar todas as subpastas que estejam dentro da mesma. Você poderá rever essas pastas com a opção \'Mostrar pastas ocultas\'. Continuar?</string>
@ -85,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string> <string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string> <string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Mostrar pastas ocultas</string> <string name="show_hidden_media">Mostrar pastas ocultas</string>
<string name="autoplay_videos">Reproduzir vídeos automaticamente</string> <string name="autoplay_videos">Reproduzir vídeos automaticamente</string>
<string name="toggle_filename">Mostrar/ocultar nome do arquivo</string> <string name="toggle_filename">Mostrar/ocultar nome do arquivo</string>
<string name="show_media">Mostrar mídia</string>
<string name="images">Apenas imagens</string>
<string name="videos">Apenas vídeos</string>
<string name="gifs">Apenas GIFS</string>
<string name="images_videos_gifs">Imagens, vídeos, GIFs</string>
<string name="images_and_videos">Imagens e vídeos</string>
<string name="loop_videos">Reproduzir vídeos em ciclo</string> <string name="loop_videos">Reproduzir vídeos em ciclo</string>
<string name="animate_gifs">Animação de GIFs nas miniaturas</string> <string name="animate_gifs">Animação de GIFs nas miniaturas</string>
<string name="max_brightness">Brilho máximo ao visualizar mídia</string> <string name="max_brightness">Brilho máximo ao visualizar mídia</string>
@ -114,7 +123,11 @@
<string name="dark_background_at_fullscreen">Fundo de tela escuro em mídia tela cheia</string> <string name="dark_background_at_fullscreen">Fundo de tela escuro em mídia tela cheia</string>
<string name="scroll_thumbnails_horizontally">Rolar miniaturas horizontalmente</string> <string name="scroll_thumbnails_horizontally">Rolar miniaturas horizontalmente</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -19,21 +19,30 @@
<string name="no_camera_app_found">Não existe uma aplicação adequeada</string> <string name="no_camera_app_found">Não existe uma aplicação adequeada</string>
<string name="increase_column_count">Aumentar número de colunas</string> <string name="increase_column_count">Aumentar número de colunas</string>
<string name="reduce_column_count">Diminuir número de colunas</string> <string name="reduce_column_count">Diminuir número de colunas</string>
<string name="change_cover_image">Alterar imagem da capa</string> <string name="change_cover_image">Alterar imagem de capa</string>
<string name="select_photo">Selecionar foto</string> <string name="select_photo">Selecionar foto</string>
<string name="use_default">Predefinição</string> <string name="use_default">Predefinição</string>
<string name="set_as">Definir como</string> <string name="set_as">Definir como</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brilho</string> <string name="brightness">Brilho</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filtrar multimédia</string>
<string name="images">Imagens</string>
<string name="videos">Vídeos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">Não foram encontrados ficheiros que cumpram os requisitos.</string>
<string name="change_filters_underlined"><u>Alterar filtros</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Esta opção oculta uma pasta com a adição de um ficheiro \'.nomedia\' na pasta, e irá ocultar todas as subpastas existentes. Pode ver as pastas com a opção \'Mostrar pastas ocultas\'. Continuar?</string> <string name="hide_folder_description">Esta opção oculta uma pasta com a adição de um ficheiro \'.nomedia\' na pasta, e irá ocultar todas as subpastas existentes. Pode ver as pastas com a opção \'Mostrar pastas ocultas\'. Continuar?</string>
<string name="exclude">Exclusão</string> <string name="exclude">Exclusão</string>
<string name="excluded_folders">Pastas excluídas</string> <string name="excluded_folders">Pastas excluídas</string>
<string name="manage_excluded_folders">Gerir pastas excluídas</string> <string name="manage_excluded_folders">Gerir pastas excluídas</string>
<string name="exclude_folder_description">Esta ação apenas exclui as pastas selecionadas da lista de pastas desta aplicação. Pode gerir as pastas excuídas nas Definições.</string> <string name="exclude_folder_description">Esta ação apenas exclui as pastas selecionadas da lista de pastas desta aplicação. Pode gerir as pastas excluídas nas Definições.</string>
<string name="exclude_folder_parent">Excluir antes a pasta superior?</string> <string name="exclude_folder_parent">Excluir antes a pasta superior?</string>
<string name="excluded_activity_placeholder">A exlusão de uma pasta apenas oculta o seu conteúdo do Simple Gallery uma vez que as outras aplicações continuarão a poder aceder-lhes.\\n\\nSe quiser ocultar também das outras aplicações, utilize a função Ocultar.</string> <string name="excluded_activity_placeholder">A exclusão de uma pasta apenas oculta o seu conteúdo do Simple Gallery porque as outras aplicações continuarão a poder aceder-lhes.\\n\\nSe quiser ocultar também das outras aplicações, utilize a função Ocultar.</string>
<string name="remove_all">Remover todas</string> <string name="remove_all">Remover todas</string>
<string name="remove_all_description">Remover todas as pastas de lista de exclusões? Esta ação não apaga as pastas.</string> <string name="remove_all_description">Remover todas as pastas de lista de exclusões? Esta ação não apaga as pastas.</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Apresentação</string> <string name="slideshow">Apresentação</string>
<string name="interval">Intervalo (segundos):</string> <string name="interval">Intervalo (segundos):</string>
<string name="include_photos">Incluir fotos e GIFs</string> <string name="include_photos">Incluir fotos</string>
<string name="include_videos">Incluir vídeos</string> <string name="include_videos">Incluir vídeos</string>
<string name="include_gifs">Incluir GIFs</string>
<string name="random_order">Ordem aleatória</string> <string name="random_order">Ordem aleatória</string>
<string name="use_fade">Usar animações</string> <string name="use_fade">Usar animações</string>
<string name="move_backwards">Mover para trás</string> <string name="move_backwards">Mover para trás</string>
<string name="loop_slideshow">Apresentação em ciclo</string>
<string name="slideshow_ended">Apresentação terminada</string> <string name="slideshow_ended">Apresentação terminada</string>
<string name="no_media_for_slideshow">Não foram encontrados ficheiros para a apresentação</string> <string name="no_media_for_slideshow">Não foram encontrados ficheiros para a apresentação</string>
<!-- View types -->
<string name="change_view_type">Tipo de exibição</string>
<string name="grid">Grelha</string>
<string name="list">Lista</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Mostrar pastas ocultas</string> <string name="show_hidden_media">Mostrar pastas ocultas</string>
<string name="autoplay_videos">Reproduzir vídeos automaticamente</string> <string name="autoplay_videos">Reproduzir vídeos automaticamente</string>
<string name="toggle_filename">Mostrar/ocultar nome do ficheiro</string> <string name="toggle_filename">Mostrar/ocultar nome do ficheiro</string>
<string name="show_media">Mostrar multimédia</string>
<string name="images">Apenas imagens</string>
<string name="videos">Apenas vídeos</string>
<string name="gifs">Apenas GIFs</string>
<string name="images_videos_gifs">Imagens, vídeos e GIFs</string>
<string name="images_and_videos">Imagens e vídeos</string>
<string name="loop_videos">Vídeos em ciclo</string> <string name="loop_videos">Vídeos em ciclo</string>
<string name="animate_gifs">Animação de GIFs nas miniaturas</string> <string name="animate_gifs">Animação de GIFs nas miniaturas</string>
<string name="max_brightness">Brilho máximo permitido</string> <string name="max_brightness">Brilho máximo permitido</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Usar sempre um fundo escuro se em ecrã completo</string> <string name="dark_background_at_fullscreen">Usar sempre um fundo escuro se em ecrã completo</string>
<string name="scroll_thumbnails_horizontally">Deslocação horizontal de miniaturas</string> <string name="scroll_thumbnails_horizontally">Deslocação horizontal de miniaturas</string>
<string name="hide_system_ui_at_fullscreen">Ocultar interface do sistema se em ecrã completo</string> <string name="hide_system_ui_at_fullscreen">Ocultar interface do sistema se em ecrã completo</string>
<string name="delete_empty_folders">Apagar as pastas vazias depois de remover o seu conteúdo</string>
<string name="allow_video_gestures">Permitir controlo do volume e brilho dos vídeos através de gestos verticais</string>
<string name="replace_share_with_rotate">Substituir a opção Partilhar pela opção Rodar se em ecrã completo</string> <string name="replace_share_with_rotate">Substituir a opção Partilhar pela opção Rodar se em ecrã completo</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -19,29 +19,38 @@
<string name="no_camera_app_found">Не найдено приложения камеры</string> <string name="no_camera_app_found">Не найдено приложения камеры</string>
<string name="increase_column_count">Добавить 1 столбец</string> <string name="increase_column_count">Добавить 1 столбец</string>
<string name="reduce_column_count">Убрать 1 столбец</string> <string name="reduce_column_count">Убрать 1 столбец</string>
<string name="change_cover_image">Change cover image</string> <string name="change_cover_image">Изменить обложку</string>
<string name="select_photo">Select photo</string> <string name="select_photo">Выбрать изображение</string>
<string name="use_default">Use default</string> <string name="use_default">Использовать по умолчанию</string>
<string name="set_as">Set as</string> <string name="set_as">Установить как…</string>
<string name="volume">Volume</string> <string name="volume">Громкость</string>
<string name="brightness">Brightness</string> <string name="brightness">Яркость</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Фильтр медиа</string>
<string name="images">Изображения</string>
<string name="videos">Видео</string>
<string name="gifs">GIF</string>
<string name="no_media_with_filters">При заданных фильтрах медиафайлы не найдены.</string>
<string name="change_filters_underlined"><u>Изменить фильтры</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Эта опция скрывает папку, добавляя в неё файл \'.nomedia\'; будут скрыты все подпапки. Можно показывать их, переключая \'Показать скрытые папки\' в настройках. Продолжить?</string> <string name="hide_folder_description">Эта функция скрывает папку, добавляя в неё файл \'.nomedia\'; будут скрыты все подпапки. Можно показывать их, переключая \'Показывать скрытые папки\' в настройках. Продолжить?</string>
<string name="exclude">Исключить</string> <string name="exclude">Исключить</string>
<string name="excluded_folders">Исключённые папки</string> <string name="excluded_folders">Исключённые папки</string>
<string name="manage_excluded_folders">Управление исключёнными папками</string> <string name="manage_excluded_folders">Управление исключёнными папками</string>
<string name="exclude_folder_description">Эта опция исключит выбранные папки вместе с подпапками только для Simple Gallery. Можно управлять исключёнными папками из настроек.</string> <string name="exclude_folder_description">Эта функция исключит выбранные папки вместе с подпапками только для Simple Gallery. Можно управлять исключёнными папками из настроек.</string>
<string name="exclude_folder_parent">Исключить только родительский каталог?</string> <string name="exclude_folder_parent">Исключить только родительский каталог?</string>
<string name="excluded_activity_placeholder">Исключая папки, вы сделаете их скрытыми вместе с подпапками в Simple Gallery, но они будут видны в других приложениях. Если вы хотите скрыть их в других приложениях, используйте функцию Скрыть. </string> <string name="excluded_activity_placeholder">Исключая папки, вы сделаете их скрытыми вместе с подпапками в Simple Gallery, но они будут видны в других приложениях. Если вы хотите скрыть их в других приложениях, используйте функцию Скрыть. </string>
<string name="remove_all">Удалить всё</string> <string name="remove_all">Удалить всё</string>
<string name="remove_all_description">Очистить список исключённых? Сами папки не будут удалены.</string> <string name="remove_all_description">Очистить список исключённых? Сами папки не будут удалены.</string>
<!-- Include folders --> <!-- Include folders -->
<string name="include_folders">Включенные папки</string> <string name="include_folders">Включённые папки</string>
<string name="manage_included_folders">Управление включенными папками</string> <string name="manage_included_folders">Управление включёнными папками</string>
<string name="add_folder">Добавление папки</string> <string name="add_folder">Добавление папки</string>
<string name="included_activity_placeholder">Если у вас есть папки содержащие медиа, но не распознанные Simple Gallery. Вы можете добавить их вручную.</string> <string name="included_activity_placeholder">Если у вас есть папки, содержащие медиафайлы, но не распознанные Simple Gallery. Вы можете добавить их вручную.</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Изменить размер</string> <string name="resize">Изменить размер</string>
@ -64,11 +73,11 @@
<string name="error_saving_file">Не удалось перезаписать исходный файл</string> <string name="error_saving_file">Не удалось перезаписать исходный файл</string>
<string name="rotate_left">Повернуть влево</string> <string name="rotate_left">Повернуть влево</string>
<string name="rotate_right">Повернуть вправо</string> <string name="rotate_right">Повернуть вправо</string>
<string name="rotate_one_eighty">Перевернуть на 180º</string> <string name="rotate_one_eighty">Перевернуть на 180°</string>
<string name="flip">Отразить</string> <string name="flip">Отразить</string>
<string name="flip_horizontally">По горизонтали</string> <string name="flip_horizontally">По горизонтали</string>
<string name="flip_vertically">По вертикали</string> <string name="flip_vertically">По вертикали</string>
<string name="edit_with">Edit with</string> <string name="edit_with">Редактировать в</string>
<!-- Set wallpaper --> <!-- Set wallpaper -->
<string name="simple_wallpaper">Простые обои</string> <string name="simple_wallpaper">Простые обои</string>
@ -76,44 +85,49 @@
<string name="set_as_wallpaper_failed">Установить не удалось</string> <string name="set_as_wallpaper_failed">Установить не удалось</string>
<string name="set_as_wallpaper_with">Установить в качестве обоев в:</string> <string name="set_as_wallpaper_with">Установить в качестве обоев в:</string>
<string name="no_capable_app_found">Приложение не найдено</string> <string name="no_capable_app_found">Приложение не найдено</string>
<string name="setting_wallpaper">Установка обоев&#8230;</string> <string name="setting_wallpaper">Установка обоев</string>
<string name="wallpaper_set_successfully">Обои успешно установлены</string> <string name="wallpaper_set_successfully">Обои успешно установлены</string>
<string name="portrait_aspect_ratio">Формат изображения</string> <string name="portrait_aspect_ratio">Формат изображения</string>
<string name="landscape_aspect_ratio">Пейзажное соотношение сторон</string> <string name="landscape_aspect_ratio">Пейзажное соотношение сторон</string>
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Слайдшоу</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Интервал (секунды):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Включать изображения</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Включать видео</string>
<string name="random_order">Random order</string> <string name="include_gifs">Включать GIF</string>
<string name="use_fade">Use fade animations</string> <string name="random_order">Случайный порядок</string>
<string name="move_backwards">Move backwards</string> <string name="use_fade">Эффект затухания</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="move_backwards">В обратном направлении</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="loop_slideshow">Закольцевать слайдшоу</string>
<string name="slideshow_ended">Слайдшоу завершилось</string>
<string name="no_media_for_slideshow">Никаких медиафайлов для слайдшоу не было найдено.</string>
<!-- View types -->
<string name="change_view_type">Режим отображения</string>
<string name="grid">Сетка</string>
<string name="list">Список</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Показать скрытые папки</string> <string name="show_hidden_media">Показывать скрытые папки</string>
<string name="autoplay_videos">Воспроизводить видео автоматически</string> <string name="autoplay_videos">Воспроизводить видео автоматически</string>
<string name="toggle_filename">Переключить отображение имени файла</string> <string name="toggle_filename">Переключить отображение имени файла</string>
<string name="show_media">Отображать</string>
<string name="images">Только изображения</string>
<string name="videos">Только видео</string>
<string name="gifs">GIFs only</string>
<string name="images_videos_gifs">Images, videos, GIFs</string>
<string name="images_and_videos">Изображения и видео</string>
<string name="loop_videos">Повторять видео</string> <string name="loop_videos">Повторять видео</string>
<string name="animate_gifs">Анимировать эскизы GIF-файлов</string> <string name="animate_gifs">Анимировать эскизы GIF</string>
<string name="max_brightness">Максимальная яркость при просмотре файлов</string> <string name="max_brightness">Максимальная яркость при просмотре файлов</string>
<string name="crop_thumbnails">Нарезать миниатюры в квадраты</string> <string name="crop_thumbnails">Нарезать миниатюры в квадраты</string>
<string name="screen_rotation_by">Полноэкранный поворот</string> <string name="screen_rotation_by">Полноэкранный поворот</string>
<string name="screen_rotation_system_setting">Системные настройки</string> <string name="screen_rotation_system_setting">Системные настройки</string>
<string name="screen_rotation_device_rotation">Поворот устройства</string> <string name="screen_rotation_device_rotation">Поворот устройства</string>
<string name="screen_rotation_aspect_ratio">Соотношение сторон</string> <string name="screen_rotation_aspect_ratio">Соотношение сторон</string>
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="dark_background_at_fullscreen">Тёмный фон в полноэкранном режиме</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string> <string name="scroll_thumbnails_horizontally">Прокрутка эскизов по горизонтали</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Автоматически скрывать системный интерфейс в полноэкранном режиме</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="delete_empty_folders">Удалять пустые папки после удаления их содержимого</string>
<string name="allow_video_gestures">Управлять громкостью и яркостью видео с помощью вертикальных жестов</string>
<string name="replace_share_with_rotate">Заменить \'Поделиться\' на \'Повернуть\' в меню полноэкранного режима</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -25,6 +25,15 @@
<string name="set_as">Nastaviť ako</string> <string name="set_as">Nastaviť ako</string>
<string name="volume">Hlasitosť</string> <string name="volume">Hlasitosť</string>
<string name="brightness">Jas</string> <string name="brightness">Jas</string>
<string name="do_not_ask_again">Nepýtať sa už v tomto spustení</string>
<!-- Filter -->
<string name="filter_media">Filter médií</string>
<string name="images">Obrázky</string>
<string name="videos">Videá</string>
<string name="gifs">GIFká</string>
<string name="no_media_with_filters">So zvolenými filtrami sa nenašli žiadne média súbory.</string>
<string name="change_filters_underlined"><u>Zmeniť filtre</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Táto funkcia skryje priečinok pridaním súboru \'.nomedia\', skryté budú aj podpriečinky. Môžete ich vidieť zvolením možnosti \'Zobraziť skryté priečinky\' v nastaveniach. Pokračovať?</string> <string name="hide_folder_description">Táto funkcia skryje priečinok pridaním súboru \'.nomedia\', skryté budú aj podpriečinky. Môžete ich vidieť zvolením možnosti \'Zobraziť skryté priečinky\' v nastaveniach. Pokračovať?</string>
@ -41,7 +50,7 @@
<string name="include_folders">Pridané priečinky</string> <string name="include_folders">Pridané priečinky</string>
<string name="manage_included_folders">Spravovať pridané priečinky</string> <string name="manage_included_folders">Spravovať pridané priečinky</string>
<string name="add_folder">Pridať priečinok</string> <string name="add_folder">Pridať priečinok</string>
<string name="included_activity_placeholder">Ak máte nejaké priečinky obsahujúce médiá, ale neboli rozpoznané aplikáciou, môžete ich tu manuálne pridať.</string> <string name="included_activity_placeholder">Ak máte nejaké priečinky obsahujúce médiá, ale neboli rozpoznané aplikáciou, môžete ich tu manuálne pridať.\n\nPridanie nových položiek sem nevylúči žiadny iný priečinok.</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Zmeniť veľkosť</string> <string name="resize">Zmeniť veľkosť</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Prezentácia</string> <string name="slideshow">Prezentácia</string>
<string name="interval">Interval (sekundy):</string> <string name="interval">Interval (sekundy):</string>
<string name="include_photos">Zahrnúť fotky a GIF súbory</string> <string name="include_photos">Zahrnúť fotky</string>
<string name="include_videos">Zahrnúť videá</string> <string name="include_videos">Zahrnúť videá</string>
<string name="include_gifs">Zahrnúť GIFy</string>
<string name="random_order">Náhodné poradie</string> <string name="random_order">Náhodné poradie</string>
<string name="use_fade">Používať miznúce animácie</string> <string name="use_fade">Používať miznúce animácie</string>
<string name="move_backwards">Ísť opačným smerom</string> <string name="move_backwards">Ísť opačným smerom</string>
<string name="loop_slideshow">Automaticky reštartovať prezentáciu</string>
<string name="slideshow_ended">Prezentácia skončila</string> <string name="slideshow_ended">Prezentácia skončila</string>
<string name="no_media_for_slideshow">Pre prezentáciu sa nenašli žiadne vhodné súbory</string> <string name="no_media_for_slideshow">Pre prezentáciu sa nenašli žiadne vhodné súbory</string>
<!-- View types -->
<string name="change_view_type">Zmeniť typ zobrazenia</string>
<string name="grid">Mriežka</string>
<string name="list">Zoznam</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Zobraziť skryté médiá</string> <string name="show_hidden_media">Zobraziť skryté médiá</string>
<string name="autoplay_videos">Spúšťať videá automaticky</string> <string name="autoplay_videos">Spúšťať videá automaticky</string>
<string name="toggle_filename">Prepnúť viditeľnosť názvov súborov</string> <string name="toggle_filename">Prepnúť viditeľnosť názvov súborov</string>
<string name="show_media">Zobraziť médiá</string>
<string name="images">Iba obrázky</string>
<string name="videos">Iba videá</string>
<string name="gifs">Iba GIFká</string>
<string name="images_videos_gifs">Obrázky, videá, GIFká</string>
<string name="images_and_videos">Obrázky aj videá</string>
<string name="loop_videos">Automaticky reštartovať videá</string> <string name="loop_videos">Automaticky reštartovať videá</string>
<string name="animate_gifs">Animovať GIF súbory pri náhľade</string> <string name="animate_gifs">Animovať GIF súbory pri náhľade</string>
<string name="max_brightness">Maximálny jas pri prezeraní médií</string> <string name="max_brightness">Maximálny jas pri prezeraní médií</string>
@ -113,13 +123,17 @@
<string name="dark_background_at_fullscreen">Tmavé pozadie pri médiách na celú obrazovku</string> <string name="dark_background_at_fullscreen">Tmavé pozadie pri médiách na celú obrazovku</string>
<string name="scroll_thumbnails_horizontally">Prehliadať miniatúry vodorovne</string> <string name="scroll_thumbnails_horizontally">Prehliadať miniatúry vodorovne</string>
<string name="hide_system_ui_at_fullscreen">Automaticky skrývať systémové lišty pri celoobrazovkových médiách</string> <string name="hide_system_ui_at_fullscreen">Automaticky skrývať systémové lišty pri celoobrazovkových médiách</string>
<string name="delete_empty_folders">Odstrániť prázdne priečinky po vymazaní ich obsahu</string>
<string name="allow_video_gestures">Povoliť ovládanie hlasitosti a jasu videí vertikálnymi ťahmi</string>
<string name="replace_share_with_rotate">Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu</string> <string name="replace_share_with_rotate">Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu</string>
<string name="show_extended_details">Zobraziť rozšírené vlastnosti ponad celoobrazovkové médiá</string>
<string name="manage_extended_details">Spravovať rozšírené vlastnosti</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->
<string name="app_short_description">Galéria na prezeranie obrázkov a videí bez reklám.</string> <string name="app_short_description">Galéria na prezeranie obrázkov a videí bez reklám.</string>
<string name="app_long_description"> <string name="app_long_description">
Jednoduchá nástroj použiteľný na prezeranie obrázkov a videí. Položky môžu byť zoradené podľa dátumu, veľkosti, názvu oboma smermi, obrázky je možné aj priblížiť. Položky sú zobrazované vo viacerých stĺpcoch v závislosti od veľkosti displeja, počet stĺpcov je možné meniť pomocou gesta prstami. Súbory môžete premenovať, zdieľať, mazať, kopírovať, premiestňovaŤ. Obrázky môžete orezať, otočiť, alebo nastaviť ako tapeta priamo v aplikácií. Jednoduchá nástroj použiteľný na prezeranie obrázkov a videí. Položky môžu byť zoradené podľa dátumu, veľkosti, názvu oboma smermi, obrázky je možné aj priblížiť. Položky sú zobrazované vo viacerých stĺpcoch v závislosti od veľkosti displeja, počet stĺpcov je možné meniť pomocou gesta prstami. Súbory môžete premenovať, zdieľať, mazať, kopírovať, premiestňovať. Obrázky môžete orezať, otočiť, alebo nastaviť ako tapeta priamo v aplikácií.
Galéria je tiež poskytovaná pre použitie treťou stranou pre prehliadanie fotiek a videí, pridávanie príloh v emailových klientoch. Je perfektná na každodenné použitie. Galéria je tiež poskytovaná pre použitie treťou stranou pre prehliadanie fotiek a videí, pridávanie príloh v emailových klientoch. Je perfektná na každodenné použitie.

View file

@ -23,8 +23,17 @@
<string name="select_photo">Välj foto</string> <string name="select_photo">Välj foto</string>
<string name="use_default">Använd standard</string> <string name="use_default">Använd standard</string>
<string name="set_as">Ange som</string> <string name="set_as">Ange som</string>
<string name="volume">Volume</string> <string name="volume">Volym</string>
<string name="brightness">Brightness</string> <string name="brightness">Ljusstyrka</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filtrera media</string>
<string name="images">Bilder</string>
<string name="videos">Videor</string>
<string name="gifs">GIF-bilder</string>
<string name="no_media_with_filters">Inga mediefiler hittades med valda filter.</string>
<string name="change_filters_underlined"><u>Ändra filter</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Denna funktion döljer mappen och alla dess undermappar genom att lägga till en \'.nomedia\'-fil i den. Du kan se dem genom att växla \'Visa dolda mappar\'-alternativet i Inställningar. Vill du fortsätta?</string> <string name="hide_folder_description">Denna funktion döljer mappen och alla dess undermappar genom att lägga till en \'.nomedia\'-fil i den. Du kan se dem genom att växla \'Visa dolda mappar\'-alternativet i Inställningar. Vill du fortsätta?</string>
@ -41,7 +50,7 @@
<string name="include_folders">Inkluderade mappar</string> <string name="include_folders">Inkluderade mappar</string>
<string name="manage_included_folders">Hantera inkluderade mappar</string> <string name="manage_included_folders">Hantera inkluderade mappar</string>
<string name="add_folder">Lägg till mapp</string> <string name="add_folder">Lägg till mapp</string>
<string name="included_activity_placeholder">Om du har vissa mappar som innehåller media men som inte känns igen av appen kan du lägga till dem manuellt här.</string> <string name="included_activity_placeholder">Om du har vissa mappar som innehåller media men som inte känns igen av appen, kan du lägga till dem manuellt här.</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Ändra storlek</string> <string name="resize">Ändra storlek</string>
@ -82,26 +91,27 @@
<string name="landscape_aspect_ratio">Liggande bildförhållande</string> <string name="landscape_aspect_ratio">Liggande bildförhållande</string>
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Bildspel</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Intervall (sekunder):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Inkludera foton</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Inkludera videor</string>
<string name="random_order">Random order</string> <string name="include_gifs">Inkludera GIF-bilder</string>
<string name="use_fade">Use fade animations</string> <string name="random_order">Spela upp i slumpmässig ordning</string>
<string name="move_backwards">Move backwards</string> <string name="use_fade">Använd toningsanimationer</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="move_backwards">Spela upp i omvänd ordning</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="loop_slideshow">Spela upp i en slinga</string>
<string name="slideshow_ended">Bildspelet har avslutats</string>
<string name="no_media_for_slideshow">Ingen media hittades för bildspelet</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Visa dolda mappar</string> <string name="show_hidden_media">Visa dolda mappar</string>
<string name="autoplay_videos">Spela upp videos automatiskt</string> <string name="autoplay_videos">Spela upp videos automatiskt</string>
<string name="toggle_filename">Visa/dölj filnamnen</string> <string name="toggle_filename">Visa/dölj filnamnen</string>
<string name="show_media">Visa media</string>
<string name="images">Endast bilder</string>
<string name="videos">Endast videos</string>
<string name="gifs">Bara GIF-bilder</string>
<string name="images_videos_gifs">Bilder, videor, GIF-bilder</string>
<string name="images_and_videos">Bilder och videos</string>
<string name="loop_videos">Återspela videos</string> <string name="loop_videos">Återspela videos</string>
<string name="animate_gifs">Animera GIF-bilders miniatyrer</string> <string name="animate_gifs">Animera GIF-bilders miniatyrer</string>
<string name="max_brightness">Maximal ljusstyrka när media visas</string> <string name="max_brightness">Maximal ljusstyrka när media visas</string>
@ -113,15 +123,19 @@
<string name="dark_background_at_fullscreen">Mörk bakgrund när media visas i helskärmsläge</string> <string name="dark_background_at_fullscreen">Mörk bakgrund när media visas i helskärmsläge</string>
<string name="scroll_thumbnails_horizontally">Rulla horisontellt genom miniatyrer</string> <string name="scroll_thumbnails_horizontally">Rulla horisontellt genom miniatyrer</string>
<string name="hide_system_ui_at_fullscreen">Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge</string> <string name="hide_system_ui_at_fullscreen">Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="delete_empty_folders">Ta bort tomma mappar när deras innehåll tas bort</string>
<string name="allow_video_gestures">Tillåt styrning av videovolym och videoljusstyrka med vertikala gester</string>
<string name="replace_share_with_rotate">Ersätt Dela med Rotera i helskärmsmenyn</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->
<string name="app_short_description">Ett Galleri för att visa bilder och videos utan en massa reklam.</string> <string name="app_short_description">Ett Galleri för att visa bilder och videos utan en massa reklam.</string>
<string name="app_long_description"> <string name="app_long_description">
Ett enkelt verktyg för att visa bilder och vdeos. Objekten kan sorteras efter datum, storlek, namn både stigande och fallande, bilder kan zoomas in. Mediafiler visas i flera kolumner beroende av skärmens storlek, du kan ändra antalet kolumner genom en nyp-rörelse. De går att döpa om, dela, ta bort, kopiera, flytta. Bilder kan också beskäras, roteras och anges som bakgrundsbild direkt från appen. Ett enkelt verktyg för att visa bilder och videos. Objekten kan sorteras efter datum, storlek, namn både stigande och fallande, bilder kan zoomas in. Mediafiler visas i flera kolumner beroende av skärmens storlek, du kan ändra antalet kolumner genom en nyp-rörelse. De går att döpa om, dela, ta bort, kopiera, flytta. Bilder kan också beskäras, roteras och anges som bakgrundsbild direkt från appen.
Galleriet kan också användas av tredjeparts för förhandsgranskning av bilder / videos, bifoga bilagor i e-postklienter etc. Den är perfekt för det dagliga användandet. Galleriet kan också användas av tredjepartsappar för förhandsgranskning av bilder / videos, bifoga bilagor i e-postklienter etc. Den är perfekt för det dagliga användandet.
Innehåller ingen reklam eller onödiga behörigheter. Det är helt och hållet opensource, innehåller anpassningsbara färger. Innehåller ingen reklam eller onödiga behörigheter. Det är helt och hållet opensource, innehåller anpassningsbara färger.

View file

@ -25,6 +25,15 @@
<string name="set_as">Set as</string> <string name="set_as">Set as</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brightness</string> <string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">Bu işlev, klasöre\'.medya yok\'dosyası ekleyerek gizler; tüm alt klasörleri de gizler. Bunları Ayarlar\'da\'Gizli klasörleri göster\'seçeneğine basarak görebilirsiniz. Devam et?</string> <string name="hide_folder_description">Bu işlev, klasöre\'.medya yok\'dosyası ekleyerek gizler; tüm alt klasörleri de gizler. Bunları Ayarlar\'da\'Gizli klasörleri göster\'seçeneğine basarak görebilirsiniz. Devam et?</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string> <string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string> <string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Gizli klasörleri göster</string> <string name="show_hidden_media">Gizli klasörleri göster</string>
<string name="autoplay_videos">Videoları otomatik olarak oynat</string> <string name="autoplay_videos">Videoları otomatik olarak oynat</string>
<string name="toggle_filename">Dosya adı görünürlüğünü değiştir</string> <string name="toggle_filename">Dosya adı görünürlüğünü değiştir</string>
<string name="show_media">Medyayı göster</string>
<string name="images">Yalnızca resimler</string>
<string name="videos">Yalnızca videolar</string>
<string name="gifs">GIFs only</string>
<string name="images_videos_gifs">Images, videos, GIFs</string>
<string name="images_and_videos">Resimler ve videolar</string>
<string name="loop_videos">Videolar döngüsü</string> <string name="loop_videos">Videolar döngüsü</string>
<string name="animate_gifs">Küçük resimlerde GIF\'leri canlandırın</string> <string name="animate_gifs">Küçük resimlerde GIF\'leri canlandırın</string>
<string name="max_brightness">Ortam görüntülerken azami parlaklık</string> <string name="max_brightness">Ortam görüntülerken azami parlaklık</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string> <string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -1,135 +1,341 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Simple Gallery</string> <string name="abc_action_bar_home_description">转到主屏幕</string>
<string name="app_launcher_name">简约图库</string> <string name="abc_action_bar_home_description_format">%1$s%2$s</string>
<string name="edit">编辑</string> <string name="abc_action_bar_home_subtitle_description_format">%1$s - %2$s%3$s</string>
<string name="open_camera">打开相机</string> <string name="abc_action_bar_up_description">转到上一层级</string>
<string name="open_with">打开方式</string> <string name="abc_action_menu_overflow_description">更多选项</string>
<string name="no_app_found">未找到可用应用</string> <string name="abc_action_mode_done">完成</string>
<string name="hidden">(隐藏)</string> <string name="abc_activity_chooser_view_see_all">查看全部</string>
<string name="pin_folder">锁定目录</string> <string name="abc_activitychooserview_choose_application">选择应用</string>
<string name="unpin_folder">解除锁定目录</string> <string name="abc_capital_off">关闭</string>
<string name="show_all">文件视图</string> <string name="abc_capital_on">开启</string>
<string name="abc_search_hint">搜索…</string>
<string name="abc_searchview_description_clear">清除查询</string>
<string name="abc_searchview_description_query">搜索查询</string>
<string name="abc_searchview_description_search">搜索</string>
<string name="abc_searchview_description_submit">提交查询</string>
<string name="abc_searchview_description_voice">语音搜索</string>
<string name="abc_shareactionprovider_share_with">分享方式</string>
<string name="abc_shareactionprovider_share_with_application">通过%s分享</string>
<string name="abc_toolbar_collapse_description">收起</string>
<string name="fingerprint_acquired_imager_dirty">指纹传感器有脏污。请擦拭干净,然后重试。</string>
<string name="fingerprint_acquired_insufficient">无法处理指纹,请重试。</string>
<string name="fingerprint_acquired_partial">仅检测到部分指纹,请重试。</string>
<string name="fingerprint_acquired_too_fast">手指移动太快,请重试。</string>
<string name="fingerprint_acquired_too_slow">手指移动太慢,请重试。</string>
<string name="fingerprint_error_canceled">指纹操作已取消。</string>
<string name="fingerprint_error_hw_not_available">指纹硬件无法使用。</string>
<string name="fingerprint_error_lockout">尝试次数过多,请稍后重试。</string>
<string name="fingerprint_error_no_space">无法存储指纹。请移除一个现有的指纹。</string>
<string name="fingerprint_error_timeout">指纹录入操作超时,请重试。</string>
<string name="fingerprint_error_unable_to_process">请重试。</string>
<string name="fingerprint_not_recognized">无法识别</string>
<string name="fingerprints">指纹:</string>
<string name="search_menu_title">搜索</string>
<string name="status_bar_notification_info_overflow">999+</string>
<string name="about">关于</string>
<string name="add_fingerprint">添加指纹</string>
<string name="add_folder">添加目录</string>
<string name="additional_info">额外信息</string>
<string name="album">专辑</string>
<string name="all_folders">所有目录</string> <string name="all_folders">所有目录</string>
<string name="folder_view">目录视图</string> <string name="allow_video_gestures">使用纵向滑动手势控制视频音量和亮度</string>
<string name="other_folder">其他目录</string> <string name="an_error_occurred">啊哦,出错啦: %s</string>
<string name="show_on_map">在地图中显示</string> <string name="animate_gifs">GIF 缩略图</string>
<string name="unknown_location">未知位置</string> <string name="app_launcher_name">简约图库</string>
<string name="no_map_application">未找到地图应用</string> <string name="app_long_description">一个观看照片和视频的简单实用工具。项目可以根据日期、大小、名称来递增或递减排序,照片可以缩放。媒体文件根据屏幕的大小排列在多个方格中,您可以使用缩放手势来调整每一列的方格数量。媒体文件可以被重命名、分享、删除、复制以及移动。照片亦可被剪切、旋转或是直接在应用中设为壁纸。 相册亦提供能让第三方应用预览图片/视频、向电子邮件客户端添加附件等的功能。非常适合日常使用。 应用不包含广告与不必要的权限。它是完全开放源代码的,并内置自定义颜色主题。 这个应用只是一系列应用中的一小部份。您可以在 http://www.simplemobiletools.com 找到其余的应用。</string>
<string name="no_camera_app_found">未找到相机应用</string> <string name="app_name">简约图库</string>
<string name="increase_column_count">增加一栏</string> <string name="app_short_description">一个没有广告,用来观看照片及视频的相册。</string>
<string name="reduce_column_count">减少一栏</string> <string name="app_version">应用版本:%1$s</string>
<string name="change_cover_image">更改封面图片</string> <string name="append">"应用到 '_1'"</string>
<string name="select_photo">选择图片</string> <string name="apply_to_all">应用到全部冲突项</string>
<string name="use_default">使用默认</string> <string name="artist">艺术家</string>
<string name="set_as">设置为</string> <string name="ascending">递增</string>
<string name="volume">音量</string> <string name="authentication_blocked">验证已被阻止,请稍后再试</string>
<string name="authentication_failed">验证失败</string>
<string name="autoplay_videos">自动播放</string>
<string name="background_color">背景色</string>
<string name="brightness">亮度</string> <string name="brightness">亮度</string>
<string name="camera">相机</string>
<string name="cancel">取消</string>
<string name="change_cover_image">更改封面图片</string>
<string name="change_filters_underlined"><u>更改过滤器</u></string>
<string name="change_view_type">更改视图类型</string>
<string name="changing_color_description">更改颜色将切换到自定义主题</string>
<string name="click_select_destination">点击此处以设置目标路径</string>
<string name="confirm_selection">确认选择</string>
<string name="confirm_storage_access_text">请选择 SD 卡根目录并授予写权限</string>
<string name="confirm_storage_access_text_sd">如果您未找到 SD 卡目录,请尝试</string>
<string name="confirm_storage_access_title">确认外部存储器访问权限</string>
<string name="copy">复制</string>
<string name="copy_failed">无法复制文件</string>
<string name="copy_move">复制/移动</string>
<string name="copy_move_failed">操作失败</string>
<string name="copy_to">复制到</string>
<string name="copying">正在复制…</string>
<string name="copying_success">复制成功</string>
<string name="copying_success_partial">无法复制相同文件</string>
<string name="copyright">v %1$s Copyright © Simple Mobile Tools %2$d</string>
<string name="could_not_create_file">创建文件 %s 失败</string>
<string name="could_not_create_folder">创建文件夹 %s 失败</string>
<string name="create_new">新建</string>
<string name="create_new_folder">新建文件夹</string>
<string name="crop_thumbnails">裁剪缩略图</string>
<string name="cropper_title">Android Image Cropper图像裁剪和旋转</string>
<string name="custom">自定义</string>
<string name="customize_colors">自定义颜色</string>
<string name="dark_background_at_fullscreen">全屏时黑色背景</string>
<string name="dark_theme">深色主题</string>
<string name="date_taken">拍摄日期</string>
<string name="delete">删除</string>
<string name="delete_empty_folders">删除没有内容的空文件夹</string>
<string name="descending">递减</string>
<string name="destination">目标路径</string>
<string name="device_os">设备系统:%1$s</string>
<string name="direct_children_count">子目录数</string>
<string name="discard">丢弃</string>
<string name="do_not_ask_again">不再询问</string>
<string name="donate">捐赠</string>
<string name="donate_please">"您已使用此应用一段时间了。
<!-- Hide / Exclude --> 可您知道么,我并不就职于一个大公司。开发应用耗时耗力,且我想依旧保持免费,您的捐赠会给我更多动力。
<string name="hide_folder_description">通过添加文件 \'.nomedia\' 到目录,可以防止目录及其子目录下的所有媒体被扫描。您可以通过设置中的 \'显示隐藏目录\' 选项改变设置,是否继续?</string>
您可以通过购买付费应用 Simple Thank You 或捐赠比特币来支持我。
更多信息请查阅 http://simplemobiletools.com/donate.
非常感谢!"</string>
<string name="donate_underlined"><u>捐赠</u></string>
<string name="duration">时长</string>
<string name="edit">编辑</string>
<string name="edit_image_with">编辑方式:</string>
<string name="edit_with">编辑方式</string>
<string name="editor">编辑器</string>
<string name="email_label">发送反馈</string>
<string name="empty_name">请输入名称</string>
<string name="enter_pin">输入密码</string>
<string name="error_saving_file">不能覆盖源文件</string>
<string name="exclude">排除</string> <string name="exclude">排除</string>
<string name="excluded_folders">排除目录</string>
<string name="manage_excluded_folders">管理排除目录</string>
<string name="exclude_folder_description">目录及其子目录中的媒体将不会在 Simple Gallery 中显示,您可以在设置更改。</string> <string name="exclude_folder_description">目录及其子目录中的媒体将不会在 Simple Gallery 中显示,您可以在设置更改。</string>
<string name="exclude_folder_parent">是否排除父目录?</string> <string name="exclude_folder_parent">是否排除父目录?</string>
<string name="excluded_activity_placeholder">此目录及其子目录中的媒体将不会在 Simple Gallery 中显示,但是其它应用可以访问。如果您想对其它应用隐藏,请使用隐藏功能。</string> <string name="excluded_activity_placeholder">此目录及其子目录中的媒体将不会在 Simple Gallery 中显示,但是其它应用可以访问。如果您想对其它应用隐藏,请使用隐藏功能。</string>
<string name="remove_all">移除全部</string> <string name="excluded_folders">排除目录</string>
<string name="remove_all_description">是否移除列表中的全部目录?目录不会被物理删除。</string> <string name="exif">EXIF</string>
<string name="exposure_time">曝光时间</string>
<!-- Include folders --> <string name="extension">扩展名</string>
<string name="include_folders">包含目录</string> <string name="extension_cannot_be_empty">扩展名不能为空</string>
<string name="manage_included_folders">管理包含目录</string> <string name="extra_large">超大</string>
<string name="add_folder">添加目录</string> <string name="f_number">光圈</string>
<string name="included_activity_placeholder">如果您还有应用未扫描到的媒体文件,请添加所在目录路径。</string> <string name="file">文件</string>
<string name="file_already_exists">文件 %1$s 已存在</string>
<!-- Resizing --> <string name="file_already_exists_overwrite">文件 %1$s 已存在。是否覆盖?</string>
<string name="resize">缩放</string> <string name="file_saved">文件保存成功</string>
<string name="resize_and_save">缩放选定区域并保存</string> <string name="filename">文件名</string>
<string name="width">宽度</string> <string name="filename_cannot_be_empty">文件名不能为空</string>
<string name="height">高度</string> <string name="filename_invalid_characters">文件名包含非法字符</string>
<string name="keep_aspect_ratio">保持纵横比</string> <string name="files_count">总文件数</string>
<string name="invalid_values">请输入有效分辨率</string> <string name="filter_media">要显示的媒体文件</string>
<string name="fingerprint">指纹</string>
<!-- Editor --> <string name="fingerprint_setup_successfully">保护设置成功。请重新安装本应用,以防复位时出现问题。</string>
<string name="editor">编辑器</string>
<string name="save">保存</string>
<string name="rotate">旋转</string>
<string name="path">路径</string>
<string name="invalid_image_path">无效图片路径</string>
<string name="image_editing_failed">图片编辑失败</string>
<string name="edit_image_with">编辑方式:</string>
<string name="no_editor_found">未找到可用图片编辑器</string>
<string name="unknown_file_location">未知的文件路径</string>
<string name="error_saving_file">不能覆盖源文件</string>
<string name="rotate_left">向左旋转</string>
<string name="rotate_right">向右旋转</string>
<string name="rotate_one_eighty">旋转 180º</string>
<string name="flip">翻转</string> <string name="flip">翻转</string>
<string name="flip_horizontally">水平翻转</string> <string name="flip_horizontally">水平翻转</string>
<string name="flip_vertically">垂直翻转</string> <string name="flip_vertically">垂直翻转</string>
<string name="edit_with">编辑方式</string> <string name="focal_length">焦距</string>
<string name="folder">文件夹</string>
<!-- Set wallpaper --> <string name="folder_view">目录视图</string>
<string name="simple_wallpaper">Simple Wallpaper</string> <string name="follow_us">关注我们:</string>
<string name="font_size">字体大小</string>
<string name="gifs">GIFs</string>
<string name="glide_title">滑动(图像加载和缓存)</string>
<string name="go_to_settings">去设置</string>
<string name="grid"></string>
<string name="gruveo">你在寻找一个简单而匿名的视频通话应用吗?请尝试我的另一个项目</string>
<string name="height">高度</string>
<string name="hidden">(隐藏)</string>
<string name="hide">隐藏</string>
<string name="hide_folder">隐藏文件夹</string>
<string name="hide_folder_description">"通过添加文件 '.nomedia' 到目录,可以防止目录及其子目录下的所有媒体被扫描。您可以通过设置中的 '显示隐藏目录' 选项改变设置,是否继续?"</string>
<string name="hide_system_ui_at_fullscreen">全屏时自动隐藏状态栏</string>
<string name="image_editing_failed">图片编辑失败</string>
<string name="images">图片</string>
<string name="include_folders">包含目录</string>
<string name="include_gifs">包含 GIFs</string>
<string name="include_photos">包含照片</string>
<string name="include_videos">包含视频</string>
<string name="included_activity_placeholder">如果您还有应用未扫描到的媒体文件,请添加所在目录路径。</string>
<string name="increase_column_count">增加一栏</string>
<string name="insert_pattern">绘制图案</string>
<string name="internal">内部存储器</string>
<string name="interval">间隔(秒):</string>
<string name="invalid_destination">无法写入到选中目标路径</string>
<string name="invalid_file_format">无效文件格式</string>
<string name="invalid_image_path">无效图片路径</string>
<string name="invalid_name">名称包含非法字符</string>
<string name="invalid_values">请输入有效分辨率</string>
<string name="invite_friends_underlined"><u>分享给好友</u></string>
<string name="invite_via">分享到</string>
<string name="iso_speed">ISO 速度</string>
<string name="items_selected">已选择项目</string>
<string name="joda_title">Joda-TimeJava日期替换</string>
<string name="keep_aspect_ratio">保持纵横比</string>
<string name="kotlin_title">Kotlin编程语言</string>
<string name="landscape_aspect_ratio">横向长宽比</string>
<string name="large"></string>
<string name="last_modified">修改日期</string>
<string name="light_theme">浅色主题</string>
<string name="list">列表</string>
<string name="loop_slideshow">循环幻灯片</string>
<string name="loop_videos">循环播放视频</string>
<string name="manage_excluded_folders">管理排除目录</string>
<string name="manage_extended_details">要显示的详细信息项目</string>
<string name="manage_included_folders">管理包含目录</string>
<string name="max_brightness">浏览时最大亮度</string>
<string name="medium"></string>
<string name="more_apps_underlined"><u>更多应用</u></string>
<string name="move">移动</string>
<string name="move_backwards">倒播</string>
<string name="move_to">移动到</string>
<string name="moving">正在移动…</string>
<string name="moving_success">文件移动成功</string>
<string name="moving_success_partial">无法移动相同文件</string>
<string name="multiselect_title">RecyclerView MultiSelect选择多个列表项</string>
<string name="name">名称</string>
<string name="name_taken">同名文件夹或文件已存在</string>
<string name="no"></string>
<string name="no_app_found">未找到可用应用</string>
<string name="no_camera_app_found">未找到相机应用</string>
<string name="no_capable_app_found">未找到可用应用</string>
<string name="no_editor_found">未找到可用图片编辑器</string>
<string name="no_files_selected">未选择文件</string>
<string name="no_fingerprints_registered">您还没有注册指纹,请先给你的设备添加一些指纹</string>
<string name="no_map_application">未找到地图应用</string>
<string name="no_media_for_slideshow">未发现可用媒体</string>
<string name="no_media_with_filters">所选的过滤器没有找到的媒体文件。</string>
<string name="no_storage_permissions">请授予权限以访问您的存储器</string>
<string name="notice">此应用使用了以下三方库。谢谢。</string>
<string name="ok">确认</string>
<string name="open_camera">打开相机</string>
<string name="open_with">打开方式</string>
<string name="other_folder">其他目录</string>
<string name="otto_title">Otto (event bus)</string>
<string name="out_of_memory_error">内存不足</string>
<string name="overwrite">覆盖</string>
<string name="password_protect_hidden_items">使用密码保护隐藏项</string>
<string name="path">路径</string>
<string name="pattern">图案</string>
<string name="pattern_title">PatternLockView图案保护</string>
<string name="photoview_title">PhotoView可缩放 gifs</string>
<string name="picasso_title">Picasso图像加载和缓存</string>
<string name="pin">密码</string>
<string name="pin_folder">锁定目录</string>
<string name="place_finger">请将手指放在指纹传感器上</string>
<string name="please_enter_pin">请输入密码</string>
<string name="please_select_destination">请选择目标路径</string>
<string name="portrait_aspect_ratio">纵向长宽比</string>
<string name="primary_color">主体色</string>
<string name="proceed_with_deletion">是否执行此删除操作?</string>
<string name="properties">属性</string>
<string name="protection_setup_successfully">密码设置成功。为防止遗忘,请重新安装本应用。</string>
<string name="random_order">随机顺序</string>
<string name="rate_us_underlined"><u>为我们打分</u></string>
<string name="reduce_column_count">减少一栏</string>
<string name="remove_all">移除全部</string>
<string name="remove_all_description">是否移除列表中的全部目录?目录不会被物理删除。</string>
<string name="rename">重命名</string>
<string name="rename_file">重命名文件</string>
<string name="rename_file_error">无法重命名文件</string>
<string name="rename_folder">重命名文件夹</string>
<string name="rename_folder_empty">文件夹名不能为空</string>
<string name="rename_folder_error">无法重命名文件夹</string>
<string name="rename_folder_exists">文件夹名已存在</string>
<string name="rename_folder_ok">文件夹重命名成功</string>
<string name="rename_folder_root">无法重命名存储器的根目录</string>
<string name="renaming_folder">重命名中...</string>
<string name="repeat_pattern">重复图案</string>
<string name="repeat_pin">重复密码</string>
<string name="replace_share_with_rotate">替换全屏时菜单栏的“分享”为“旋转”</string>
<string name="resize">缩放</string>
<string name="resize_and_save">缩放选定区域并保存</string>
<string name="resolution">分辨率</string>
<string name="restore_defaults">恢复默认</string>
<string name="root">根目录</string>
<string name="rotate">旋转</string>
<string name="rotate_left">向左旋转</string>
<string name="rotate_one_eighty">旋转 180º</string>
<string name="rotate_right">向右旋转</string>
<string name="rtl_viewpager_title">RtlViewPager从右到左滑动</string>
<string name="save">保存</string>
<string name="save_as">保存</string>
<string name="save_before_closing">您尚未保存更改,是否保存?</string>
<string name="saving">正在保存…</string>
<string name="screen_rotation_aspect_ratio">根据长宽比</string>
<string name="screen_rotation_by">全屏方向</string>
<string name="screen_rotation_device_rotation">设备方向</string>
<string name="screen_rotation_system_setting">系统设置</string>
<string name="scroll_thumbnails_horizontally">水平滚动缩略图</string>
<string name="sd_card">SD 卡</string>
<string name="search">搜索</string>
<string name="select_all">全选</string>
<string name="select_an_action">选择操作</string>
<string name="select_destination">选择目标路径</string>
<string name="select_file">选择文件</string>
<string name="select_folder">选择文件夹</string>
<string name="select_photo">选择图片</string>
<string name="select_storage">选择存储器</string>
<string name="set_as">设置为</string>
<string name="set_as_wallpaper">设为壁纸</string> <string name="set_as_wallpaper">设为壁纸</string>
<string name="set_as_wallpaper_failed">壁纸设置失败</string> <string name="set_as_wallpaper_failed">壁纸设置失败</string>
<string name="set_as_wallpaper_with">设为壁纸...</string> <string name="set_as_wallpaper_with">设为壁纸...</string>
<string name="no_capable_app_found">未找到可用应用</string> <string name="setting_wallpaper">正在设置壁纸…</string>
<string name="setting_wallpaper">正在设置壁纸&#8230;</string> <string name="settings">设置</string>
<string name="wallpaper_set_successfully">壁纸设置成功</string> <string name="share">分享</string>
<string name="portrait_aspect_ratio">纵向长宽比</string> <string name="share_text">请前往 %2$s 看看我们的 %1$s 吧!</string>
<string name="landscape_aspect_ratio">横向长宽比</string> <string name="share_via">分享到</string>
<string name="show_all">文件视图</string>
<!-- Slideshow --> <string name="show_extended_details">全屏浏览媒体时显示详细信息</string>
<string name="slideshow">幻灯片</string> <string name="show_hidden">显示隐藏文件和文件夹</string>
<string name="interval">间隔(秒):</string>
<string name="include_photos">包含照片和动态图</string>
<string name="include_videos">包含视频</string>
<string name="random_order">随机顺序</string>
<string name="use_fade">使用渐变动画</string>
<string name="move_backwards">倒播</string>
<string name="slideshow_ended">幻灯片结束</string>
<string name="no_media_for_slideshow">未发现可用媒体</string>
<!-- Settings -->
<string name="show_hidden_media">显示所有</string> <string name="show_hidden_media">显示所有</string>
<string name="autoplay_videos">自动播放</string> <string name="show_on_map">在地图中显示</string>
<string name="simple_wallpaper">简约壁纸</string>
<string name="size">大小</string>
<string name="skip">跳过</string>
<string name="slideshow">幻灯片</string>
<string name="slideshow_ended">幻灯片结束</string>
<string name="small"></string>
<string name="sort_by">排序方式</string>
<string name="source">原始路径</string>
<string name="source_and_destination_same">原始路径和目标路径不能相同</string>
<string name="stetho_title">Stetho调试数据库</string>
<string name="stop_showing_hidden">不显示隐藏的媒体文件</string>
<string name="subsampling_title">Subsampling Scale Image View可缩放图像浏览</string>
<string name="temporarily_show_hidden">显示/隐藏缓存内容</string>
<string name="text_color">文本颜色</string>
<string name="theme">主题</string>
<string name="third_party_licences">开放源代码</string>
<string name="third_party_licences_underlined"><u>开放源代码</u></string>
<string name="title">标题</string>
<string name="toggle_filename">显示文件名</string> <string name="toggle_filename">显示文件名</string>
<string name="show_media">显示多媒体文件</string> <string name="undo_changes">撤销更改</string>
<string name="images">仅图片</string> <string name="undo_changes_confirmation">是否撤销您的更改?</string>
<string name="videos">仅视频</string> <string name="unhide">取消隐藏</string>
<string name="gifs">仅 GIF </string> <string name="unhide_folder">取消隐藏文件夹</string>
<string name="images_videos_gifs">图片视频GIF</string> <string name="unknown_error_occurred">未知错误</string>
<string name="images_and_videos">图片和视频</string> <string name="unknown_file_location">未知的文件路径</string>
<string name="loop_videos">循环播放视频</string> <string name="unknown_location">未知位置</string>
<string name="animate_gifs">GIF 缩略图</string> <string name="unpin_folder">解除锁定目录</string>
<string name="max_brightness">浏览时最大亮度</string> <string name="use_default">使用默认</string>
<string name="crop_thumbnails">裁剪缩略图</string> <string name="use_fade">使用渐变动画</string>
<string name="screen_rotation_by">全屏时方向</string> <string name="use_for_this_folder">仅应用于此文件夹</string>
<string name="screen_rotation_system_setting">系统设置</string> <string name="videos">视频</string>
<string name="screen_rotation_device_rotation">设备方向</string> <string name="volume">音量</string>
<string name="screen_rotation_aspect_ratio">根据长宽比</string> <string name="wallpaper_set_successfully">壁纸设置成功</string>
<string name="dark_background_at_fullscreen">全屏时黑色背景</string> <string name="website_label">应用源码</string>
<string name="scroll_thumbnails_horizontally">水平滚动缩略图</string> <string name="whats_new">更新日志</string>
<string name="hide_system_ui_at_fullscreen">全屏时自动隐藏状态栏</string> <string name="whats_new_disclaimer">* 此处仅列举了重大更新,更多修正可在使用中体验</string>
<string name="replace_share_with_rotate">替换全屏时菜单栏的“分享”为“旋转”</string> <string name="width">宽度</string>
<string name="wrong_pattern">图案错误</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <string name="wrong_pin">密码错误</string>
<!-- Short description has to have less than 80 chars --> <string name="wrong_root_selected">目录选择错误,请选择 SD 卡</string>
<string name="app_short_description">一个没有广告,用来观看照片及视频的相册。</string> <string name="yes"></string>
<string name="app_long_description">
一个观看照片和视频的简单实用工具。项目可以根据日期、大小、名称来递增或递减排序,照片可以缩放。媒体文件根据屏幕的大小排列在多个方格中,您可以使用缩放手势来调整每一列的方格数量。媒体文件可以被重命名、分享、删除、复制以及移动。照片亦可被剪切、旋转或是直接在应用中设为壁纸。
相册亦提供能让第三方应用预览图片/视频、向电子邮件客户端添加附件等的功能。非常适合日常使用。
应用不包含广告与不必要的权限。它是完全开放源代码的,并内置自定义颜色主题。
这个应用只是一系列应用中的一小部份。您可以在 http://www.simplemobiletools.com 找到其余的应用。
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources> </resources>

View file

@ -25,6 +25,15 @@
<string name="set_as">設為</string> <string name="set_as">設為</string>
<string name="volume">音量</string> <string name="volume">音量</string>
<string name="brightness">亮度</string> <string name="brightness">亮度</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">篩選媒體檔案</string>
<string name="images">圖片</string>
<string name="videos">影片</string>
<string name="gifs">GIF</string>
<string name="no_media_with_filters">選擇的篩選條件未發現媒體檔案。</string>
<string name="change_filters_underlined"><u>更改篩選條件</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">這功能藉由添加一個\'.nomedia\'檔案,來隱藏資料夾和所有子資料夾。您可以透過設定中的「顯示隱藏的資料夾」選項來查看。\n是否繼續?</string> <string name="hide_folder_description">這功能藉由添加一個\'.nomedia\'檔案,來隱藏資料夾和所有子資料夾。您可以透過設定中的「顯示隱藏的資料夾」選項來查看。\n是否繼續?</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">投影片</string> <string name="slideshow">投影片</string>
<string name="interval">間隔 (秒):</string> <string name="interval">間隔 (秒):</string>
<string name="include_photos">包含照片和GIF</string> <string name="include_photos">Include photos</string>
<string name="include_videos">包含影片</string> <string name="include_videos">包含影片</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">隨機順序</string> <string name="random_order">隨機順序</string>
<string name="use_fade">使用淡入淡出動畫</string> <string name="use_fade">使用淡入淡出動畫</string>
<string name="move_backwards">反向播放</string> <string name="move_backwards">反向播放</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">投影片結束</string> <string name="slideshow_ended">投影片結束</string>
<string name="no_media_for_slideshow">找不到投影片的媒體檔案</string> <string name="no_media_for_slideshow">找不到投影片的媒體檔案</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">顯示隱藏的媒體檔案</string> <string name="show_hidden_media">顯示隱藏的媒體檔案</string>
<string name="autoplay_videos">自動播放影片</string> <string name="autoplay_videos">自動播放影片</string>
<string name="toggle_filename">顯示檔案名稱</string> <string name="toggle_filename">顯示檔案名稱</string>
<string name="show_media">顯示媒體檔案</string>
<string name="images">只有圖片</string>
<string name="videos">只有影片</string>
<string name="gifs">只有GIF</string>
<string name="images_videos_gifs">圖片、影片、GIF</string>
<string name="images_and_videos">圖片和影片</string>
<string name="loop_videos">影片循環播放</string> <string name="loop_videos">影片循環播放</string>
<string name="animate_gifs">縮圖顯示GIF動畫</string> <string name="animate_gifs">縮圖顯示GIF動畫</string>
<string name="max_brightness">瀏覽時最大亮度</string> <string name="max_brightness">瀏覽時最大亮度</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">全螢幕時黑背景</string> <string name="dark_background_at_fullscreen">全螢幕時黑背景</string>
<string name="scroll_thumbnails_horizontally">橫向滑動縮圖</string> <string name="scroll_thumbnails_horizontally">橫向滑動縮圖</string>
<string name="hide_system_ui_at_fullscreen">全螢幕時自動隱藏系統介面</string> <string name="hide_system_ui_at_fullscreen">全螢幕時自動隱藏系統介面</string>
<string name="delete_empty_folders">刪除內容後刪除空白資料夾</string>
<string name="allow_video_gestures">允許用上下手勢來控制影片的音量和亮度</string>
<string name="replace_share_with_rotate">將全螢幕選單的分享取代為旋轉</string> <string name="replace_share_with_rotate">將全螢幕選單的分享取代為旋轉</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -3,9 +3,11 @@
<dimen name="dir_tmb_size">150dp</dimen> <dimen name="dir_tmb_size">150dp</dimen>
<dimen name="medium_tmb_size">100dp</dimen> <dimen name="medium_tmb_size">100dp</dimen>
<dimen name="sd_card_icon_size">20dp</dimen> <dimen name="sd_card_icon_size">20dp</dimen>
<dimen name="play_outline_icon_size">22dp</dimen>
<dimen name="selection_check_size">26dp</dimen> <dimen name="selection_check_size">26dp</dimen>
<dimen name="play_outline_size_big">150dp</dimen> <dimen name="play_outline_size_big">150dp</dimen>
<dimen name="timer_padding">24dp</dimen> <dimen name="timer_padding">24dp</dimen>
<dimen name="tmb_shadow_height">50dp</dimen> <dimen name="tmb_shadow_height">50dp</dimen>
<dimen name="video_side_slider_width">150dp</dimen> <dimen name="video_side_slider_width">150dp</dimen>
<dimen name="list_view_folder_thumbnail_size">72dp</dimen>
</resources> </resources>

View file

@ -2,12 +2,22 @@
<resources> <resources>
<!-- Release notes --> <!-- Release notes -->
<string name="release_136">Added an option to show customizable extended details over fullscreen media</string>
<string name="release_133">
Added fingerprint to hidden item protection\n
Added a new List view type
</string>
<string name="release_127">
Added a switch for disabling video gestures\n
Added a switch for deleting empty folders after deleting content
</string>
<string name="release_125">Moved media type filter from Settings to the Action menu</string>
<string name="release_123">Allow changing the screen brightness and volume at videos by vertically dragging the screen sides</string> <string name="release_123">Allow changing the screen brightness and volume at videos by vertically dragging the screen sides</string>
<string name="release_122">Added slideshow at the fullscreen view</string> <string name="release_122">Added slideshow at the fullscreen view</string>
<string name="release_119">Added pattern/pin protection for showing hidden items</string> <string name="release_119">Added pattern/pin protection for showing hidden items</string>
<string name="release_118">Added a toggle for replacing Share with Rotate at fullscreen media</string> <string name="release_118">Added a toggle for replacing Share with Rotate at fullscreen media</string>
<string name="release_115"> <string name="release_115">
Added an indicator of folders located on SD cards Added an indicator of folders located on SD cards\n
Improved the way of rotating jpg images on the internal storage by modifying the exif tags + added autosave Improved the way of rotating jpg images on the internal storage by modifying the exif tags + added autosave
</string> </string>
<string name="release_114">Added an option for automatically hiding the system UI at entering fullscreen mode</string> <string name="release_114">Added an option for automatically hiding the system UI at entering fullscreen mode</string>

View file

@ -25,6 +25,15 @@
<string name="set_as">Set as</string> <string name="set_as">Set as</string>
<string name="volume">Volume</string> <string name="volume">Volume</string>
<string name="brightness">Brightness</string> <string name="brightness">Brightness</string>
<string name="do_not_ask_again">Do not ask again in this session</string>
<!-- Filter -->
<string name="filter_media">Filter media</string>
<string name="images">Images</string>
<string name="videos">Videos</string>
<string name="gifs">GIFs</string>
<string name="no_media_with_filters">No media files have been found with the selected filters.</string>
<string name="change_filters_underlined"><u>Change filters</u></string>
<!-- Hide / Exclude --> <!-- Hide / Exclude -->
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue?</string>
@ -41,7 +50,7 @@
<string name="include_folders">Included folders</string> <string name="include_folders">Included folders</string>
<string name="manage_included_folders">Manage included folders</string> <string name="manage_included_folders">Manage included folders</string>
<string name="add_folder">Add folder</string> <string name="add_folder">Add folder</string>
<string name="included_activity_placeholder">If you have some folders which contain media, but were not recognized by the app, you can add them manually here.</string> <string name="included_activity_placeholder">If you have some folders which contain media, but were not recognized by the app, you can add them manually here.\n\nAdding some items here will not exclude any other folder.</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>
@ -84,24 +93,25 @@
<!-- Slideshow --> <!-- Slideshow -->
<string name="slideshow">Slideshow</string> <string name="slideshow">Slideshow</string>
<string name="interval">Interval (seconds):</string> <string name="interval">Interval (seconds):</string>
<string name="include_photos">Include photos and GIFs</string> <string name="include_photos">Include photos</string>
<string name="include_videos">Include videos</string> <string name="include_videos">Include videos</string>
<string name="include_gifs">Include GIFs</string>
<string name="random_order">Random order</string> <string name="random_order">Random order</string>
<string name="use_fade">Use fade animations</string> <string name="use_fade">Use fade animations</string>
<string name="move_backwards">Move backwards</string> <string name="move_backwards">Move backwards</string>
<string name="loop_slideshow">Loop slideshow</string>
<string name="slideshow_ended">The slideshow ended</string> <string name="slideshow_ended">The slideshow ended</string>
<string name="no_media_for_slideshow">No media for the slideshow have been found</string> <string name="no_media_for_slideshow">No media for the slideshow have been found</string>
<!-- View types -->
<string name="change_view_type">Change view type</string>
<string name="grid">Grid</string>
<string name="list">List</string>
<!-- Settings --> <!-- Settings -->
<string name="show_hidden_media">Show hidden media</string> <string name="show_hidden_media">Show hidden media</string>
<string name="autoplay_videos">Play videos automatically</string> <string name="autoplay_videos">Play videos automatically</string>
<string name="toggle_filename">Toggle filename visibility</string> <string name="toggle_filename">Toggle filename visibility</string>
<string name="show_media">Show media</string>
<string name="images">Images only</string>
<string name="videos">Videos only</string>
<string name="gifs">GIFs only</string>
<string name="images_videos_gifs">Images, videos, GIFs</string>
<string name="images_and_videos">Images and videos</string>
<string name="loop_videos">Loop videos</string> <string name="loop_videos">Loop videos</string>
<string name="animate_gifs">Animate GIFs at thumbnails</string> <string name="animate_gifs">Animate GIFs at thumbnails</string>
<string name="max_brightness">Max brightness when viewing media</string> <string name="max_brightness">Max brightness when viewing media</string>
@ -113,7 +123,11 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string> <string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string> <string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string> <string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string> <string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have --> <!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars --> <!-- Short description has to have less than 80 chars -->

View file

@ -16,6 +16,7 @@ allprojects {
repositories { repositories {
jcenter() jcenter()
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
} }
} }