diff --git a/CHANGELOG.md b/CHANGELOG.md index c63eabc11..77fb901d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)* ---------------------------- diff --git a/app/build.gradle b/app/build.gradle index d54939b3c..71bc9a97e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index aca94dfc4..05baef15e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -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) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 4f231fd42..c432843bb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -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) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index 4711f1c62..de41a30a8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -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) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt index 559d06452..9f149647c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -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}") } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 4bb90d013..6309dd18e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -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 { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 47b0f6e53..a551e96ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -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() } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index dbd4cd7de..25a95566a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -1,6 +1,5 @@ package com.simplemobiletools.gallery.adapters -import android.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, } 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, listener?.refreshItems() finishActMode() } - }).start() + }.start() } private fun shareMedia() { @@ -264,7 +263,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, if (isListViewType) { photo_name.setTextColor(textColor) - play_outline.setColorFilter(textColor, PorterDuff.Mode.SRC_IN) + play_outline.applyColorFilter(textColor) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt index 5ea179dad..d83d10237 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -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) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt index e676fe0ad..0721683e0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt index ce20eae97..b1f10323f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt index bbc70402a..812396346 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt index 937f98e07..cbaa30443 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -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() - 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()) + } } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt index ad579e02c..61264f169 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt @@ -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() - 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()) + } } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt index 7486849d6..33737957c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt index 8bd25c1ea..792ede406 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -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() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt index 5eda40879..2facd4654 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -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()) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index 08b204cce..ec99f9352 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -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() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 599b17d3a..a7297449b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -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) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index e545ff080..271f065ed 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -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() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index 638dc3f9b..1d113e4aa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -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() } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 828d2689b..a01449b1a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -63,13 +63,7 @@ android:layout_alignParentStart="true" android:paddingTop="@dimen/normal_margin"> - + diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index 6741e00fe..918e39428 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -63,13 +63,7 @@ android:layout_alignParentStart="true" android:paddingTop="@dimen/normal_margin"> - + diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 509679282..a204da6cb 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -408,6 +408,26 @@ + + + + + + - + diff --git a/app/src/main/res/layout/dialog_medium_picker.xml b/app/src/main/res/layout/dialog_medium_picker.xml index 01b630a1d..e854a7e60 100644 --- a/app/src/main/res/layout/dialog_medium_picker.xml +++ b/app/src/main/res/layout/dialog_medium_picker.xml @@ -36,13 +36,7 @@ android:layout_alignParentStart="true" android:paddingTop="@dimen/normal_margin"> - + diff --git a/app/src/main/res/layout/dialog_save_as.xml b/app/src/main/res/layout/dialog_save_as.xml index c40bd92ad..7fa48abe4 100644 --- a/app/src/main/res/layout/dialog_save_as.xml +++ b/app/src/main/res/layout/dialog_save_as.xml @@ -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"/> + android:textCursorDrawable="@null" + android:textSize="@dimen/normal_text_size"/> diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index dd17378d4..331b62ad4 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -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"/> - + android:textCursorDrawable="@null" + android:textSize="@dimen/normal_text_size"/> + android:textCursorDrawable="@null" + android:textSize="@dimen/normal_text_size"/> - - - - diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index a92b5df68..0b4c426d6 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 078605ea0..7ec4a7615 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 647664221..ba318920c 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index ad7d85e12..d2c8cf11f 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index ae49dd641..bd4c0b927 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -38,7 +38,7 @@ 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? Escludi Cartelle escluse - Gestisci cartelle escluse + Gestisci le cartelle escluse Questo escluderà la selezione e le relative sottocartelle solo da Simple Gallery. Puoi gestire le cartelle escluse nelle impostazioni. Vuoi invece escluderne una superiore? 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. @@ -47,7 +47,7 @@ Includi cartelle - Gestisci cartelle incluse + Gestisci le cartelle incluse Aggiungi cartella Se hai alcune cartelle che contengono media, ma non sono state riconosciute dall\'app, puoi aggiungerle manualmente qui. @@ -88,9 +88,9 @@ Sfondo impostato correttamente Proporzioni ritratto Proporzioni panorama - Home screen - Lock screen - Home and lock screen + Schermata principale + Schermata di blocco + Entrambe le schermate Presentazione @@ -111,19 +111,19 @@ Elenco - Mostra cartelle nascoste - Riproduci video automaticamente + Mostra le cartelle nascoste + Riproduci i video automaticamente Visibilità nome del file Ripeti i video Anima le GIF in miniatura - Luminosità max durante visualizzazione + Luminosità max durante la visualizzazione Ritaglia le miniature in quadrati Ruota schermo per Impostazione di sistema Rotazione dispositivo Proporzioni Sfondo scuro a schermo intero - Scorri miniature orizzontalmente + Scorri le miniature orizzontalmente Nascondi UI di sistema con media a schermo intero Elimina cartelle vuote dopo averne eliminato il contenuto Gestisci il volume e la luminosità dei video con gesti verticali diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index d63e956f6..c3eaaeaac 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -23,8 +23,8 @@ Volume Brilho Não perguntar novamente por enquanto - Lock orientation - Unlock orientation + Travar orientação + Destravar orientação Filtrar mídia @@ -41,7 +41,7 @@ Gerenciar pastas excluídas Esta ação irá excluir as pastas selecionadas apenas dentro deste aplicativo. Você pode gerenciar as pastas excuídas nas Configurações do aplicativo. Excluir antes a pasta raíz? - 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. + 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. Remover todas Remover todas as pastas da lista de exclusões? Esta ação não apaga as pastas. @@ -84,13 +84,13 @@ Falha ao definir como papel de parede Definir papel de parede com: Aplicativo não encontrado - Definindo como papel de parede; + Definindo como papel de parede Papel de parede com sucesso Retrato Paisagem - Home screen - Lock screen - Home and lock screen + Tela inicial + Tela de bloqueio + Tela inicial e de bloqueio Slideshow