Merge pull request #8 from SimpleMobileTools/master

update
This commit is contained in:
solokot 2017-12-10 18:42:56 +03:00 committed by GitHub
commit 0c6d1306d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 149 additions and 127 deletions

View File

@ -1,6 +1,14 @@
Changelog
==========
Version 3.0.1 *(2017-12-06)*
----------------------------
* Fix missing launcher icon on some devices
* Added an info bubble at scrolling by dragging
* Allow zooming gifs
* Display raw .dng files
Version 3.0.0 *(2017-12-04)*
----------------------------

View File

@ -10,8 +10,8 @@ android {
applicationId "com.simplemobiletools.gallery"
minSdkVersion 16
targetSdkVersion 27
versionCode 146
versionName "3.0.0"
versionCode 147
versionName "3.0.1"
multiDexEnabled true
setProperty("archivesBaseName", "gallery")
}
@ -43,13 +43,14 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.1.4'
implementation 'com.simplemobiletools:commons:3.2.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"

View File

@ -57,6 +57,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private var mStoredCropThumbnails = true
private var mStoredScrollHorizontally = true
private var mStoredShowMediaCount = true
private var mStoredShowInfoBubble = true
private var mStoredTextColor = 0
private var mLoadedInitialPhotos = false
private var mIsPasswordProtectionPending = false
@ -113,7 +114,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
getDirectoryAdapter()?.updateShowMediaCount(config.showMediaCount)
}
if (mStoredScrollHorizontally != config.scrollHorizontally) {
if (mStoredScrollHorizontally != config.scrollHorizontally || mStoredShowInfoBubble != config.showInfoBubble) {
getDirectoryAdapter()?.updateScrollHorizontally(config.viewTypeFolders != VIEW_TYPE_LIST && config.scrollHorizontally)
setupScrollDirection()
}
@ -122,6 +123,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
getDirectoryAdapter()?.updateTextColor(config.textColor)
}
directories_horizontal_fastscroller.updateBubbleColors()
directories_vertical_fastscroller.updateBubbleColors()
invalidateOptionsMenu()
directories_empty_text_label.setTextColor(config.textColor)
directories_empty_text.setTextColor(config.primaryColor)
@ -200,6 +203,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mStoredCropThumbnails = cropThumbnails
mStoredScrollHorizontally = scrollHorizontally
mStoredShowMediaCount = showMediaCount
mStoredShowInfoBubble = showInfoBubble
mStoredTextColor = textColor
}
}
@ -581,8 +585,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll)
if (allowHorizontalScroll) {
directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout)
directories_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) {
directories_horizontal_fastscroller.updateBubbleText(mDirs[it].getBubbleText())
}
} else {
directories_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) {
directories_vertical_fastscroller.updateBubbleText(mDirs[it].getBubbleText())
}
@ -595,7 +603,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
mLastMediaHandler.removeCallbacksAndMessages(null)
mLastMediaHandler.postDelayed({
Thread({
Thread {
val mediaId = getLatestMediaId()
if (mLatestMediaId != mediaId) {
mLatestMediaId = mediaId
@ -605,7 +613,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
} else {
checkLastMediaChanged()
}
}).start()
}.start()
}, LAST_MEDIA_CHECK_PERIOD)
}

View File

@ -53,6 +53,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private var mStoredAnimateGifs = true
private var mStoredCropThumbnails = true
private var mStoredScrollHorizontally = true
private var mStoredShowInfoBubble = true
private var mStoredTextColor = 0
private var mLastDrawnHashCode = 0
private var mLatestMediaId = 0L
@ -74,7 +75,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mAllowPickingMultiple = getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
}
media_refresh_layout.setOnRefreshListener({ getMedia() })
media_refresh_layout.setOnRefreshListener { getMedia() }
mPath = intent.getStringExtra(DIRECTORY)
storeStateVariables()
if (mShowAll)
@ -100,7 +101,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
getMediaAdapter()?.updateCropThumbnails(config.cropThumbnails)
}
if (mStoredScrollHorizontally != config.scrollHorizontally) {
if (mStoredScrollHorizontally != config.scrollHorizontally || mStoredShowInfoBubble != config.showInfoBubble) {
getMediaAdapter()?.updateScrollHorizontally(config.viewTypeFiles != VIEW_TYPE_LIST || !config.scrollHorizontally)
setupScrollDirection()
}
@ -109,6 +110,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
getMediaAdapter()?.updateTextColor(config.textColor)
}
media_horizontal_fastscroller.updateBubbleColors()
media_vertical_fastscroller.updateBubbleColors()
tryloadGallery()
invalidateOptionsMenu()
media_empty_text_label.setTextColor(config.textColor)
@ -140,6 +143,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mStoredAnimateGifs = animateGifs
mStoredCropThumbnails = cropThumbnails
mStoredScrollHorizontally = scrollHorizontally
mStoredShowInfoBubble = showInfoBubble
mStoredTextColor = textColor
mShowAll = showAll
}
@ -149,7 +153,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
handlePermission(PERMISSION_WRITE_STORAGE) {
if (it) {
val dirName = getHumanizedFilename(mPath)
title = if (mShowAll) resources.getString(R.string.all_folders) else dirName
supportActionBar?.title = if (mShowAll) resources.getString(R.string.all_folders) else dirName
getMedia()
setupLayoutManager()
checkIfColorChanged()
@ -201,8 +205,12 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
media_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll)
if (allowHorizontalScroll) {
media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout)
media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) {
media_horizontal_fastscroller.updateBubbleText(mMedia[it].getBubbleText())
}
} else {
media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) {
media_vertical_fastscroller.updateBubbleText(mMedia[it].getBubbleText())
}
@ -215,7 +223,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mLastMediaHandler.removeCallbacksAndMessages(null)
mLastMediaHandler.postDelayed({
Thread({
Thread {
val mediaId = getLatestMediaId()
if (mLatestMediaId != mediaId) {
mLatestMediaId = mediaId
@ -225,7 +233,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} else {
checkLastMediaChanged()
}
}).start()
}.start()
}, LAST_MEDIA_CHECK_PERIOD)
}

View File

@ -79,7 +79,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
val bundle = Bundle()
val file = File(mUri.toString())
mMedium = Medium(getFilenameFromUri(mUri!!), mUri.toString(), mIsVideo, 0, 0, file.length())
title = mMedium!!.name
supportActionBar?.title = mMedium!!.name
bundle.putSerializable(MEDIUM, mMedium)
if (savedInstanceState == null) {

View File

@ -114,7 +114,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete
if (result.error == null) {
toast(R.string.setting_wallpaper)
Thread({
Thread {
val bitmap = result.bitmap
val wantedHeight = wallpaperManager.desiredMinimumHeight
val ratio = wantedHeight / bitmap.height.toFloat()
@ -132,7 +132,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete
setResult(Activity.RESULT_CANCELED)
}
finish()
}).start()
}.start()
} else {
toast("${getString(R.string.image_editing_failed)}: ${result.error.message}")
}

View File

@ -55,6 +55,7 @@ class SettingsActivity : SimpleActivity() {
setupAllowVideoGestures()
setupShowMediaCount()
setupKeepLastModified()
setupShowInfoBubble()
setupShowExtendedDetails()
setupManageExtendedDetails()
updateTextColors(settings_holder)
@ -254,6 +255,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupShowInfoBubble() {
settings_show_info_bubble.isChecked = config.showInfoBubble
settings_show_info_bubble_holder.setOnClickListener {
settings_show_info_bubble.toggle()
config.showInfoBubble = settings_show_info_bubble.isChecked
}
}
private fun setupScreenRotation() {
settings_screen_rotation.text = getScreenRotationText()
settings_screen_rotation_holder.setOnClickListener {

View File

@ -185,7 +185,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
showSystemUI()
mDirectory = File(mPath).parent
title = mPath.getFilenameFromPath()
supportActionBar?.title = mPath.getFilenameFromPath()
view_pager.onGlobalLayout {
if (!isActivityDestroyed()) {
@ -463,7 +463,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun toggleFileVisibility(hide: Boolean) {
toggleFileVisibility(getCurrentFile(), hide) {
val newFileName = it.absolutePath.getFilenameFromPath()
title = newFileName
supportActionBar?.title = newFileName
getCurrentMedium()!!.apply {
name = newFileName
@ -499,9 +499,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
SaveAsDialog(this, currPath, false) {
val selectedFile = File(it)
handleSAFDialog(selectedFile) {
Thread({
Thread {
saveImageToFile(currPath, it)
}).start()
}.start()
}
}
}
@ -835,7 +835,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun updateActionbarTitle() {
runOnUiThread {
if (mPos < getCurrentMedia().size) {
title = getCurrentMedia()[mPos].path.getFilenameFromPath()
supportActionBar?.title = getCurrentMedia()[mPos].path.getFilenameFromPath()
}
}
}

View File

@ -1,6 +1,5 @@
package com.simplemobiletools.gallery.adapters
import android.graphics.PorterDuff
import android.view.Menu
import android.view.View
import android.view.ViewGroup
@ -342,8 +341,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList<Direc
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)
dir_pin.applyColorFilter(textColor)
dir_sd_card.applyColorFilter(textColor)
}
}
}

View File

@ -1,6 +1,5 @@
package com.simplemobiletools.gallery.adapters
import android.graphics.PorterDuff
import android.net.Uri
import android.view.Menu
import android.view.View
@ -19,7 +18,7 @@ import com.simplemobiletools.gallery.dialogs.DeleteWithRememberDialog
import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.VIEW_TYPE_LIST
import com.simplemobiletools.gallery.models.Medium
import kotlinx.android.synthetic.main.photo_video_item_grid.view.*
import kotlinx.android.synthetic.main.photo_video_item_list.view.*
import java.io.File
import java.util.*
@ -142,7 +141,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
}
private fun toggleFileVisibility(hide: Boolean) {
Thread({
Thread {
getSelectedMedia().forEach {
val oldFile = File(it.path)
activity.toggleFileVisibility(oldFile, hide)
@ -151,7 +150,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
listener?.refreshItems()
finishActMode()
}
}).start()
}.start()
}
private fun shareMedia() {
@ -264,7 +263,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
if (isListViewType) {
photo_name.setTextColor(textColor)
play_outline.setColorFilter(textColor, PorterDuff.Mode.SRC_IN)
play_outline.applyColorFilter(textColor)
}
}
}

View File

@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs
import android.content.DialogInterface
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.beVisibleIf
@ -20,7 +19,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
private var view: View
init {
view = LayoutInflater.from(activity).inflate(R.layout.dialog_change_sorting, null).apply {
view = activity.layoutInflater.inflate(R.layout.dialog_change_sorting, null).apply {
use_for_this_folder_divider.beVisibleIf(showFolderCheckbox)
sorting_dialog_use_for_this_folder.beVisibleIf(showFolderCheckbox)
sorting_dialog_use_for_this_folder.isChecked = config.hasCustomSorting(path)

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.RadioButton
import android.widget.RadioGroup
@ -18,7 +17,7 @@ class ExcludeFolderDialog(val activity: BaseSimpleActivity, val selectedPaths: L
var radioGroup: RadioGroup? = null
init {
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_exclude_folder, null).apply {
val view = activity.layoutInflater.inflate(R.layout.dialog_exclude_folder, null).apply {
exclude_folder_parent.beVisibleIf(alternativePaths.size > 1)
radioGroup = exclude_folder_radio_group

View File

@ -1,8 +1,6 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R
@ -13,7 +11,7 @@ import com.simplemobiletools.gallery.helpers.VIDEOS
import kotlinx.android.synthetic.main.dialog_filter_media.view.*
class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) {
private var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_filter_media, null)
private var view = activity.layoutInflater.inflate(R.layout.dialog_filter_media, null)
init {
val filterMedia = activity.config.filterMedia

View File

@ -1,18 +1,15 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import com.simplemobiletools.commons.activities.BaseSimpleActivity
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: BaseSimpleActivity, val callback: (result: Int) -> Unit) {
private var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_manage_extended_details, null)
private var view = activity.layoutInflater.inflate(R.layout.dialog_manage_extended_details, null)
init {
val details = activity.config.extendedDetails

View File

@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.support.v7.widget.GridLayoutManager
import android.view.LayoutInflater
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.extensions.beGoneIf
@ -23,7 +22,7 @@ import kotlinx.android.synthetic.main.dialog_directory_picker.view.*
class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: String, val callback: (path: String) -> Unit) {
var dialog: AlertDialog
var shownDirectories = ArrayList<Directory>()
var view = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null)
var view = activity.layoutInflater.inflate(R.layout.dialog_directory_picker, null)
var isGridViewType = activity.config.viewTypeFolders == VIEW_TYPE_GRID
init {
@ -84,9 +83,15 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
directories_horizontal_fastscroller.beVisibleIf(scrollHorizontally)
if (scrollHorizontally) {
directories_horizontal_fastscroller.setViews(directories_grid)
directories_horizontal_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
directories_horizontal_fastscroller.setViews(directories_grid) {
directories_horizontal_fastscroller.updateBubbleText(dirs[it].getBubbleText())
}
} else {
directories_vertical_fastscroller.setViews(directories_grid)
directories_vertical_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
directories_vertical_fastscroller.setViews(directories_grid) {
directories_vertical_fastscroller.updateBubbleText(dirs[it].getBubbleText())
}
}
}
}

View File

@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.support.v7.widget.GridLayoutManager
import android.view.LayoutInflater
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.beGoneIf
import com.simplemobiletools.commons.extensions.beVisibleIf
@ -19,7 +18,7 @@ import kotlinx.android.synthetic.main.dialog_medium_picker.view.*
class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val callback: (path: String) -> Unit) {
var dialog: AlertDialog
var shownMedia = ArrayList<Medium>()
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_medium_picker, null)
val view = activity.layoutInflater.inflate(R.layout.dialog_medium_picker, null)
var isGridViewType = activity.config.viewTypeFiles == VIEW_TYPE_GRID
init {
@ -74,9 +73,15 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
media_horizontal_fastscroller.beVisibleIf(scrollHorizontally)
if (scrollHorizontally) {
media_horizontal_fastscroller.setViews(media_grid)
media_horizontal_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
media_horizontal_fastscroller.setViews(media_grid) {
media_horizontal_fastscroller.updateBubbleText(media[it].getBubbleText())
}
} else {
media_vertical_fastscroller.setViews(media_grid)
media_vertical_fastscroller.allowBubbleDisplay = activity.config.showInfoBubble
media_vertical_fastscroller.setViews(media_grid) {
media_vertical_fastscroller.updateBubbleText(media[it].getBubbleText())
}
}
}
}

View File

@ -4,7 +4,6 @@ import android.graphics.Point
import android.support.v7.app.AlertDialog
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.WindowManager
import android.widget.EditText
import com.simplemobiletools.commons.activities.BaseSimpleActivity
@ -16,7 +15,7 @@ import kotlinx.android.synthetic.main.resize_image.view.*
class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callback: (newSize: Point) -> Unit) {
init {
val view = LayoutInflater.from(activity).inflate(R.layout.resize_image, null)
val view = activity.layoutInflater.inflate(R.layout.resize_image, null)
val widthView = view.image_width
val heightView = view.image_height

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.WindowManager
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
@ -15,7 +14,7 @@ class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appen
init {
var realPath = File(path).parent.trimEnd('/')
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_save_as, null).apply {
val view = activity.layoutInflater.inflate(R.layout.dialog_save_as, null).apply {
save_as_path.text = activity.humanizePath(realPath)
val fullName = path.getFilenameFromPath()

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.gallery.dialogs
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import com.simplemobiletools.commons.activities.BaseSimpleActivity
@ -17,7 +16,7 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit
val view: View
init {
view = LayoutInflater.from(activity).inflate(R.layout.dialog_slideshow, null).apply {
view = activity.layoutInflater.inflate(R.layout.dialog_slideshow, null).apply {
interval_value.setOnClickListener {
val text = interval_value.text
if (text.isNotEmpty()) {

View File

@ -70,7 +70,7 @@ fun Activity.launchCamera() {
fun SimpleActivity.launchAbout() {
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL
or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE, BuildConfig.VERSION_NAME)
or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW, BuildConfig.VERSION_NAME)
}
fun AppCompatActivity.showSystemUI() {

View File

@ -223,7 +223,7 @@ class PhotoFragment : ViewPagerFragment() {
}
private fun addZoomableView() {
if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone()) {
if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.isGone() && !medium.isDng()) {
val exif = android.media.ExifInterface(medium.path)
val orientation = exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL)

View File

@ -41,9 +41,10 @@ data class Directory(val path: String, val tmb: String, val name: String, var me
}
fun getBubbleText() = when {
sorting and SORT_BY_NAME != 0 -> name
sorting and SORT_BY_PATH != 0 -> path
sorting and SORT_BY_SIZE != 0 -> size.formatSize()
sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate()
sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate()
else -> name
else -> taken.formatDate()
}
}

View File

@ -18,12 +18,15 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo
fun isImage() = !isGif() && !video
fun isDng() = path.isDng()
fun getMimeType() = path.getMimeTypeFromPath()
override fun compareTo(other: Medium): Int {
var result: Int
when {
sorting and SORT_BY_NAME != 0 -> result = AlphanumericComparator().compare(name.toLowerCase(), other.name.toLowerCase())
sorting and SORT_BY_PATH != 0 -> result = AlphanumericComparator().compare(path.toLowerCase(), other.path.toLowerCase())
sorting and SORT_BY_SIZE != 0 -> result = when {
size == other.size -> 0
size > other.size -> 1
@ -48,9 +51,10 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo
}
fun getBubbleText() = when {
sorting and SORT_BY_NAME != 0 -> name
sorting and SORT_BY_PATH != 0 -> path
sorting and SORT_BY_SIZE != 0 -> size.formatSize()
sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate()
sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate()
else -> name
else -> taken.formatDate()
}
}

View File

@ -63,13 +63,7 @@
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"/>
<include layout="@layout/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</RelativeLayout>

View File

@ -63,13 +63,7 @@
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"/>
<include layout="@layout/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</RelativeLayout>

View File

@ -408,6 +408,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_info_bubble_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_info_bubble"
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_info_bubble"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_extended_details_holder"
android:layout_width="match_parent"

View File

@ -37,13 +37,7 @@
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"/>
<include layout="@layout/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</RelativeLayout>

View File

@ -36,13 +36,7 @@
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"/>
<include layout="@layout/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</RelativeLayout>

View File

@ -29,7 +29,8 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:singleLine="true"
android:textCursorDrawable="@null"/>
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/save_as_extension_label"
@ -43,6 +44,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:singleLine="true"
android:textCursorDrawable="@null"/>
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
</LinearLayout>

View File

@ -33,7 +33,8 @@
android:imeOptions="actionDone"
android:inputType="number"
android:maxLength="2"
android:textCursorDrawable="@null"/>
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
<RelativeLayout
android:id="@+id/include_photos_holder"

View File

@ -4,9 +4,9 @@
android:id="@+id/dir_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/small_margin"
android:clickable="true"
android:focusable="true"
android:paddingLeft="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
<com.simplemobiletools.gallery.views.MySquareImageView

View File

@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/gif_view"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -22,7 +22,8 @@
android:inputType="number"
android:maxLength="6"
android:maxLines="1"
android:textCursorDrawable="@null"/>
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/image_height_label"
@ -43,7 +44,8 @@
android:inputType="number"
android:maxLength="6"
android:maxLines="1"
android:textCursorDrawable="@null"/>
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/keep_aspect_ratio"

View File

@ -1,16 +0,0 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#F57C00"
android:pathData="M54.3,103.2L54.3,103.2c-27,0 -48.9,-21.9 -48.9,-48.9v0c0,-27 21.9,-48.9 48.9,-48.9h0c27,0 48.9,21.9 48.9,48.9v0C103.2,81.3 81.3,103.2 54.3,103.2z"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M65.8,37.5m-6.9,0a6.9,6.9 0,1 1,13.8 0a6.9,6.9 0,1 1,-13.8 0"/>
<path
android:fillColor="#FFFFFF"
android:pathData="M68.1,56.4l-7.1,10.1l-14.7,-21.2l-21,30.6l54.7,0z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -38,7 +38,7 @@
<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="exclude">Escludi</string>
<string name="excluded_folders">Cartelle escluse</string>
<string name="manage_excluded_folders">Gestisci cartelle escluse</string>
<string name="manage_excluded_folders">Gestisci le cartelle escluse</string>
<string name="exclude_folder_description">Questo escluderà la selezione e le relative sottocartelle solo da Simple Gallery. Puoi gestire le cartelle escluse nelle impostazioni.</string>
<string name="exclude_folder_parent">Vuoi invece escluderne una superiore?</string>
<string name="excluded_activity_placeholder">L\'esclusione delle cartelle e delle sottocartelle le renderà nascoste solo in Simple Gallery, saranno ancora visibili in altre applicazioni.\\n\\nSe desideri nasconderle anche nelle altre app, usa la funzione Nascondi.</string>
@ -47,7 +47,7 @@
<!-- Include folders -->
<string name="include_folders">Includi cartelle</string>
<string name="manage_included_folders">Gestisci cartelle incluse</string>
<string name="manage_included_folders">Gestisci le cartelle incluse</string>
<string name="add_folder">Aggiungi cartella</string>
<string name="included_activity_placeholder">Se hai alcune cartelle che contengono media, ma non sono state riconosciute dall\'app, puoi aggiungerle manualmente qui.</string>
@ -88,9 +88,9 @@
<string name="wallpaper_set_successfully">Sfondo impostato correttamente</string>
<string name="portrait_aspect_ratio">Proporzioni ritratto</string>
<string name="landscape_aspect_ratio">Proporzioni panorama</string>
<string name="home_screen">Home screen</string>
<string name="lock_screen">Lock screen</string>
<string name="home_and_lock_screen">Home and lock screen</string>
<string name="home_screen">Schermata principale</string>
<string name="lock_screen">Schermata di blocco</string>
<string name="home_and_lock_screen">Entrambe le schermate</string>
<!-- Slideshow -->
<string name="slideshow">Presentazione</string>
@ -111,19 +111,19 @@
<string name="list">Elenco</string>
<!-- Settings -->
<string name="show_hidden_media">Mostra cartelle nascoste</string>
<string name="autoplay_videos">Riproduci video automaticamente</string>
<string name="show_hidden_media">Mostra le cartelle nascoste</string>
<string name="autoplay_videos">Riproduci i video automaticamente</string>
<string name="toggle_filename">Visibilità nome del file</string>
<string name="loop_videos">Ripeti i video</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 la visualizzazione</string>
<string name="crop_thumbnails">Ritaglia le miniature in quadrati</string>
<string name="screen_rotation_by">Ruota schermo per</string>
<string name="screen_rotation_system_setting">Impostazione di sistema</string>
<string name="screen_rotation_device_rotation">Rotazione dispositivo</string>
<string name="screen_rotation_aspect_ratio">Proporzioni</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 le miniature orizzontalmente</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>

View File

@ -23,8 +23,8 @@
<string name="volume">Volume</string>
<string name="brightness">Brilho</string>
<string name="do_not_ask_again">Não perguntar novamente por enquanto</string>
<string name="lock_orientation">Lock orientation</string>
<string name="unlock_orientation">Unlock orientation</string>
<string name="lock_orientation">Travar orientação</string>
<string name="unlock_orientation">Destravar orientação</string>
<!-- Filter -->
<string name="filter_media">Filtrar mídia</string>
@ -41,7 +41,7 @@
<string name="manage_excluded_folders">Gerenciar pastas excluídas</string>
<string name="exclude_folder_description">Esta ação irá excluir as pastas selecionadas apenas dentro deste aplicativo. Você pode gerenciar as pastas excuídas nas Configurações do aplicativo.</string>
<string name="exclude_folder_parent">Excluir antes a pasta raíz?</string>
<string name="excluded_activity_placeholder">A exlusão de uma pasta apenas oculta o seu conteúdo da galeria, pois todos os outros aplicativos poderão acessá-las.\\n\\nSe quiser ocultar de todos os aplicativos, utilize a função ocultar.</string>
<string name="excluded_activity_placeholder">A exclusão de uma pasta apenas oculta o seu conteúdo da galeria, pois todos os outros aplicativos poderão acessá-las.\\n\\nSe quiser ocultar de todos os aplicativos, utilize a função ocultar.</string>
<string name="remove_all">Remover todas</string>
<string name="remove_all_description">Remover todas as pastas da lista de exclusões? Esta ação não apaga as pastas.</string>
@ -84,13 +84,13 @@
<string name="set_as_wallpaper_failed">Falha ao definir como papel de parede</string>
<string name="set_as_wallpaper_with">Definir papel de parede com:</string>
<string name="no_capable_app_found">Aplicativo não encontrado</string>
<string name="setting_wallpaper">Definindo como papel de parede;</string>
<string name="setting_wallpaper">Definindo como papel de parede</string>
<string name="wallpaper_set_successfully">Papel de parede com sucesso</string>
<string name="portrait_aspect_ratio">Retrato</string>
<string name="landscape_aspect_ratio">Paisagem</string>
<string name="home_screen">Home screen</string>
<string name="lock_screen">Lock screen</string>
<string name="home_and_lock_screen">Home and lock screen</string>
<string name="home_screen">Tela inicial</string>
<string name="lock_screen">Tela de bloqueio</string>
<string name="home_and_lock_screen">Tela inicial e de bloqueio</string>
<!-- Slideshow -->
<string name="slideshow">Slideshow</string>