From 39196be6d5adfd8ea94482e0c5a7221a9756b6af Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 19 Jun 2017 22:19:35 +0200 Subject: [PATCH 001/174] make sure the folder or image name doesnt stretch beyond the image --- app/src/main/res/layout/directory_item.xml | 11 ++++++++++- app/src/main/res/layout/photo_video_item.xml | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/directory_item.xml b/app/src/main/res/layout/directory_item.xml index 63642099d..27a363c9b 100644 --- a/app/src/main/res/layout/directory_item.xml +++ b/app/src/main/res/layout/directory_item.xml @@ -6,7 +6,14 @@ android:layout_height="wrap_content" android:padding="1px"> - + + + + + - + + + + + Date: Mon, 19 Jun 2017 23:41:57 +0200 Subject: [PATCH 002/174] make zooming disabled by default in the recyclerview --- .../gallery/activities/MainActivity.kt | 1 + .../gallery/activities/MediaActivity.kt | 1 + .../gallery/adapters/DirectoryAdapter.kt | 16 ++++++---------- .../gallery/adapters/MediaAdapter.kt | 16 ++++++---------- .../gallery/views/MyScalableRecyclerView.kt | 6 +++++- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 85d5bc3f6..5b2d10852 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -239,6 +239,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } + directories_grid.isZoomingEnabled = true layoutManager.spanCount = config.dirColumnCnt MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { override fun zoomIn() { 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 2d90e98c7..be48e9082 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -315,6 +315,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } + media_grid.isZoomingEnabled = true layoutManager.spanCount = config.mediaColumnCnt MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { override fun zoomIn() { 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 02abb93f7..d42de7466 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -39,7 +39,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList() val selectedPositions = HashSet() - var foregroundColor = 0 + var foregroundColor = config.primaryColor var pinnedFolders = config.pinnedFolders var scrollVertically = !config.scrollHorizontally @@ -97,10 +97,6 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList = selectedPositions } - init { - foregroundColor = config.primaryColor - } - val multiSelectorMode = object : ModalMultiSelectorCallback(multiSelector) { override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { when (item.itemId) { @@ -423,7 +419,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList (Unit)) : SwappingHolder(view, MultiSelector()) { fun bindView(directory: Directory, isPinned: Boolean, scrollVertically: Boolean): View { @@ -436,15 +432,15 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, var actMode: ActionMode? = null var itemViews = SparseArray() val selectedPositions = HashSet() - var foregroundColor = 0 + var foregroundColor = config.primaryColor var displayFilenames = config.displayFileNames var scrollVertically = !config.scrollHorizontally @@ -90,10 +90,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, override fun getSelectedPositions(): HashSet = selectedPositions } - init { - foregroundColor = config.primaryColor - } - val multiSelectorMode = object : ModalMultiSelectorCallback(multiSelector) { override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { when (item.itemId) { @@ -336,7 +332,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } } - class ViewHolder(val view: View, val adapter: 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 itemClick: (Medium) -> (Unit)) : SwappingHolder(view, MultiSelector()) { fun bindView(medium: Medium, displayFilenames: Boolean, scrollVertically: Boolean): View { itemView.apply { @@ -348,15 +344,15 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, setOnClickListener { viewClicked(medium) } setOnLongClickListener { viewLongClicked(); true } - adapter.setupItemForeground(this) + adapterListener.setupItemForeground(this) } return itemView } fun viewClicked(medium: Medium) { if (multiSelector.isSelectable) { - val isSelected = adapter.getSelectedPositions().contains(layoutPosition) - adapter.toggleItemSelectionAdapter(!isSelected, layoutPosition) + val isSelected = adapterListener.getSelectedPositions().contains(layoutPosition) + adapterListener.toggleItemSelectionAdapter(!isSelected, layoutPosition) } else { itemClick(medium) } @@ -366,7 +362,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, if (listener != null) { if (!multiSelector.isSelectable) { activity.startSupportActionMode(multiSelectorCallback) - adapter.toggleItemSelectionAdapter(true, layoutPosition) + adapterListener.toggleItemSelectionAdapter(true, layoutPosition) } listener.itemLongClicked(layoutPosition) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt index 3b1a6add8..aeab0cf4e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.gallery.R // drag selection is based on https://github.com/afollestad/drag-select-recyclerview class MyScalableRecyclerView : RecyclerView { private val AUTO_SCROLL_DELAY = 25L + var isZoomingEnabled = false private var mScaleDetector: ScaleGestureDetector @@ -149,7 +150,10 @@ class MyScalableRecyclerView : RecyclerView { } } } - return mScaleDetector.onTouchEvent(ev) + return if (isZoomingEnabled) + mScaleDetector.onTouchEvent(ev) + else + true } fun setDragSelectActive(initialSelection: Int) { From aed1d64e4342dcf5fb4ebf63eeaa57ec89abdea0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Jun 2017 20:51:30 +0200 Subject: [PATCH 003/174] make drag selection at recyclerview disabled by default --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 1 + .../simplemobiletools/gallery/views/MyScalableRecyclerView.kt | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 5b2d10852..609a3e6b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -239,6 +239,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } + directories_grid.isDragSelectionEnabled = true directories_grid.isZoomingEnabled = true layoutManager.spanCount = config.dirColumnCnt MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { 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 be48e9082..d7d586000 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -315,6 +315,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } + media_grid.isDragSelectionEnabled = true media_grid.isZoomingEnabled = true layoutManager.spanCount = config.mediaColumnCnt MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt index aeab0cf4e..b9a9c2a2e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt @@ -12,6 +12,7 @@ import com.simplemobiletools.gallery.R class MyScalableRecyclerView : RecyclerView { private val AUTO_SCROLL_DELAY = 25L var isZoomingEnabled = false + var isDragSelectionEnabled = false private var mScaleDetector: ScaleGestureDetector @@ -157,7 +158,7 @@ class MyScalableRecyclerView : RecyclerView { } fun setDragSelectActive(initialSelection: Int) { - if (dragSelectActive) + if (dragSelectActive || !isDragSelectionEnabled) return lastDraggedIndex = -1 From c6066bcdc4215e5329d44e9f59b3ede694ef60f4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Jun 2017 21:02:58 +0200 Subject: [PATCH 004/174] remove the static variables from MyScalableRecyclerView --- .../gallery/activities/MainActivity.kt | 4 +- .../gallery/activities/MediaActivity.kt | 4 +- .../gallery/views/MyScalableRecyclerView.kt | 63 +++++++++++++------ 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 609a3e6b1..b17df4932 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -134,7 +134,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mStoredAnimateGifs = config.animateGifs mStoredCropThumbnails = config.cropThumbnails mStoredScrollHorizontally = config.scrollHorizontally - MyScalableRecyclerView.mListener = null + directories_grid.listener = null mLastMediaHandler.removeCallbacksAndMessages(null) } @@ -242,7 +242,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { directories_grid.isDragSelectionEnabled = true directories_grid.isZoomingEnabled = true layoutManager.spanCount = config.dirColumnCnt - MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { + directories_grid.listener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { override fun zoomIn() { if (layoutManager.spanCount > 1) { reduceColumnCount() 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 d7d586000..39997fffb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -102,7 +102,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mStoredAnimateGifs = config.animateGifs mStoredCropThumbnails = config.cropThumbnails mStoredScrollHorizontally = config.scrollHorizontally - MyScalableRecyclerView.mListener = null + media_grid.listener = null mLastMediaHandler.removeCallbacksAndMessages(null) } @@ -318,7 +318,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { media_grid.isDragSelectionEnabled = true media_grid.isZoomingEnabled = true layoutManager.spanCount = config.mediaColumnCnt - MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { + media_grid.listener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener { override fun zoomIn() { if (layoutManager.spanCount > 1) { reduceColumnCount() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt index b9a9c2a2e..916c36195 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt @@ -13,6 +13,7 @@ class MyScalableRecyclerView : RecyclerView { private val AUTO_SCROLL_DELAY = 25L var isZoomingEnabled = false var isDragSelectionEnabled = false + var listener: MyScalableRecyclerViewListener? = null private var mScaleDetector: ScaleGestureDetector @@ -35,11 +36,8 @@ class MyScalableRecyclerView : RecyclerView { private var inTopHotspot = false private var inBottomHotspot = false - companion object { - var mListener: MyScalableRecyclerViewListener? = null - var mCurrScaleFactor = 1.0f - var mLastUp = 0L // allow only pinch zoom, not double tap - } + private var currScaleFactor = 1.0f + private var lastUp = 0L // allow only pinch zoom, not double tap constructor(context: Context) : super(context) @@ -47,7 +45,20 @@ class MyScalableRecyclerView : RecyclerView { init { hotspotHeight = context.resources.getDimensionPixelSize(R.dimen.dragselect_hotspot_height) - mScaleDetector = ScaleGestureDetector(context, GestureListener()) + + val gestureListener = object : MyGestureListenerInterface { + override fun getLastUp() = lastUp + + override fun getScaleFactor() = currScaleFactor + + override fun setScaleFactor(value: Float) { + currScaleFactor = value + } + + override fun getMainListener() = listener + } + + mScaleDetector = ScaleGestureDetector(context, GestureListener(gestureListener)) } override fun onMeasure(widthSpec: Int, heightSpec: Int) { @@ -83,8 +94,8 @@ class MyScalableRecyclerView : RecyclerView { inTopHotspot = false inBottomHotspot = false autoScrollHandler.removeCallbacks(autoScrollRunnable) - mCurrScaleFactor = 1.0f - mLastUp = System.currentTimeMillis() + currScaleFactor = 1.0f + lastUp = System.currentTimeMillis() return true } @@ -139,7 +150,7 @@ class MyScalableRecyclerView : RecyclerView { minReached = lastDraggedIndex } - mListener?.selectRange(initialSelection, lastDraggedIndex, minReached, maxReached) + listener?.selectRange(initialSelection, lastDraggedIndex, minReached, maxReached) if (initialSelection == lastDraggedIndex) { minReached = lastDraggedIndex @@ -166,7 +177,7 @@ class MyScalableRecyclerView : RecyclerView { maxReached = -1 this.initialSelection = initialSelection dragSelectActive = true - mListener?.selectItem(initialSelection) + listener?.selectItem(initialSelection) } private fun getItemPosition(e: MotionEvent): Int { @@ -181,21 +192,23 @@ class MyScalableRecyclerView : RecyclerView { } - class GestureListener : ScaleGestureDetector.SimpleOnScaleGestureListener() { + class GestureListener(val gestureListener: MyGestureListenerInterface) : ScaleGestureDetector.SimpleOnScaleGestureListener() { private val ZOOM_IN_THRESHOLD = -0.4f private val ZOOM_OUT_THRESHOLD = 0.15f override fun onScale(detector: ScaleGestureDetector): Boolean { - if (System.currentTimeMillis() - mLastUp < 1000) - return false + gestureListener.apply { + if (System.currentTimeMillis() - getLastUp() < 1000) + return false - val diff = mCurrScaleFactor - detector.scaleFactor - if (diff < ZOOM_IN_THRESHOLD && mCurrScaleFactor == 1.0f) { - mListener?.zoomIn() - mCurrScaleFactor = detector.scaleFactor - } else if (diff > ZOOM_OUT_THRESHOLD && mCurrScaleFactor == 1.0f) { - mListener?.zoomOut() - mCurrScaleFactor = detector.scaleFactor + val diff = getScaleFactor() - detector.scaleFactor + if (diff < ZOOM_IN_THRESHOLD && getScaleFactor() == 1.0f) { + getMainListener()?.zoomIn() + setScaleFactor(detector.scaleFactor) + } else if (diff > ZOOM_OUT_THRESHOLD && getScaleFactor() == 1.0f) { + getMainListener()?.zoomOut() + setScaleFactor(detector.scaleFactor) + } } return false } @@ -210,4 +223,14 @@ class MyScalableRecyclerView : RecyclerView { fun selectRange(initialSelection: Int, lastDraggedIndex: Int, minReached: Int, maxReached: Int) } + + interface MyGestureListenerInterface { + fun getLastUp(): Long + + fun getScaleFactor(): Float + + fun setScaleFactor(value: Float) + + fun getMainListener(): MyScalableRecyclerViewListener? + } } From e8168db2f70826c51606b3b454a5292851b0ffbb Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Jun 2017 21:22:42 +0200 Subject: [PATCH 005/174] use the MyScalableRecyclerView from the commons lib --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 2 +- .../gallery/activities/MediaActivity.kt | 2 +- .../gallery/views/MyScalableRecyclerView.kt | 236 ------------------ app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/layout/activity_media.xml | 2 +- app/src/main/res/values/dimens.xml | 2 - 7 files changed, 5 insertions(+), 243 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt diff --git a/app/build.gradle b/app/build.gradle index a1e12bdab..038fe1a71 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.4' + compile 'com.simplemobiletools:commons:2.21.7' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 b17df4932..26bf5b88f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -19,6 +19,7 @@ import android.widget.FrameLayout import com.google.gson.Gson import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.Release +import com.simplemobiletools.commons.views.MyScalableRecyclerView import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.adapters.DirectoryAdapter @@ -27,7 +28,6 @@ import com.simplemobiletools.gallery.dialogs.ChangeSortingDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Directory -import com.simplemobiletools.gallery.views.MyScalableRecyclerView import kotlinx.android.synthetic.main.activity_main.* import java.io.* import java.util.* 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 39997fffb..107dc2a39 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -21,6 +21,7 @@ import com.google.gson.Gson import com.google.gson.reflect.TypeToken import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.views.MyScalableRecyclerView import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.adapters.MediaAdapter import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask @@ -29,7 +30,6 @@ import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium -import com.simplemobiletools.gallery.views.MyScalableRecyclerView import kotlinx.android.synthetic.main.activity_media.* import java.io.File import java.io.IOException diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt deleted file mode 100644 index 916c36195..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyScalableRecyclerView.kt +++ /dev/null @@ -1,236 +0,0 @@ -package com.simplemobiletools.gallery.views - -import android.content.Context -import android.os.Handler -import android.support.v7.widget.RecyclerView -import android.util.AttributeSet -import android.view.MotionEvent -import android.view.ScaleGestureDetector -import com.simplemobiletools.gallery.R - -// drag selection is based on https://github.com/afollestad/drag-select-recyclerview -class MyScalableRecyclerView : RecyclerView { - private val AUTO_SCROLL_DELAY = 25L - var isZoomingEnabled = false - var isDragSelectionEnabled = false - var listener: MyScalableRecyclerViewListener? = null - - private var mScaleDetector: ScaleGestureDetector - - private var dragSelectActive = false - private var lastDraggedIndex = -1 - private var minReached = 0 - private var maxReached = 0 - private var initialSelection = 0 - - private var hotspotHeight = 0 - private var hotspotOffsetTop = 0 - private var hotspotOffsetBottom = 0 - - private var hotspotTopBoundStart = 0 - private var hotspotTopBoundEnd = 0 - private var hotspotBottomBoundStart = 0 - private var hotspotBottomBoundEnd = 0 - private var autoScrollVelocity = 0 - - private var inTopHotspot = false - private var inBottomHotspot = false - - private var currScaleFactor = 1.0f - private var lastUp = 0L // allow only pinch zoom, not double tap - - constructor(context: Context) : super(context) - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) - - init { - hotspotHeight = context.resources.getDimensionPixelSize(R.dimen.dragselect_hotspot_height) - - val gestureListener = object : MyGestureListenerInterface { - override fun getLastUp() = lastUp - - override fun getScaleFactor() = currScaleFactor - - override fun setScaleFactor(value: Float) { - currScaleFactor = value - } - - override fun getMainListener() = listener - } - - mScaleDetector = ScaleGestureDetector(context, GestureListener(gestureListener)) - } - - override fun onMeasure(widthSpec: Int, heightSpec: Int) { - super.onMeasure(widthSpec, heightSpec) - if (hotspotHeight > -1) { - hotspotTopBoundStart = hotspotOffsetTop - hotspotTopBoundEnd = hotspotOffsetTop + hotspotHeight - hotspotBottomBoundStart = measuredHeight - hotspotHeight - hotspotOffsetBottom - hotspotBottomBoundEnd = measuredHeight - hotspotOffsetBottom - } - } - - private var autoScrollHandler = Handler() - private val autoScrollRunnable = object : Runnable { - override fun run() { - if (inTopHotspot) { - scrollBy(0, -autoScrollVelocity) - autoScrollHandler.postDelayed(this, AUTO_SCROLL_DELAY) - } else if (inBottomHotspot) { - scrollBy(0, autoScrollVelocity) - autoScrollHandler.postDelayed(this, AUTO_SCROLL_DELAY) - } - } - } - - override fun dispatchTouchEvent(ev: MotionEvent): Boolean { - if (!dragSelectActive) - super.dispatchTouchEvent(ev) - - when (ev.action) { - MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { - dragSelectActive = false - inTopHotspot = false - inBottomHotspot = false - autoScrollHandler.removeCallbacks(autoScrollRunnable) - currScaleFactor = 1.0f - lastUp = System.currentTimeMillis() - return true - } - - MotionEvent.ACTION_MOVE -> { - if (dragSelectActive) { - val itemPosition = getItemPosition(ev) - if (hotspotHeight > -1) { - if (ev.y in hotspotTopBoundStart..hotspotTopBoundEnd) { - inBottomHotspot = false - if (!inTopHotspot) { - inTopHotspot = true - autoScrollHandler.removeCallbacks(autoScrollRunnable) - autoScrollHandler.postDelayed(autoScrollRunnable, AUTO_SCROLL_DELAY.toLong()) - } - - val simulatedFactor = (hotspotTopBoundEnd - hotspotTopBoundStart).toFloat() - val simulatedY = ev.y - hotspotTopBoundStart - autoScrollVelocity = (simulatedFactor - simulatedY).toInt() / 2 - } else if (ev.y in hotspotBottomBoundStart..hotspotBottomBoundEnd) { - inTopHotspot = false - if (!inBottomHotspot) { - inBottomHotspot = true - autoScrollHandler.removeCallbacks(autoScrollRunnable) - autoScrollHandler.postDelayed(autoScrollRunnable, AUTO_SCROLL_DELAY.toLong()) - } - - val simulatedY = ev.y + hotspotBottomBoundEnd - val simulatedFactor = (hotspotBottomBoundStart + hotspotBottomBoundEnd).toFloat() - autoScrollVelocity = (simulatedY - simulatedFactor).toInt() / 2 - } else if (inTopHotspot || inBottomHotspot) { - autoScrollHandler.removeCallbacks(autoScrollRunnable) - inTopHotspot = false - inBottomHotspot = false - } - } - - if (itemPosition != RecyclerView.NO_POSITION && lastDraggedIndex != itemPosition) { - lastDraggedIndex = itemPosition - if (minReached == -1) { - minReached = lastDraggedIndex - } - - if (maxReached == -1) { - maxReached = lastDraggedIndex - } - - if (lastDraggedIndex > maxReached) { - maxReached = lastDraggedIndex - } - - if (lastDraggedIndex < minReached) { - minReached = lastDraggedIndex - } - - listener?.selectRange(initialSelection, lastDraggedIndex, minReached, maxReached) - - if (initialSelection == lastDraggedIndex) { - minReached = lastDraggedIndex - maxReached = lastDraggedIndex - } - } - - return true - } - } - } - return if (isZoomingEnabled) - mScaleDetector.onTouchEvent(ev) - else - true - } - - fun setDragSelectActive(initialSelection: Int) { - if (dragSelectActive || !isDragSelectionEnabled) - return - - lastDraggedIndex = -1 - minReached = -1 - maxReached = -1 - this.initialSelection = initialSelection - dragSelectActive = true - listener?.selectItem(initialSelection) - } - - private fun getItemPosition(e: MotionEvent): Int { - val v = findChildViewUnder(e.x, e.y) ?: return RecyclerView.NO_POSITION - - if (v.tag == null || v.tag !is RecyclerView.ViewHolder) { - throw IllegalStateException("Make sure your adapter makes a call to super.onBindViewHolder(), and doesn't override itemView tags.") - } - - val holder = v.tag as RecyclerView.ViewHolder - return holder.adapterPosition - } - - - class GestureListener(val gestureListener: MyGestureListenerInterface) : ScaleGestureDetector.SimpleOnScaleGestureListener() { - private val ZOOM_IN_THRESHOLD = -0.4f - private val ZOOM_OUT_THRESHOLD = 0.15f - - override fun onScale(detector: ScaleGestureDetector): Boolean { - gestureListener.apply { - if (System.currentTimeMillis() - getLastUp() < 1000) - return false - - val diff = getScaleFactor() - detector.scaleFactor - if (diff < ZOOM_IN_THRESHOLD && getScaleFactor() == 1.0f) { - getMainListener()?.zoomIn() - setScaleFactor(detector.scaleFactor) - } else if (diff > ZOOM_OUT_THRESHOLD && getScaleFactor() == 1.0f) { - getMainListener()?.zoomOut() - setScaleFactor(detector.scaleFactor) - } - } - return false - } - } - - interface MyScalableRecyclerViewListener { - fun zoomOut() - - fun zoomIn() - - fun selectItem(position: Int) - - fun selectRange(initialSelection: Int, lastDraggedIndex: Int, minReached: Int, maxReached: Int) - } - - interface MyGestureListenerInterface { - fun getLastUp(): Long - - fun getScaleFactor(): Float - - fun setScaleFactor(value: Float) - - fun getMainListener(): MyScalableRecyclerViewListener? - } -} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6fdf71aac..c4f47cbb5 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -11,7 +11,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - 150dp 24dp 50dp - - 56dp From 09441f80c7d25912f37d6584503b5f952c5215d0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Jun 2017 22:41:27 +0200 Subject: [PATCH 006/174] couple adapter changes --- .../simplemobiletools/gallery/activities/MainActivity.kt | 8 +++----- .../simplemobiletools/gallery/activities/MediaActivity.kt | 8 +++----- .../gallery/adapters/DirectoryAdapter.kt | 3 +-- .../simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 +-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 26bf5b88f..c147ff035 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -387,15 +387,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun setupAdapter() { - val adapter = DirectoryAdapter(this, mDirs, this) { - itemClicked(it.path) - } - val currAdapter = directories_grid.adapter if (currAdapter != null) { (currAdapter as DirectoryAdapter).updateDirs(mDirs) } else { - directories_grid.adapter = adapter + directories_grid.adapter = DirectoryAdapter(this, mDirs, this) { + itemClicked(it.path) + } } directories_fastscroller.setViews(directories_grid, directories_refresh_layout) } 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 107dc2a39..363104c0a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -136,15 +136,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (isDirEmpty()) return - val adapter = MediaAdapter(this, mMedia, this) { - itemClicked(it.path) - } - val currAdapter = media_grid.adapter if (currAdapter != null) { (currAdapter as MediaAdapter).updateMedia(mMedia) } else { - media_grid.adapter = adapter + media_grid.adapter = MediaAdapter(this, mMedia, this) { + itemClicked(it.path) + } } media_fastscroller.setViews(media_grid, media_refresh_layout) } 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 d42de7466..e0dec09e6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -58,7 +58,6 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, } updateTitle(selectedPositions.size) - actMode?.invalidate() } fun getProperView(itemView: View): View { @@ -63,6 +62,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, fun updateTitle(cnt: Int) { actMode?.title = "$cnt / ${media.size}" + actMode?.invalidate() } fun updatePrimaryColor(color: Int) { @@ -214,7 +214,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, notifyItemChanged(i) } updateTitle(cnt) - actMode?.invalidate() } private fun askConfirmDelete() { From a8a3e69c301fff2afac7fe758b8d9630799d86c8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Jun 2017 22:27:49 +0200 Subject: [PATCH 007/174] reuse the "Temporarily show hidden" string from Commons lib --- app/build.gradle | 2 +- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-hu/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-pt/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sk/strings.xml | 1 - app/src/main/res/values-sv/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values-zh-rTW/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 18 files changed, 1 insertion(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 038fe1a71..78bb0a6d9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.7' + compile 'com.simplemobiletools:commons:2.21.11' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index eab90b817..ec039e83d 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -19,7 +19,6 @@ Nebyla nalezena žádná fotografická aplikace Zvýšit počet sloupců Snížit počet sloupců - Dočasně zobrazit skryté Change cover image Select photo Use default diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 949a72095..dd02140ba 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -19,7 +19,6 @@ Keine Kamera-App gefunden Kacheln verkleinern Kacheln vergrößern - Verstecktes temporär zeigen Change cover image Bild auswählen Standard verwenden diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index b5694df3c..7e975295a 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -19,7 +19,6 @@ No se encontró aplicación de cámara Aumentar el número de columnas Reducir el número de columnas - Mostrar ocultos temporalmente Change cover image Select photo Use default diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 4f32096b2..44361744b 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -19,7 +19,6 @@ Aucune application d\appareil photo n\'a été trouvée Augmenter le nombre de colonnes Réduire le nombre de colonnes - Afficher temporairement les fichiers masqués Change cover image Select photo Use default diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index d0120b7d9..dff8c8b36 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -19,7 +19,6 @@ No Camera app has been found Increase column count Reduce column count - Temporarily show hidden Change cover image Select photo Use default diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index fa274c077..1c8125896 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -19,7 +19,6 @@ Nessuna app fotocamera trovata Aumenta numero colonne Riduci numero colonne - Mostra temporaneamente nascosti Change cover image Select photo Use default diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 67eed51b2..06b759b65 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -19,7 +19,6 @@ No Camera app has been found Increase column count Reduce column count - Temporarily show hidden Change cover image Select photo Use default diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index b8fafa6ff..14bda192a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -19,7 +19,6 @@ Brak aplikacji powiązanej z aparatem Zwiększ liczbę kolumn Zmniejsz liczbę kolumn - Temporarily show hidden Change cover image Select photo Use default diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 9c09d69f6..1cfe4039b 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -19,7 +19,6 @@ Nenhum aplicativo de câmera encontrado Aumentar número de colunas Reduzir número de colunas - Mostrar pastas ocultas temporariamente Trocar imagem de capa Selecionar foto Usar padrão diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 07d1e99fa..bf5b7b33d 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -19,7 +19,6 @@ Não existe uma aplicação adequeada Aumentar número de colunas Diminuir número de colunas - Mostrar ocultas temporariamente Alterar imagem da capa Selecionar foto Predefinição diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index fd09fae47..e24108ea9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -19,7 +19,6 @@ Не найдено приложения камеры Добавить 1 столбец Убрать 1 столбец - Временный показ скрытых Change cover image Select photo Use default diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 68beaf6cc..6d76a46f9 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -19,7 +19,6 @@ Nenašla sa žiadna aplikácia pre fotoaparát Zvýšiť počet stĺpcov Znížiť počet stĺpcov - Dočasne zobraziť skryté Zmeniť obal albumu Zvoliť foto Použiť predvolený diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 7e3133464..08e347ca3 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -19,7 +19,6 @@ No Camera app has been found Increase column count Reduce column count - Temporarily show hidden Change cover image Select photo Use default diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 80f72abb2..42ca6a048 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -19,7 +19,6 @@ Hiçbir Kamera uygulaması bulunamadı Sütun sayısını artır Sütun sayısını azalt - Geçici olarak gizli göster Change cover image Select photo Use default diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 3e3b6d11e..0b4cabf1f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -19,7 +19,6 @@ 未找到相机应用 增加一栏 减少一栏 - 显示/隐藏缓存内容 更改封面图片 选择图片 使用默认 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index fdd1155a7..30c6067b9 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -19,7 +19,6 @@ No Camera app has been found Increase column count Reduce column count - Temporarily show hidden Change cover image Select photo Use default diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 26b9fc2f8..c761bd1ea 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,7 +19,6 @@ No Camera app has been found Increase column count Reduce column count - Temporarily show hidden Change cover image Select photo Use default From 7bad8bc54f966227269d849b72458154d2c71414 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Jun 2017 23:54:15 +0200 Subject: [PATCH 008/174] adding a round launcher icon --- app/src/main/AndroidManifest.xml | 1 + .../main/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 2607 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 3272 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 5861 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 6793 bytes 5 files changed, 1 insertion(+) create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8c640a923..fb8ba91aa 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_launcher_name" + android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..a92b5df689d8e49deec5e7f0b397563c5096c2f5 GIT binary patch literal 2607 zcmV+~3efe5P)b!rrmr5Kej-}{`G-#NcqIL~>`lS5>*48OG=Z%)PBi5OGvxJ(c$<1CsFpwMGg z&g6OiXT7~{Ys>MD)>*&(@a$;#Ibs57-Q1#1L!}sZ8HO5BnP;Kg2n9eyQ8U0F1yNLE zh;#t|0p3;R4I}oo?w+=$lDZ?O1vJ-w=Ukx9`l=cgxm|=>kXe8etVgxLQBe-~_|FwK z96BJ+pEB61>-?wVcP9m`v-#@r2hB}k6G2vt!&P;^f;*8Q~9eb5@Vg-{*WN2f)* zyGn0HoGq$42N4ry|0ygh$Wc^xcekDS!-QRjPlwfWXaaTYtX^Q0-3rTLq=XraD$roW zZp`1*v_Fg<0}FJluA-ncQhpz>Rgp*tJ_SZltFR~5)4OeaUGu46eFdPazH+*i$YTPv zBR8DVMHSVzt?#cb+Sc5dZ7*31)V^b0l@aGfU`FmH;V{q>*0*blwq`fvvijEBx6i-P zh`S$T=GYboKqeW-ywtU$`a9V?ov}de+vneC9P>0#o{hoLK?)W2wC||;UdB&m()jF- zc~!o+`#Gn?8Gvf1fz|n28uz99NZJB*)mKhe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xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000000000000000000000000000000000..64766422115a2d87fd11089f24546aba4ab529a9 GIT binary patch literal 5861 zcmVb^P)Acmx&DKrjEX-FDc+VoHw zD0MMQnTBARG;O-1TaspJdwP1{w4^EJG);S;;Q%K+K(Mi5W6Z&Ejd6naMccf0fBj?3 z?vZABvq|ss=jh)1ewz24yZr9&{w~DC#KgqJ#KgqJ#Kgo@4ym>QwL%)q#x&mf$L3mE zTkT;+j0`!MIu#f;dT`KcN9shl`%o&Je_(eY4-r<|=2~FV2}sj;BqwAAns)B~4ISTgu0T5Rh)f9`Eh#PWbjxhpZG>DnhS9BZ#T8bt*6l zyrQrb^ci*T@l@*QfZVoksJgb5PF)K~H)2oqFJ5o0`G`|i3v?ke1+dk&?aZj6G6cF0 z*zS~XHwD4Nk{&o&ZOe+K?gXSa;h&njc#$!(9wXO-te|EEGajladw>T;gGWvTJU^q( z#8fu|(wp!z-AnpH)eku3IuTh2(ok)?B0<#wuR7I-5qWel6FgZjLaGY^X?j7&pr5?W zAXh8QM`!@43)>4M0QTebiO}&tv)j5u(zt3HH5N7d5)@?Qf!>}#&9w&eX`pk0isp{#DMIKM|ol`{`sC&l{)$2m}s3Z%5rX8hBw(EzFOq>}1PwJiU04-<-Hl)&6N# zJR-4p-cI)WP{bGHx7D{_9`XAwueMcC13l2_{r$@Wk-tP)GJ#iDQ4^xNSJd5;4BSIf z#R+!RUe=LxS6hSM`f-FifZ3QwojAF|p1y{*qza;aa@ zmp5{MUw@$Xelc~6f-1^hG`zL(?(N?$=Wtfmmw6)HKf`$Pw_@Z2#63@iQAOE>1~;Vc9{AsK zJ*8|z*pYNsn@z|)*$Hzjp2{PFut1Erg@!l+t}OhA5%f0c^)XdIGJ%ZO2Qji>hJ$Xbk|k<($Q{~OPH z>Va%@qjkD55o~+7)TqXid!R$<`7O>QH^t(q7qZcfp~!8ciNz%^?Mo7nf;1;m8$do>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*^eP8v^^xf%}_y!P*4 zI5mI-R?qkPK`zx+)t*1gZDz!Bc^vXXWv&7HaitLpx$~?&cvWgc-wOqfKw88I?ku(@ ztRv0|cVmhfHC_?xd;s{->g_8(+eFJ~SKKAW3l0}%H%<%i7&F&a_c;0JD4x13&=$(- za*s2RQ))AbQW6#y93;-&W_Jft()OsRF_C#@7H^Vbg>bruwMIkz6 znix~XbU?zjz3i0z(}}JQ-mLt`9qn3D?B+E6#$~c|##h~>Zrck@9o2(rv7h8}KBv-) zM^--KkK)OEgw{FD=l|HY;ya2pS?!^pohn=qnQOsY{Q$@K{IdhKNj3m*Rhzqf&TWBq z28OLtLDZ-LzMkZYN6>eZ*iM%7rzwCBel&G>5h)mi=TIZKSz@kmnwHbbojX6z58edo z=s*EL0AH!3E`+wg9r8(Im5wAKi41h4fv`8=@B7Ln%f2vvsvqF%!DN+NL7xdwloIz! zfZc!)2Q_!Q%@o9#_7HJo$}tJgDBi*ZQp_?s4s;$Pp2wIRu?CIi)--S5O1GxlK7KjE z)`OSge(<5rla~IkEY751OikIR=>9_M(;taM!(Gg|A5NYH;U{h!qS63GF^WDy<~_&`53Cie z1FpkXC!k7tg>)luVmQrXnuq<)E^c__Wb gm;b*s2H%9T@g?pL{S7OA{6+#)6*Uy9<>2A}10^WA4*&oF literal 0 HcmV?d00001 From e284c5b8b950e2c0495ecdd6817261ab209d4f41 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 22 Jun 2017 22:51:42 +0200 Subject: [PATCH 009/174] take the Out of memory error from Commons library --- app/build.gradle | 2 +- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-hu/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-pt/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sk/strings.xml | 1 - app/src/main/res/values-sv/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values-zh-rTW/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 18 files changed, 1 insertion(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 78bb0a6d9..48113ea23 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.11' + compile 'com.simplemobiletools:commons:2.21.12' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index ec039e83d..60557d4bc 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -66,7 +66,6 @@ Překlopit Překlopit vodorovně Překlopit svisle - Zařízení nemá dostatek paměti Edit with diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index dd02140ba..5da6876c0 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -66,7 +66,6 @@ Spiegeln Horizontal spiegeln Vertikal spiegeln - Fehler: Zuwenig Speicher Edit with diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7e975295a..ecf170589 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -66,7 +66,6 @@ Girar Horizontalmente Verticalmente - Error: sin memoria Edit with diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 44361744b..615dc40d2 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -66,7 +66,6 @@ Retourner Retourner horizontalement Retourner verticallement - Erreur excès de mémoire Edit with diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index dff8c8b36..64bf3f633 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -66,7 +66,6 @@ Flip Flip horizontally Flip vertically - Out of memory error Edit with diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1c8125896..1c1c8592e 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -66,7 +66,6 @@ Capovolgi Capovolgi orizzontalmente Capovolgi verticalmente - Errore memoria esaurita Edit with diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 06b759b65..cecc3a74f 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -66,7 +66,6 @@ Flip Flip horizontally Flip vertically - Out of memory error Edit with diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 14bda192a..61ae09d3b 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -66,7 +66,6 @@ Flip Flip poziomo Flip pionowo - Błąd pamięci Edit with diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 1cfe4039b..976d597d3 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -66,7 +66,6 @@ Inverter Horizontalmente Verticalmente - Memória insuficiente Edit with diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index bf5b7b33d..d8d8ed3a7 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -66,7 +66,6 @@ Inverter Horizontalmente Verticalmente - Memória insuficiente Edit with diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index e24108ea9..f4bac5fd6 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -66,7 +66,6 @@ Отразить По горизонтали По вертикали - Память переполнена Edit with diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 6d76a46f9..99bb62e8d 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -66,7 +66,6 @@ Preklopiť Preklopiť vodorovne Preklopiť zvisle - Došlo k chybe s nedostatkom pamäte Upraviť s diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 08e347ca3..4c5bcd086 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -66,7 +66,6 @@ Flip Flip horizontally Flip vertically - Out of memory error Edit with diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 42ca6a048..fe9515775 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -66,7 +66,6 @@ Çevir Yatay Dikey - Yetersiz bellek hatası Edit with diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0b4cabf1f..77cb78b98 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -66,7 +66,6 @@ 翻转 水平翻转 垂直翻转 - 内存不足 编辑方式 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 30c6067b9..6728df826 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -66,7 +66,6 @@ Flip Flip horizontally Flip vertically - Out of memory error Edit with diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c761bd1ea..0e77bee76 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -66,7 +66,6 @@ Flip Flip horizontally Flip vertically - Out of memory error Edit with From 418c313d2d31e2b69ac214ac1fcadc7edfeeb7b7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 23 Jun 2017 17:39:07 +0200 Subject: [PATCH 010/174] updating some german strings --- app/src/main/res/values-de/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 5da6876c0..5ad2a6fa7 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -19,9 +19,9 @@ Keine Kamera-App gefunden Kacheln verkleinern Kacheln vergrößern - Change cover image - Bild auswählen - Standard verwenden + Cover-Bild ändern + Auswählen + Standard Festlegen als From e87cc4a86ded9f06fe65a3941d2a822cc1553ee4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 18:56:38 +0200 Subject: [PATCH 011/174] add an extra check at initializing video media player at menu visibility change --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index f9b3a604c..93a050fe0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -95,8 +95,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee super.setMenuVisibility(menuVisible) mIsFragmentVisible = menuVisible if (menuVisible) { - if (mSurfaceView != null) + if (mSurfaceView != null && mSurfaceHolder!!.surface.isValid) { initMediaPlayer() + } if (context?.config?.autoplayVideos == true) { playVideo() From 71249d0a1ef1f0d8db49c430cd02980d933fb114 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 19:04:00 +0200 Subject: [PATCH 012/174] fill the viewpager at the viewpager activity only when its ready --- .../gallery/activities/ViewPagerActivity.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 7ac0c413a..315bc8c41 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -18,10 +18,7 @@ import android.os.Bundle import android.provider.MediaStore import android.support.v4.view.ViewPager import android.util.DisplayMetrics -import android.view.Menu -import android.view.MenuItem -import android.view.OrientationEventListener -import android.view.View +import android.view.* import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog @@ -100,9 +97,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mDirectory = File(mPath).parent title = mPath.getFilenameFromPath() - if (mMedia.isNotEmpty()) { - gotMedia(mMedia) - } + view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + override fun onGlobalLayout() { + view_pager.viewTreeObserver.removeOnGlobalLayoutListener(this) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && isDestroyed) + return + + if (mMedia.isNotEmpty()) { + gotMedia(mMedia) + } + } + }) reloadViewPager() scanPath(mPath) {} From 1afb2939773c4e8ea8e2b9f0f7de80e8288dfd77 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 19:08:46 +0200 Subject: [PATCH 013/174] update commons to 2.21.13 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 48113ea23..a86317474 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.12' + compile 'com.simplemobiletools:commons:2.21.13' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From 5604d1f8b5405f70e4d48dfc665911e7ed38aa2a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 21:42:53 +0200 Subject: [PATCH 014/174] adding support for horizontal scrolling --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 16 ++++++++-- .../gallery/activities/MediaActivity.kt | 16 ++++++++-- app/src/main/res/layout/activity_main.xml | 32 +++++++++++++++++-- app/src/main/res/layout/activity_media.xml | 32 +++++++++++++++++-- app/src/main/res/layout/activity_settings.xml | 3 +- 6 files changed, 90 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a86317474..df49a870f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.13' + compile 'com.simplemobiletools:commons:2.21.14' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 c147ff035..7b01d358a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -213,7 +213,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun checkIfColorChanged() { if (directories_grid.adapter != null && getRecyclerAdapter().foregroundColor != config.primaryColor) { getRecyclerAdapter().updatePrimaryColor(config.primaryColor) - directories_fastscroller.updateHandleColor() + directories_vertical_fastscroller.updateHandleColor() + directories_horizontal_fastscroller.updateHandleColor() } } @@ -395,7 +396,18 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { itemClicked(it.path) } } - directories_fastscroller.setViews(directories_grid, directories_refresh_layout) + + directories_vertical_fastscroller.isHorizontal = false + directories_vertical_fastscroller.beGoneIf(config.scrollHorizontally) + + directories_horizontal_fastscroller.isHorizontal = true + directories_horizontal_fastscroller.beVisibleIf(config.scrollHorizontally) + + if (config.scrollHorizontally) { + directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) + } else { + directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) + } } private fun checkLastMediaChanged() { 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 363104c0a..7fa039bbf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -128,7 +128,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun checkIfColorChanged() { if (media_grid.adapter != null && getRecyclerAdapter().foregroundColor != config.primaryColor) { getRecyclerAdapter().updatePrimaryColor(config.primaryColor) - media_fastscroller.updateHandleColor() + media_horizontal_fastscroller.updateHandleColor() + media_vertical_fastscroller.updateHandleColor() } } @@ -144,7 +145,18 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { itemClicked(it.path) } } - media_fastscroller.setViews(media_grid, media_refresh_layout) + + media_vertical_fastscroller.isHorizontal = false + media_vertical_fastscroller.beGoneIf(config.scrollHorizontally) + + media_horizontal_fastscroller.isHorizontal = true + media_horizontal_fastscroller.beVisibleIf(config.scrollHorizontally) + + if (config.scrollHorizontally) { + media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) + } else { + media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) + } } private fun checkLastMediaChanged() { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index c4f47cbb5..19fd7e7bd 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -20,13 +20,41 @@ app:spanCount="@integer/directory_columns_vertical_scroll"/> + android:paddingStart="@dimen/normal_margin"> + + + + + + + + + diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index 50818e430..ce7f66a4c 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -20,13 +20,41 @@ app:spanCount="@integer/media_columns_vertical_scroll"/> + android:paddingStart="@dimen/normal_margin"> + + + + + + + + + diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 078bfe2ca..94881326b 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -214,8 +214,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/medium_margin" android:background="?attr/selectableItemBackground" - android:padding="@dimen/activity_margin" - android:visibility="gone"> + android:padding="@dimen/activity_margin"> Date: Sat, 24 Jun 2017 22:07:47 +0200 Subject: [PATCH 015/174] handle horizontal scrolling at copy/move destination picker too --- .../gallery/dialogs/ChangeSortingDialog.kt | 2 +- .../gallery/dialogs/PickDirectoryDialog.kt | 32 +++++++++-- .../res/layout/dialog_directory_picker.xml | 56 +++++++++++++++++-- 3 files changed, 78 insertions(+), 12 deletions(-) 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 f6516ee9b..53db0c197 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -17,7 +17,7 @@ class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting: val path: String = "", val callback: () -> Unit) : DialogInterface.OnClickListener { private var currSorting = 0 - private var config: Config = activity.config + private var config = activity.config private var view: View init { 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 cf384829e..7b3c93971 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -1,9 +1,12 @@ package com.simplemobiletools.gallery.dialogs 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.View import com.simplemobiletools.commons.dialogs.FilePickerDialog +import com.simplemobiletools.commons.extensions.beGoneIf +import com.simplemobiletools.commons.extensions.beVisibleIf import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.gallery.R @@ -17,12 +20,15 @@ import kotlinx.android.synthetic.main.dialog_directory_picker.view.* class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, val callback: (path: String) -> Unit) { var dialog: AlertDialog - var directoriesGrid: RecyclerView var shownDirectories: ArrayList = ArrayList() + var view: View init { - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null) - directoriesGrid = view.directories_grid + view = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null) + (view.directories_grid.layoutManager as GridLayoutManager).apply { + orientation = if (activity.config.scrollHorizontally) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL + spanCount = activity.config.dirColumnCnt + } dialog = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok, null) @@ -63,6 +69,22 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, dialog.dismiss() } } - directoriesGrid.adapter = adapter + + val scrollHorizontally = activity.config.scrollHorizontally + view.apply { + directories_grid.adapter = adapter + + directories_vertical_fastscroller.isHorizontal = false + directories_vertical_fastscroller.beGoneIf(scrollHorizontally) + + directories_horizontal_fastscroller.isHorizontal = true + directories_horizontal_fastscroller.beVisibleIf(scrollHorizontally) + + if (scrollHorizontally) { + directories_horizontal_fastscroller.setViews(directories_grid) + } else { + directories_vertical_fastscroller.setViews(directories_grid) + } + } } } diff --git a/app/src/main/res/layout/dialog_directory_picker.xml b/app/src/main/res/layout/dialog_directory_picker.xml index ca361da90..821138213 100644 --- a/app/src/main/res/layout/dialog_directory_picker.xml +++ b/app/src/main/res/layout/dialog_directory_picker.xml @@ -1,10 +1,54 @@ - + android:layout_height="wrap_content"> + + + + + + + + + + + + + + + From 52c636f1762afb67accf29700c0c24c7e2ccb2f2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 22:57:20 +0200 Subject: [PATCH 016/174] recheck scroll direction on resume --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ++++ .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 4 ++++ .../simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 7b01d358a..2daac0178 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -119,6 +119,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { if (mStoredScrollHorizontally != config.scrollHorizontally) { (directories_grid.adapter as DirectoryAdapter).scrollVertically = !config.scrollHorizontally directories_grid.adapter.notifyDataSetChanged() + setupScrollDirection() } tryloadGallery() @@ -396,7 +397,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { itemClicked(it.path) } } + setupScrollDirection() + } + private fun setupScrollDirection() { directories_vertical_fastscroller.isHorizontal = false directories_vertical_fastscroller.beGoneIf(config.scrollHorizontally) 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 7fa039bbf..a88097494 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -89,6 +89,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (mStoredScrollHorizontally != config.scrollHorizontally) { (media_grid.adapter as MediaAdapter).scrollVertically = !config.scrollHorizontally media_grid.adapter.notifyDataSetChanged() + setupScrollDirection() } tryloadGallery() @@ -145,7 +146,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { itemClicked(it.path) } } + setupScrollDirection() + } + private fun setupScrollDirection() { media_vertical_fastscroller.isHorizontal = false media_vertical_fastscroller.beGoneIf(config.scrollHorizontally) 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 53db0c197..8d334b11d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -10,7 +10,6 @@ import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.helpers.Config import kotlinx.android.synthetic.main.dialog_change_sorting.view.* class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting: Boolean, showFolderCheckbox: Boolean, From 2658c528090492f066f120650b9936ba9ca8a631 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 23:05:53 +0200 Subject: [PATCH 017/174] add some top margin to the destination picker --- app/src/main/res/layout/dialog_directory_picker.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/dialog_directory_picker.xml b/app/src/main/res/layout/dialog_directory_picker.xml index 821138213..57c9fb4e8 100644 --- a/app/src/main/res/layout/dialog_directory_picker.xml +++ b/app/src/main/res/layout/dialog_directory_picker.xml @@ -10,6 +10,7 @@ android:id="@+id/directories_grid" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/activity_margin" android:scrollbars="none" app:layoutManager="android.support.v7.widget.GridLayoutManager" app:spanCount="@integer/directory_columns_vertical_scroll"/> From e045adce899689f851571abb30164c7488ac238b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 23:12:57 +0200 Subject: [PATCH 018/174] disable proguard for a build --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index df49a870f..ba0ab381f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { buildTypes { release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } From b8a4c2a1b05a355ea8422310b54d115f2ff7e924 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 23:15:55 +0200 Subject: [PATCH 019/174] adding horizontal scrolling to release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 2daac0178..ed1636299 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -470,6 +470,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(97, R.string.release_97)) add(Release(98, R.string.release_98)) add(Release(108, R.string.release_108)) + add(Release(112, R.string.release_112)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index d1487c62f..6e021e8e9 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Added an option for enabling horizontal scrolling Allow setting custom folder covers Allow selecting multiple items by finger dragging\n From a0011dcf5dca557586cd591a130be36d44231500 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 23:16:02 +0200 Subject: [PATCH 020/174] update version to 2.11.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ba0ab381f..64f2420c8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 111 - versionName "2.11.1" + versionCode 112 + versionName "2.11.2" } signingConfigs { From c9054419111f2549857d14706191a907c21c3ea5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 23:16:14 +0200 Subject: [PATCH 021/174] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 442f658f0..df01d25ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 2.11.2 *(2017-06-24)* +---------------------------- + + * Added optional horizontal scrolling + Version 2.11.1 *(2017-06-19)* ---------------------------- From a0ec489a9ac63b313b6789c8f05066bb61237595 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Jun 2017 23:19:49 +0200 Subject: [PATCH 022/174] update version to 2.11.3 --- CHANGELOG.md | 2 +- app/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df01d25ff..d586a3f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Changelog ========== -Version 2.11.2 *(2017-06-24)* +Version 2.11.3 *(2017-06-24)* ---------------------------- * Added optional horizontal scrolling diff --git a/app/build.gradle b/app/build.gradle index 64f2420c8..061ebca90 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 112 - versionName "2.11.2" + versionCode 113 + versionName "2.11.3" } signingConfigs { From d6d99e6b4bbccdb6f937c1e766a1fa409252ee9b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Jun 2017 16:09:54 +0200 Subject: [PATCH 023/174] reactivate proguard --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 061ebca90..a1d8d4275 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } From 43768ea728eee936454b5d8dc057c9d9432ef392 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Jun 2017 23:58:59 +0200 Subject: [PATCH 024/174] update commons to 2.21.15 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index a1d8d4275..876d2d9c0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.14' + compile 'com.simplemobiletools:commons:2.21.15' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From 6b72e098b099d5d0d25bb3079afab22cee213e9a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 22:01:17 +0200 Subject: [PATCH 025/174] update kotlin to 1.1.3 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 876d2d9c0..ecd8661d0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ dependencies { } buildscript { - ext.kotlin_version = '1.1.2-5' + ext.kotlin_version = '1.1.3' repositories { mavenCentral() } From f14d34a3e4a783b87290bc1d96abe852b58dad88 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 22:27:35 +0200 Subject: [PATCH 026/174] make adapters at changing column counts nullable --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ++-- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index ed1636299..0b0134d3c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -272,13 +272,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun increaseColumnCount() { config.dirColumnCnt = ++(directories_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.notifyDataSetChanged() } private fun reduceColumnCount() { config.dirColumnCnt = --(directories_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.notifyDataSetChanged() } private fun isPickImageIntent(intent: Intent) = isPickIntent(intent) && (hasImageContentData(intent) || isImageType(intent)) 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 a88097494..ef9344764 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -360,13 +360,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun increaseColumnCount() { config.mediaColumnCnt = ++(media_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.notifyDataSetChanged() } private fun reduceColumnCount() { config.mediaColumnCnt = --(media_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.notifyDataSetChanged() } private fun isSetWallpaperIntent() = intent.getBooleanExtra(SET_WALLPAPER_INTENT, false) From 19a2aa71bfee80970f63841bcb10183022ef5ea1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 22:30:36 +0200 Subject: [PATCH 027/174] make adapters nullable at resume too --- .../gallery/activities/MainActivity.kt | 10 ++++++---- .../gallery/activities/MediaActivity.kt | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 0b0134d3c..18e80805a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -109,16 +109,18 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { override fun onResume() { super.onResume() if (mStoredAnimateGifs != config.animateGifs) { - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.notifyDataSetChanged() } if (mStoredCropThumbnails != config.cropThumbnails) { - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.notifyDataSetChanged() } if (mStoredScrollHorizontally != config.scrollHorizontally) { - (directories_grid.adapter as DirectoryAdapter).scrollVertically = !config.scrollHorizontally - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.let { + (it as DirectoryAdapter).scrollVertically = !config.scrollHorizontally + it.notifyDataSetChanged() + } setupScrollDirection() } 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 ef9344764..78c2d610e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -79,16 +79,18 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { override fun onResume() { super.onResume() if (mShowAll && mStoredAnimateGifs != config.animateGifs) { - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.notifyDataSetChanged() } if (mStoredCropThumbnails != config.cropThumbnails) { - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.notifyDataSetChanged() } if (mStoredScrollHorizontally != config.scrollHorizontally) { - (media_grid.adapter as MediaAdapter).scrollVertically = !config.scrollHorizontally - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.let { + (it as MediaAdapter).scrollVertically = !config.scrollHorizontally + it.notifyDataSetChanged() + } setupScrollDirection() } From c42be23accf5b7e7bd2b0bfe104a18b7dd56afdf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 22:52:00 +0200 Subject: [PATCH 028/174] add a toggle for hiding system ui at fullscreen media automatically --- .../gallery/activities/SettingsActivity.kt | 9 +++++++++ .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_settings.xml | 20 +++++++++++++++++++ app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 21 files changed, 51 insertions(+) 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 0d8720b55..8b12f419a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -36,6 +36,7 @@ class SettingsActivity : SimpleActivity() { setupScrollHorizontally() setupScreenRotation() setupShowMedia() + setupHideSystemUI() updateTextColors(settings_holder) } @@ -121,6 +122,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupHideSystemUI() { + settings_hide_system_ui.isChecked = config.hideSystemUI + settings_hide_system_ui_holder.setOnClickListener { + settings_hide_system_ui.toggle() + config.hideSystemUI = settings_hide_system_ui.isChecked + } + } + private fun setupScreenRotation() { settings_screen_rotation.text = getScreenRotationText() settings_screen_rotation_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index b144682c4..18ab38067 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -224,4 +224,8 @@ class Config(context: Context) : BaseConfig(context) { var scrollHorizontally: Boolean get() = prefs.getBoolean(SCROLL_HORIZONTALLY, false) set(scrollHorizontally) = prefs.edit().putBoolean(SCROLL_HORIZONTALLY, scrollHorizontally).apply() + + var hideSystemUI: Boolean + get() = prefs.getBoolean(HIDE_SYSTEM_UI, false) + set(hideSystemUI) = prefs.edit().putBoolean(HIDE_SYSTEM_UI, hideSystemUI).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 70fe30c1b..d5fe939b0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -31,6 +31,7 @@ val EXCLUDED_FOLDERS = "excluded_folders" val INCLUDED_FOLDERS = "included_folders" val ALBUM_COVERS = "album_covers" val SCROLL_HORIZONTALLY = "scroll_horizontally" +val HIDE_SYSTEM_UI = "hide_system_ui" val NOMEDIA = ".nomedia" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 94881326b..a71c63bf1 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -228,6 +228,26 @@ + + + + + + Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 5ad2a6fa7..9d697a7a6 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -99,6 +99,7 @@ Seitenverhältnis Schwarzer Hintergrund im Vollbild Kacheln horizontal scrollen + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ecf170589..739405284 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -99,6 +99,7 @@ Relación de aspecto Utilizar siempre fondo oscuro en pantalla completa Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 615dc40d2..e69143f01 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -99,6 +99,7 @@ Ratio d\'aspect Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 64bf3f633..6c149d411 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -99,6 +99,7 @@ Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1c1c8592e..942898085 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -99,6 +99,7 @@ Proporzioni Sfondo scuro a schermo intero Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index cecc3a74f..5306f014b 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -99,6 +99,7 @@ Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 61ae09d3b..2667378be 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -99,6 +99,7 @@ Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 976d597d3..91f6d6d79 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -99,6 +99,7 @@ Proporção da mídia Fundo de tela escuro em mídia tela cheia Rolar miniaturas horizontalmente + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d8d8ed3a7..dd3e9ccf7 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -99,6 +99,7 @@ Proporção Usar sempre um fundo escuro se em ecrã completo Deslocação horizontal de miniaturas + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index f4bac5fd6..acd50705f 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -99,6 +99,7 @@ Соотношение сторон Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 99bb62e8d..f8e13c2a0 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -99,6 +99,7 @@ Pomeru strán Tmavé pozadie pri médiách na celú obrazovku Prehliadať miniatúry vodorovne + Automaticky skrývať systémové lišty pri celoobrazovkových médiách diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 4c5bcd086..cb0ed4d24 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -99,6 +99,7 @@ Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fe9515775..f977c3114 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -99,6 +99,7 @@ En-boy oranı Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 77cb78b98..fdc51b475 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -99,6 +99,7 @@ 根据长宽比 全屏时黑色背景 水平滚动缩略图 + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 6728df826..a510c5181 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -99,6 +99,7 @@ Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0e77bee76..209bcfbe9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -99,6 +99,7 @@ Aspect ratio Dark background at fullscreen media Scroll thumbnails horizontally + Automatically hide system UI at fullscreen media From bbdf72b52ed31e9d73eaf31509f85467fbbb8c03 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:03:10 +0200 Subject: [PATCH 029/174] hide system ui at opening fullscreen media if set so --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 3 +++ 1 file changed, 3 insertions(+) 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 315bc8c41..330259f6c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -115,6 +115,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (config.darkBackground) view_pager.background = ColorDrawable(Color.BLACK) + + if (config.hideSystemUI) + fragmentClicked() } override fun onDestroy() { From a0b9dc7754948be7242ea1af049325c1ab4963e6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:15:09 +0200 Subject: [PATCH 030/174] do not allow long pressing items if its a third party pick intent --- .../gallery/activities/MainActivity.kt | 8 ++++---- .../gallery/activities/MediaActivity.kt | 8 ++++---- .../gallery/adapters/DirectoryAdapter.kt | 10 +++++----- .../gallery/adapters/MediaAdapter.kt | 11 ++++++----- .../gallery/dialogs/PickDirectoryDialog.kt | 2 +- .../gallery/dialogs/PickMediumDialog.kt | 2 +- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 18e80805a..de37a3534 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -392,12 +392,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun setupAdapter() { val currAdapter = directories_grid.adapter - if (currAdapter != null) { - (currAdapter as DirectoryAdapter).updateDirs(mDirs) - } else { - directories_grid.adapter = DirectoryAdapter(this, mDirs, this) { + if (currAdapter == null) { + directories_grid.adapter = DirectoryAdapter(this, mDirs, this, isPickIntent(intent) || isGetAnyContentIntent(intent)) { itemClicked(it.path) } + } else { + (currAdapter as DirectoryAdapter).updateDirs(mDirs) } setupScrollDirection() } 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 78c2d610e..d2d33fb8f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -141,12 +141,12 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { return val currAdapter = media_grid.adapter - if (currAdapter != null) { - (currAdapter as MediaAdapter).updateMedia(mMedia) - } else { - media_grid.adapter = MediaAdapter(this, mMedia, this) { + if (currAdapter == null) { + media_grid.adapter = MediaAdapter(this, mMedia, this, mIsGetAnyIntent) { itemClicked(it.path) } + } else { + (currAdapter as MediaAdapter).updateMedia(mMedia) } setupScrollDirection() } 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 e0dec09e6..4c43bf660 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -30,8 +30,8 @@ import kotlinx.android.synthetic.main.directory_tmb.view.* import java.io.File import java.util.* -class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, val listener: DirOperationsListener?, val itemClick: (Directory) -> Unit) : - RecyclerView.Adapter() { +class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, val listener: DirOperationsListener?, val isPickIntent: Boolean, + val itemClick: (Directory) -> Unit) : RecyclerView.Adapter() { val multiSelector = MultiSelector() val config = activity.config @@ -357,7 +357,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList (Unit)) : + val multiSelector: MultiSelector, val listener: DirOperationsListener?, val isPickIntent: Boolean, val itemClick: (Directory) -> (Unit)) : SwappingHolder(view, MultiSelector()) { fun bindView(directory: Directory, isPinned: Boolean, scrollVertically: Boolean): View { itemView.apply { @@ -429,7 +429,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, val listener: MediaOperationsListener?, val itemClick: (Medium) -> Unit) : - RecyclerView.Adapter() { +class MediaAdapter(val activity: SimpleActivity, var media: MutableList, val listener: MediaOperationsListener?, val isPickIntent: Boolean, + val itemClick: (Medium) -> Unit) : RecyclerView.Adapter() { val multiSelector = MultiSelector() val config = activity.config @@ -266,7 +266,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { val view = LayoutInflater.from(parent?.context).inflate(R.layout.photo_video_item, parent, false) - return ViewHolder(view, adapterListener, activity, multiSelectorMode, multiSelector, listener, itemClick) + return ViewHolder(view, adapterListener, activity, multiSelectorMode, multiSelector, listener, isPickIntent, itemClick) } override fun onBindViewHolder(holder: ViewHolder, position: Int) { @@ -332,7 +332,8 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } class ViewHolder(val view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, - val multiSelector: MultiSelector, val listener: MediaOperationsListener?, val itemClick: (Medium) -> (Unit)) : SwappingHolder(view, MultiSelector()) { + val multiSelector: MultiSelector, val listener: MediaOperationsListener?, val isPickIntent: Boolean, val itemClick: (Medium) -> (Unit)) : + SwappingHolder(view, MultiSelector()) { fun bindView(medium: Medium, displayFilenames: Boolean, scrollVertically: Boolean): View { itemView.apply { play_outline.visibility = if (medium.video) View.VISIBLE else View.GONE @@ -341,7 +342,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, activity.loadImage(medium.path, medium_thumbnail, scrollVertically) setOnClickListener { viewClicked(medium) } - setOnLongClickListener { viewLongClicked(); true } + setOnLongClickListener { if (isPickIntent) viewClicked(medium) else viewLongClicked(); true } adapterListener.setupItemForeground(this) } 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 7b3c93971..ea4fcb14d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -60,7 +60,7 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, return shownDirectories = directories - val adapter = DirectoryAdapter(activity, directories, null) { + val adapter = DirectoryAdapter(activity, directories, null, true) { if (it.path.trimEnd('/') == sourcePath) { activity.toast(R.string.source_and_destination_same) return@DirectoryAdapter 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 8d2bacf2b..4c57c68f1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt @@ -47,7 +47,7 @@ class PickMediumDialog(val activity: SimpleActivity, val path: String, val callb return shownMedia = media - val adapter = MediaAdapter(activity, media, null) { + val adapter = MediaAdapter(activity, media, null, true) { callback(it.path) dialog.dismiss() } From f282c5b0afd31e103ecaca0816c4ad20fb9103b3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:24:44 +0200 Subject: [PATCH 031/174] call notifyDataSetChanged on the viewpager adapter earlier --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 330259f6c..b779db178 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -234,9 +234,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) { view_pager.apply { adapter = pagerAdapter + adapter!!.notifyDataSetChanged() currentItem = mPos addOnPageChangeListener(this@ViewPagerActivity) - adapter!!.notifyDataSetChanged() } } } From 66561179bdd5b8fdd05fe742910a730858c2900d Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:26:51 +0200 Subject: [PATCH 032/174] adding the automatic system ui hiding in the release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index de37a3534..7c5c96689 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -473,6 +473,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(98, R.string.release_98)) add(Release(108, R.string.release_108)) add(Release(112, R.string.release_112)) + add(Release(114, R.string.release_114)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 6e021e8e9..399439034 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Added an option for automatically hiding the system UI at entering fullscreen mode Added an option for enabling horizontal scrolling Allow setting custom folder covers From 49df8130cf2e0ba739cbe0d949c0ce846f59c3dc Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:30:32 +0200 Subject: [PATCH 033/174] changing the current fragment retriever at viewpager activity --- .../gallery/activities/ViewPagerActivity.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index b779db178..b6d0078f1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -306,17 +306,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun rotateImage(degrees: Float) { mRotationDegrees = (mRotationDegrees + degrees) % 360 - getCurrentFragment()?.rotateImageViewBy(mRotationDegrees) + getCurrentFragment()?.let { + (it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees) + } supportInvalidateOptionsMenu() } - private fun getCurrentFragment(): PhotoFragment? { - val fragment = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem) - return if (fragment is PhotoFragment) - fragment - else - null - } + private fun getCurrentFragment() = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem) private fun showProperties() { if (getCurrentMedium() != null) From 3a4f05ba912c2f17c336273b1bba315c3a67e594 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:56:48 +0200 Subject: [PATCH 034/174] hide the video seekbar too if initial system ui hiding is enabled --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 93a050fe0..fa60bfa53 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -62,11 +62,11 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mIsFullscreen = activity.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN activity.window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> - val fullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 - mIsFullscreen = fullscreen + mIsFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 checkFullscreen() listener?.systemUiVisibilityChanged(visibility) } + checkFullscreen() return mView } From 4869605781f110179cf3ca3be33a5e97d5096daa Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:57:00 +0200 Subject: [PATCH 035/174] update version to 2.11.4 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ecd8661d0..098889502 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 113 - versionName "2.11.3" + versionCode 114 + versionName "2.11.4" } signingConfigs { From f741e4cbe2743aafbcb18b1fdaaf6222c7eaeeb1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 26 Jun 2017 23:58:33 +0200 Subject: [PATCH 036/174] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d586a3f5d..8b42f48e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 2.11.4 *(2017-06-26)* +---------------------------- + + * Added an option for automatically hiding the system UI at entering fullscreen mode + * Fix deleting SD card files on some devices + * Couple crashfixes + Version 2.11.3 *(2017-06-24)* ---------------------------- From 0ed110210ba91403b1320c4cb1f9e34b80a34a11 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 27 Jun 2017 20:49:56 +0200 Subject: [PATCH 037/174] update commons to 2.21.16 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 098889502..491c2d75f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.15' + compile 'com.simplemobiletools:commons:2.21.16' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From 3c3740731564b47b1be0e9c608b7852a2cc2eef2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 27 Jun 2017 22:35:21 +0200 Subject: [PATCH 038/174] modify exif metadata at rotating image from fullscreen mode + autosave it --- .../gallery/activities/ViewPagerActivity.kt | 79 ++++--------------- .../gallery/fragments/PhotoFragment.kt | 61 ++++++-------- .../helpers/GlideRotateTransformation.kt | 21 ----- app/src/main/res/menu/menu_viewpager.xml | 18 ----- 4 files changed, 41 insertions(+), 138 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt 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 b6d0078f1..cba51a109 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -5,10 +5,7 @@ import android.content.Intent import android.content.pm.ActivityInfo import android.content.res.Configuration import android.database.Cursor -import android.graphics.Bitmap -import android.graphics.BitmapFactory import android.graphics.Color -import android.graphics.Matrix import android.graphics.drawable.ColorDrawable import android.hardware.SensorManager import android.media.ExifInterface @@ -27,7 +24,6 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.MediaActivity.Companion.mMedia import com.simplemobiletools.gallery.adapters.MyPagerAdapter import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask -import com.simplemobiletools.gallery.dialogs.SaveAsDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.fragments.PhotoFragment import com.simplemobiletools.gallery.fragments.ViewPagerFragment @@ -35,7 +31,6 @@ import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.activity_medium.* import java.io.File -import java.io.OutputStream import java.util.* class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, ViewPagerFragment.FragmentListener { @@ -46,7 +41,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mIsFullScreen = false private var mPos = -1 private var mShowAll = false - private var mRotationDegrees = 0f private var mLastHandledOrientation = 0 private var mPrevHashcode = 0 @@ -187,16 +181,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View findItem(R.id.menu_set_as).isVisible = getCurrentMedium()!!.isImage() == true findItem(R.id.menu_edit).isVisible = getCurrentMedium()!!.isImage() == true findItem(R.id.menu_rotate).isVisible = getCurrentMedium()!!.isImage() == true - findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0f findItem(R.id.menu_hide).isVisible = !getCurrentMedium()!!.name.startsWith('.') findItem(R.id.menu_unhide).isVisible = getCurrentMedium()!!.name.startsWith('.') - - findItem(R.id.menu_rotate).subMenu.apply { - clearHeader() - findItem(R.id.rotate_right).icon = resources.getColoredDrawable(R.drawable.ic_rotate_right, R.color.actionbar_menu_icon) - findItem(R.id.rotate_left).icon = resources.getColoredDrawable(R.drawable.ic_rotate_left, R.color.actionbar_menu_icon) - findItem(R.id.rotate_one_eighty).icon = resources.getColoredDrawable(R.drawable.ic_rotate_one_eighty, R.color.actionbar_menu_icon) - } } return true @@ -218,11 +204,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View R.id.menu_rename -> renameFile() R.id.menu_edit -> openFileEditor(getCurrentFile()) R.id.menu_properties -> showProperties() - R.id.menu_save_as -> saveImageAs() R.id.show_on_map -> showOnMap() - R.id.rotate_right -> rotateImage(90f) - R.id.rotate_left -> rotateImage(-90f) - R.id.rotate_one_eighty -> rotateImage(180f) + R.id.menu_rotate -> rotateImage() R.id.settings -> launchSettings() else -> return super.onOptionsItemSelected(item) } @@ -264,52 +247,23 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - private fun saveImageAs() { - val currPath = getCurrentPath() - SaveAsDialog(this, currPath) { - Thread({ - toast(R.string.saving) - val selectedFile = File(it) - val tmpFile = File(selectedFile.parent, "tmp_${it.getFilenameFromPath()}") - try { - val bitmap = BitmapFactory.decodeFile(currPath) - getFileOutputStream(tmpFile) { - saveFile(tmpFile, bitmap, it) - if (needsStupidWritePermissions(selectedFile.absolutePath)) { - deleteFile(selectedFile) {} - } - - renameFile(tmpFile, selectedFile) { - deleteFile(tmpFile) {} - } - } - } catch (e: OutOfMemoryError) { - toast(R.string.out_of_memory_error) - deleteFile(tmpFile) {} - } catch (e: Exception) { - toast(R.string.unknown_error_occurred) - deleteFile(tmpFile) {} - } - }).start() - } + private fun rotateImage() { + 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 saveFile(file: File, bitmap: Bitmap, out: OutputStream) { - val matrix = Matrix() - matrix.postRotate(mRotationDegrees) - val bmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) - bmp.compress(file.getCompressionFormat(), 90, out) - out.flush() - toast(R.string.file_saved) - out.close() - } - - private fun rotateImage(degrees: Float) { - mRotationDegrees = (mRotationDegrees + degrees) % 360 - getCurrentFragment()?.let { - (it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees) - } - supportInvalidateOptionsMenu() + 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 getCurrentFragment() = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem) @@ -536,7 +490,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } mPos = position updateActionbarTitle() - mRotationDegrees = 0f supportInvalidateOptionsMenu() } 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 7f82ae47f..dfccd0d2c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -28,7 +28,6 @@ import com.simplemobiletools.gallery.extensions.config 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.MEDIUM import com.simplemobiletools.gallery.models.Medium import it.sephiroth.android.library.exif2.ExifInterface @@ -159,38 +158,28 @@ class PhotoFragment : ViewPagerFragment() { } } - private fun loadBitmap(degrees: Float = 0f) { - if (degrees == 0f) { - val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth - val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight + private fun loadBitmap() { + val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth + val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight - Glide.with(this) - .load(medium.path) - .asBitmap() - .signature(activity.getFileSignature(medium.path)) - .format(if (medium.isPng()) DecodeFormat.PREFER_ARGB_8888 else DecodeFormat.PREFER_RGB_565) - .diskCacheStrategy(DiskCacheStrategy.NONE) - .override(targetWidth, targetHeight) - .listener(object : RequestListener { - override fun onException(e: Exception?, model: String?, target: Target?, isFirstResource: Boolean): Boolean { - return false - } + Glide.with(this) + .load(medium.path) + .asBitmap() + .signature(activity.getFileSignature(medium.path)) + .format(if (medium.isPng()) DecodeFormat.PREFER_ARGB_8888 else DecodeFormat.PREFER_RGB_565) + .diskCacheStrategy(DiskCacheStrategy.NONE) + .override(targetWidth, targetHeight) + .listener(object : RequestListener { + override fun onException(e: Exception?, model: String?, target: Target?, isFirstResource: Boolean): Boolean { + return false + } - override fun onResourceReady(resource: Bitmap, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { - if (isFragmentVisible) - addZoomableView() - return false - } - }).into(view.photo_view) - } else { - Glide.with(this) - .load(medium.path) - .asBitmap() - .transform(GlideRotateTransformation(context, degrees)) - .thumbnail(0.2f) - .diskCacheStrategy(DiskCacheStrategy.NONE) - .into(view.photo_view) - } + override fun onResourceReady(resource: Bitmap, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { + if (isFragmentVisible) + addZoomableView() + return false + } + }).into(view.photo_view) } private fun addZoomableView() { @@ -249,16 +238,16 @@ class PhotoFragment : ViewPagerFragment() { } } + fun refreshBitmap() { + view.subsampling_view.beGone() + loadBitmap() + } + override fun onDestroyView() { super.onDestroyView() Glide.clear(view.photo_view) } - fun rotateImageViewBy(degrees: Float) { - view.subsampling_view.beGone() - loadBitmap(degrees) - } - override fun onConfigurationChanged(newConfig: Configuration?) { super.onConfigurationChanged(newConfig) loadImage() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt deleted file mode 100644 index 4e347dd9e..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.simplemobiletools.gallery.helpers - -import android.content.Context -import android.graphics.Bitmap -import android.graphics.Matrix -import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool -import com.bumptech.glide.load.resource.bitmap.BitmapTransformation - -class GlideRotateTransformation(context: Context, val rotateRotationAngle: Float) : BitmapTransformation(context) { - - override fun transform(pool: BitmapPool, bitmap: Bitmap, outWidth: Int, outHeight: Int): Bitmap { - if (rotateRotationAngle % 360 == 0f) - return bitmap - - val matrix = Matrix() - matrix.postRotate(rotateRotationAngle) - return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) - } - - override fun getId() = "GlideRotateTransformation $rotateRotationAngle" -} diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index f5ffc6299..e66a7b835 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -5,24 +5,6 @@ android:id="@+id/menu_rotate" android:icon="@drawable/ic_rotate_right" android:title="@string/rotate" - app:showAsAction="ifRoom"> - - - - - - - Date: Tue, 27 Jun 2017 22:36:39 +0200 Subject: [PATCH 039/174] make mediaplayer at onStopTrackingTouch of video fragment nullable --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index fa60bfa53..6c2fd1776 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -367,7 +367,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee if (!mIsPlaying) { togglePlayPause() } else { - mMediaPlayer!!.start() + mMediaPlayer?.start() } mIsDragged = false From d3d64865af227016f92f40c0bb62bb4a83cc34aa Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 28 Jun 2017 21:56:36 +0200 Subject: [PATCH 040/174] couple changes related to toggling fullscreen --- .../gallery/activities/PhotoVideoActivity.kt | 14 +++++-------- .../gallery/activities/ViewPagerActivity.kt | 21 +++++++++++-------- .../gallery/adapters/MyPagerAdapter.kt | 9 ++++++-- .../gallery/fragments/PhotoFragment.kt | 8 +++---- .../gallery/fragments/VideoFragment.kt | 13 +++++------- .../gallery/fragments/ViewPagerFragment.kt | 4 ++-- 6 files changed, 35 insertions(+), 34 deletions(-) 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 0aa50ac78..defe41a5f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -98,6 +98,11 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } finally { cursor?.close() } + + window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> + val isFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + mFragment.fullscreenToggled(isFullscreen) + } } override fun onResume() { @@ -157,13 +162,4 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList showSystemUI() } } - - override fun systemUiVisibilityChanged(visibility: Int) { - if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { - mIsFullScreen = false - showSystemUI() - } else { - mIsFullScreen = true - } - } } 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 cba51a109..0023d8a99 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -112,6 +112,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (config.hideSystemUI) fragmentClicked() + + window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> + mIsFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + view_pager.adapter?.let { + (it as MyPagerAdapter).toggleFullscreen(mIsFullScreen) + checkSystemUI() + } + } } override fun onDestroy() { @@ -445,6 +453,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun fragmentClicked() { mIsFullScreen = !mIsFullScreen + checkSystemUI() + } + + private fun checkSystemUI() { if (mIsFullScreen) { hideSystemUI() } else { @@ -452,15 +464,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - override fun systemUiVisibilityChanged(visibility: Int) { - if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { - mIsFullScreen = false - showSystemUI() - } else { - mIsFullScreen = true - } - } - private fun updateActionbarTitle() { runOnUiThread { if (mPos < mMedia.size) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt index fbd05d975..b1d72481b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt @@ -5,7 +5,6 @@ import android.support.v4.app.Fragment import android.support.v4.app.FragmentManager import android.support.v4.app.FragmentStatePagerAdapter import android.support.v4.view.PagerAdapter -import android.util.SparseArray import android.view.ViewGroup import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.fragments.PhotoFragment @@ -15,7 +14,7 @@ import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.models.Medium class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val media: MutableList) : FragmentStatePagerAdapter(fm) { - private val mFragments = SparseArray() + private val mFragments = HashMap() override fun getCount() = media.size override fun getItem(position: Int): Fragment { @@ -49,4 +48,10 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m } fun getCurrentFragment(position: Int) = mFragments.get(position) + + fun toggleFullscreen(isFullscreen: Boolean) { + for ((pos, fragment) in mFragments) { + fragment.fullscreenToggled(isFullscreen) + } + } } 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 dfccd0d2c..d5747ad86 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -42,7 +42,6 @@ class PhotoFragment : ViewPagerFragment() { lateinit var view: ViewGroup private var isFragmentVisible = false private var wasInit = false - private var RATIO_THRESHOLD = 0.1 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { view = inflater.inflate(R.layout.pager_photo_item, container, false) as ViewGroup @@ -100,9 +99,6 @@ class PhotoFragment : ViewPagerFragment() { } loadImage() - activity.window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> - listener?.systemUiVisibilityChanged(visibility) - } wasInit = true return view @@ -256,4 +252,8 @@ class PhotoFragment : ViewPagerFragment() { private fun photoClicked() { listener?.fragmentClicked() } + + override fun fullscreenToggled(isFullscreen: Boolean) { + + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 6c2fd1776..70815d787 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -60,12 +60,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } mIsFullscreen = activity.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN - - activity.window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> - mIsFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 - checkFullscreen() - listener?.systemUiVisibilityChanged(visibility) - } checkFullscreen() return mView @@ -114,8 +108,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } private fun toggleFullscreen() { - mIsFullscreen = !mIsFullscreen - checkFullscreen() listener?.fragmentClicked() } @@ -372,4 +364,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mIsDragged = false } + + override fun fullscreenToggled(isFullscreen: Boolean) { + mIsFullscreen = isFullscreen + checkFullscreen() + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt index bd6bc4a50..c8f443502 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt @@ -5,9 +5,9 @@ import android.support.v4.app.Fragment abstract class ViewPagerFragment : Fragment() { var listener: FragmentListener? = null + abstract fun fullscreenToggled(isFullscreen: Boolean) + interface FragmentListener { fun fragmentClicked() - - fun systemUiVisibilityChanged(visibility: Int) } } From 7b8640a77acdb1888519e935f8289f662ac1c002 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 28 Jun 2017 22:58:52 +0200 Subject: [PATCH 041/174] use the previous way of image rotating at sd card files and non jpgs --- .../gallery/activities/ViewPagerActivity.kt | 79 +++++++++++++++++-- .../gallery/fragments/PhotoFragment.kt | 56 ++++++++----- .../helpers/GlideRotateTransformation.kt | 21 +++++ .../gallery/models/Medium.kt | 2 + app/src/main/res/menu/menu_viewpager.xml | 6 ++ 5 files changed, 137 insertions(+), 27 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt 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 0023d8a99..f566b6333 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -5,7 +5,10 @@ import android.content.Intent import android.content.pm.ActivityInfo import android.content.res.Configuration import android.database.Cursor +import android.graphics.Bitmap +import android.graphics.BitmapFactory import android.graphics.Color +import android.graphics.Matrix import android.graphics.drawable.ColorDrawable import android.hardware.SensorManager import android.media.ExifInterface @@ -24,6 +27,7 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.MediaActivity.Companion.mMedia import com.simplemobiletools.gallery.adapters.MyPagerAdapter import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask +import com.simplemobiletools.gallery.dialogs.SaveAsDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.fragments.PhotoFragment import com.simplemobiletools.gallery.fragments.ViewPagerFragment @@ -31,6 +35,7 @@ import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.activity_medium.* import java.io.File +import java.io.OutputStream import java.util.* class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, ViewPagerFragment.FragmentListener { @@ -41,6 +46,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mIsFullScreen = false private var mPos = -1 private var mShowAll = false + private var mRotationDegrees = 0f private var mLastHandledOrientation = 0 private var mPrevHashcode = 0 @@ -182,15 +188,15 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_viewpager, menu) - if (getCurrentMedium() == null) - return true + val currentMedium = getCurrentMedium() ?: return true menu.apply { - findItem(R.id.menu_set_as).isVisible = getCurrentMedium()!!.isImage() == true - findItem(R.id.menu_edit).isVisible = getCurrentMedium()!!.isImage() == true - findItem(R.id.menu_rotate).isVisible = getCurrentMedium()!!.isImage() == true - findItem(R.id.menu_hide).isVisible = !getCurrentMedium()!!.name.startsWith('.') - findItem(R.id.menu_unhide).isVisible = getCurrentMedium()!!.name.startsWith('.') + findItem(R.id.menu_set_as).isVisible = currentMedium.isImage() + findItem(R.id.menu_edit).isVisible = currentMedium.isImage() + findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() + findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0f + findItem(R.id.menu_hide).isVisible = !currentMedium.name.startsWith('.') + findItem(R.id.menu_unhide).isVisible = currentMedium.name.startsWith('.') } return true @@ -214,6 +220,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View R.id.menu_properties -> showProperties() R.id.show_on_map -> showOnMap() R.id.menu_rotate -> rotateImage() + R.id.menu_save_as -> saveImageAs() R.id.settings -> launchSettings() else -> return super.onOptionsItemSelected(item) } @@ -256,6 +263,15 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } 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) @@ -274,6 +290,54 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View }.toString() } + private fun rotateByDegrees() { + mRotationDegrees = (mRotationDegrees + 90) % 360 + getCurrentFragment()?.let { + (it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees) + } + supportInvalidateOptionsMenu() + } + + private fun saveImageAs() { + val currPath = getCurrentPath() + SaveAsDialog(this, currPath) { + Thread({ + toast(R.string.saving) + val selectedFile = File(it) + val tmpFile = File(selectedFile.parent, "tmp_${it.getFilenameFromPath()}") + try { + val bitmap = BitmapFactory.decodeFile(currPath) + getFileOutputStream(tmpFile) { + saveFile(tmpFile, bitmap, it) + if (needsStupidWritePermissions(selectedFile.absolutePath)) { + deleteFile(selectedFile) {} + } + + renameFile(tmpFile, selectedFile) { + deleteFile(tmpFile) {} + } + } + } catch (e: OutOfMemoryError) { + toast(R.string.out_of_memory_error) + deleteFile(tmpFile) {} + } catch (e: Exception) { + toast(R.string.unknown_error_occurred) + deleteFile(tmpFile) {} + } + }).start() + } + } + + private fun saveFile(file: File, bitmap: Bitmap, out: OutputStream) { + val matrix = Matrix() + matrix.postRotate(mRotationDegrees) + val bmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) + bmp.compress(file.getCompressionFormat(), 90, out) + out.flush() + toast(R.string.file_saved) + out.close() + } + private fun getCurrentFragment() = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem) private fun showProperties() { @@ -493,6 +557,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } mPos = position updateActionbarTitle() + mRotationDegrees = 0f supportInvalidateOptionsMenu() } 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 d5747ad86..f6d8b1a80 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -28,6 +28,7 @@ import com.simplemobiletools.gallery.extensions.config 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.MEDIUM import com.simplemobiletools.gallery.models.Medium import it.sephiroth.android.library.exif2.ExifInterface @@ -154,28 +155,38 @@ class PhotoFragment : ViewPagerFragment() { } } - private fun loadBitmap() { - val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth - val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight + private fun loadBitmap(degrees: Float = 0f) { + if (degrees == 0f) { + val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth + val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight - Glide.with(this) - .load(medium.path) - .asBitmap() - .signature(activity.getFileSignature(medium.path)) - .format(if (medium.isPng()) DecodeFormat.PREFER_ARGB_8888 else DecodeFormat.PREFER_RGB_565) - .diskCacheStrategy(DiskCacheStrategy.NONE) - .override(targetWidth, targetHeight) - .listener(object : RequestListener { - override fun onException(e: Exception?, model: String?, target: Target?, isFirstResource: Boolean): Boolean { - return false - } + Glide.with(this) + .load(medium.path) + .asBitmap() + .signature(activity.getFileSignature(medium.path)) + .format(if (medium.isPng()) DecodeFormat.PREFER_ARGB_8888 else DecodeFormat.PREFER_RGB_565) + .diskCacheStrategy(DiskCacheStrategy.NONE) + .override(targetWidth, targetHeight) + .listener(object : RequestListener { + override fun onException(e: Exception?, model: String?, target: Target?, isFirstResource: Boolean): Boolean { + return false + } - override fun onResourceReady(resource: Bitmap, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { - if (isFragmentVisible) - addZoomableView() - return false - } - }).into(view.photo_view) + override fun onResourceReady(resource: Bitmap, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { + if (isFragmentVisible) + addZoomableView() + return false + } + }).into(view.photo_view) + } else { + Glide.with(this) + .load(medium.path) + .asBitmap() + .transform(GlideRotateTransformation(context, degrees)) + .thumbnail(0.2f) + .diskCacheStrategy(DiskCacheStrategy.NONE) + .into(view.photo_view) + } } private fun addZoomableView() { @@ -239,6 +250,11 @@ class PhotoFragment : ViewPagerFragment() { loadBitmap() } + fun rotateImageViewBy(degrees: Float) { + view.subsampling_view.beGone() + loadBitmap(degrees) + } + override fun onDestroyView() { super.onDestroyView() Glide.clear(view.photo_view) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt new file mode 100644 index 000000000..4e347dd9e --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt @@ -0,0 +1,21 @@ +package com.simplemobiletools.gallery.helpers + +import android.content.Context +import android.graphics.Bitmap +import android.graphics.Matrix +import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool +import com.bumptech.glide.load.resource.bitmap.BitmapTransformation + +class GlideRotateTransformation(context: Context, val rotateRotationAngle: Float) : BitmapTransformation(context) { + + override fun transform(pool: BitmapPool, bitmap: Bitmap, outWidth: Int, outHeight: Int): Bitmap { + if (rotateRotationAngle % 360 == 0f) + return bitmap + + val matrix = Matrix() + matrix.postRotate(rotateRotationAngle) + return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) + } + + override fun getId() = "GlideRotateTransformation $rotateRotationAngle" +} 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 c9afe29f0..0fb1aa59a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -20,6 +20,8 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo fun isGif() = path.isGif() + fun isJpg() = path.endsWith(".jpg", true) || path.endsWith(".jpeg", true) + fun isImage() = !isGif() && !video fun getMimeType() = File(path).getMimeType() diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index e66a7b835..c668eab9c 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -6,6 +6,12 @@ android:icon="@drawable/ic_rotate_right" android:title="@string/rotate" app:showAsAction="ifRoom"/> + Date: Wed, 28 Jun 2017 23:49:47 +0200 Subject: [PATCH 042/174] update commons to 2.21.17 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 491c2d75f..cb3921e83 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.16' + compile 'com.simplemobiletools:commons:2.21.17' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From 3ec99cd43b4a0fd13a53c38b0e3417c7920c1282 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 28 Jun 2017 23:56:07 +0200 Subject: [PATCH 043/174] fix #263, add an indicator to directories located on sd cards --- .../gallery/adapters/DirectoryAdapter.kt | 8 +++----- app/src/main/res/layout/directory_item.xml | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 4c43bf660..3d437756c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -14,10 +14,7 @@ import com.google.gson.Gson import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog -import com.simplemobiletools.commons.extensions.isAStorageRootFolder -import com.simplemobiletools.commons.extensions.isImageVideoGif -import com.simplemobiletools.commons.extensions.needsStupidWritePermissions -import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog @@ -425,8 +422,9 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList + + + From 02c651581e60c5ca9a59497e4b3cd8c50793c9f3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 29 Jun 2017 19:04:08 +0200 Subject: [PATCH 044/174] disable fast loading of fullscreen images for a test build --- .../gallery/activities/ViewPagerActivity.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index f566b6333..7208f66cb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -18,7 +18,10 @@ import android.os.Bundle import android.provider.MediaStore import android.support.v4.view.ViewPager import android.util.DisplayMetrics -import android.view.* +import android.view.Menu +import android.view.MenuItem +import android.view.OrientationEventListener +import android.view.View import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog @@ -97,7 +100,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mDirectory = File(mPath).parent title = mPath.getFilenameFromPath() - view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + /*view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { override fun onGlobalLayout() { view_pager.viewTreeObserver.removeOnGlobalLayoutListener(this) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && isDestroyed) @@ -107,7 +110,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View gotMedia(mMedia) } } - }) + })*/ reloadViewPager() scanPath(mPath) {} From 512fb947175b0d8843270e2317f3aa494c6b1c00 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 29 Jun 2017 19:04:26 +0200 Subject: [PATCH 045/174] update version to 2.11.5 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cb3921e83..72121121c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 114 - versionName "2.11.4" + versionCode 115 + versionName "2.11.5" } signingConfigs { From e7dd7185e2d4b99e2766d8be0d989a9f3f534d95 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 29 Jun 2017 19:05:49 +0200 Subject: [PATCH 046/174] updating release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 7c5c96689..f38eb9b82 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -474,6 +474,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(108, R.string.release_108)) add(Release(112, R.string.release_112)) add(Release(114, R.string.release_114)) + add(Release(115, R.string.release_115)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 399439034..eb93d433e 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,10 @@ + + Added an indicator of folders located on SD cards + Improved the way of rotating jpg images on the internal storage by modifying the exif tags + added autosave + Added an option for automatically hiding the system UI at entering fullscreen mode Added an option for enabling horizontal scrolling Allow setting custom folder covers From ac2f4937ec86a4b3f0ccc9f31f9062d29d78f237 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 29 Jun 2017 19:06:37 +0200 Subject: [PATCH 047/174] updating changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b42f48e7..42a01d851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 2.11.5 *(2017-06-29)* +---------------------------- + + * Added an indicator of folders located on SD cards + * Improved the way of rotating jpg images on the internal storage by modifying the exif tags + added autosave + Version 2.11.4 *(2017-06-26)* ---------------------------- From b6b3a8f4af444261f52361a638a10dada09bee1a Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 29 Jun 2017 19:09:20 +0200 Subject: [PATCH 048/174] reenable fullscreen image fast loading --- .../gallery/activities/ViewPagerActivity.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 7208f66cb..f566b6333 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -18,10 +18,7 @@ import android.os.Bundle import android.provider.MediaStore import android.support.v4.view.ViewPager import android.util.DisplayMetrics -import android.view.Menu -import android.view.MenuItem -import android.view.OrientationEventListener -import android.view.View +import android.view.* import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog @@ -100,7 +97,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mDirectory = File(mPath).parent title = mPath.getFilenameFromPath() - /*view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { override fun onGlobalLayout() { view_pager.viewTreeObserver.removeOnGlobalLayoutListener(this) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && isDestroyed) @@ -110,7 +107,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View gotMedia(mMedia) } } - })*/ + }) reloadViewPager() scanPath(mPath) {} From ff3cc194029b47493c01575404dc57ad964f15a4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 30 Jun 2017 21:47:01 +0200 Subject: [PATCH 049/174] remove a space at the proguard rules file --- app/proguard-rules.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 34de0fb81..0816ea160 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -2,4 +2,4 @@ -dontwarn com.simplemobiletools.** -renamesourcefileattribute SourceFile --keepattributes SourceFile, LineNumberTable +-keepattributes SourceFile,LineNumberTable From 33396362cba6f1df24dba8286f796f9f4c15aac5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 30 Jun 2017 21:51:53 +0200 Subject: [PATCH 050/174] updating a german string --- app/src/main/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9d697a7a6..f22158f23 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -99,7 +99,7 @@ Seitenverhältnis Schwarzer Hintergrund im Vollbild Kacheln horizontal scrollen - Automatically hide system UI at fullscreen media + Systemleisten ausblenden im Vollbild From 5b5f81fda585bb00424ccbb7f101384499857f46 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 00:04:31 +0200 Subject: [PATCH 051/174] update Commons and Glide --- app/build.gradle | 2 +- .../gallery/activities/MediaActivity.kt | 22 ++++--- .../gallery/adapters/DirectoryAdapter.kt | 2 +- .../gallery/adapters/MediaAdapter.kt | 2 +- .../gallery/extensions/activity.kt | 63 ++++++++++--------- .../gallery/extensions/string.kt | 6 ++ .../gallery/fragments/PhotoFragment.kt | 54 ++++++++++------ .../helpers/GlideRotateTransformation.kt | 5 +- 8 files changed, 94 insertions(+), 62 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/extensions/string.kt diff --git a/app/build.gradle b/app/build.gradle index 72121121c..c35fa18e8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.21.17' + compile 'com.simplemobiletools:commons:2.22.0' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 d2d33fb8f..0a5a34bab 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -9,14 +9,14 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.support.v7.widget.GridLayoutManager -import android.util.Log import android.view.Menu import android.view.MenuItem import android.view.ViewGroup import android.widget.FrameLayout import com.bumptech.glide.Glide -import com.bumptech.glide.request.animation.GlideAnimation +import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.SimpleTarget +import com.bumptech.glide.request.transition.Transition import com.google.gson.Gson import com.google.gson.reflect.TypeToken import com.simplemobiletools.commons.dialogs.ConfirmationDialog @@ -390,18 +390,22 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { val wantedWidth = wallpaperDesiredMinimumWidth val wantedHeight = wallpaperDesiredMinimumHeight val ratio = wantedWidth.toFloat() / wantedHeight - Glide.with(this) - .load(File(path)) - .asBitmap() + + val options = RequestOptions() .override((wantedWidth * ratio).toInt(), wantedHeight) .fitCenter() + + Glide.with(this) + .asBitmap() + .load(File(path)) + .apply(options) .into(object : SimpleTarget() { - override fun onResourceReady(bitmap: Bitmap?, glideAnimation: GlideAnimation?) { + override fun onResourceReady(resource: Bitmap?, transition: Transition?) { try { - WallpaperManager.getInstance(applicationContext).setBitmap(bitmap) + WallpaperManager.getInstance(applicationContext).setBitmap(resource) setResult(Activity.RESULT_OK) - } catch (e: IOException) { - Log.e(TAG, "item click $e") + } catch (ignored: IOException) { + } finish() 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 3d437756c..646954bcf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -455,7 +455,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, } fun stopLoad() { - Glide.clear(view.medium_thumbnail) + Glide.with(activity).clear(view.medium_thumbnail) } } 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 cc9125a8e..451e2bdff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -15,7 +15,8 @@ import android.view.ViewConfiguration import com.bumptech.glide.Glide import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy -import com.bumptech.glide.signature.StringSignature +import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions +import com.bumptech.glide.request.RequestOptions import com.google.gson.Gson import com.google.gson.reflect.TypeToken import com.simplemobiletools.commons.extensions.* @@ -262,8 +263,6 @@ fun SimpleActivity.toggleFileVisibility(oldFile: File, hide: Boolean, callback: } } -fun Activity.getFileSignature(path: String) = StringSignature(File(path).lastModified().toString()) - fun Activity.loadImage(path: String, target: MySquareImageView, verticalScroll: Boolean) { target.isVerticalScrolling = verticalScroll if (path.isImageFast() || path.isVideoFast()) { @@ -282,49 +281,55 @@ fun Activity.loadImage(path: String, target: MySquareImageView, verticalScroll: } fun Activity.loadPng(path: String, target: MySquareImageView) { - val builder = Glide.with(applicationContext) - .load(path) - .asBitmap() - .signature(getFileSignature(path)) - .diskCacheStrategy(DiskCacheStrategy.RESULT) + val options = RequestOptions() + .signature(path.getFileSignature()) + .diskCacheStrategy(DiskCacheStrategy.RESOURCE) .format(DecodeFormat.PREFER_ARGB_8888) - if (config.cropThumbnails) builder.centerCrop() else builder.fitCenter() - builder.into(target) + val builder = Glide.with(applicationContext) + .asBitmap() + .load(path) + + if (config.cropThumbnails) options.centerCrop() else options.fitCenter() + builder.apply(options).into(target) } fun Activity.loadJpg(path: String, target: MySquareImageView) { + val options = RequestOptions() + .signature(path.getFileSignature()) + .diskCacheStrategy(DiskCacheStrategy.RESOURCE) + val builder = Glide.with(applicationContext) .load(path) - .signature(getFileSignature(path)) - .diskCacheStrategy(DiskCacheStrategy.RESULT) - .crossFade() - if (config.cropThumbnails) builder.centerCrop() else builder.fitCenter() - builder.into(target) + if (config.cropThumbnails) options.centerCrop() else options.fitCenter() + builder.apply(options).transition(DrawableTransitionOptions.withCrossFade()).into(target) } fun Activity.loadAnimatedGif(path: String, target: MySquareImageView) { - val builder = Glide.with(applicationContext) - .load(path) - .asGif() - .signature(getFileSignature(path)) + val options = RequestOptions() + .signature(path.getFileSignature()) .diskCacheStrategy(DiskCacheStrategy.NONE) - .crossFade() - if (config.cropThumbnails) builder.centerCrop() else builder.fitCenter() - builder.into(target) + val builder = Glide.with(applicationContext) + .asGif() + .load(path) + + if (config.cropThumbnails) options.centerCrop() else options.fitCenter() + builder.apply(options).transition(DrawableTransitionOptions.withCrossFade()).into(target) } fun Activity.loadStaticGif(path: String, target: MySquareImageView) { - val builder = Glide.with(applicationContext) - .load(path) - .asBitmap() - .signature(getFileSignature(path)) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + val options = RequestOptions() + .signature(path.getFileSignature()) + .diskCacheStrategy(DiskCacheStrategy.DATA) - if (config.cropThumbnails) builder.centerCrop() else builder.fitCenter() - builder.into(target) + val builder = Glide.with(applicationContext) + .asBitmap() + .load(path) + + if (config.cropThumbnails) options.centerCrop() else options.fitCenter() + builder.apply(options).into(target) } fun Activity.getCachedDirectories(): ArrayList { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/string.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/string.kt new file mode 100644 index 000000000..47837c672 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/string.kt @@ -0,0 +1,6 @@ +package com.simplemobiletools.gallery.extensions + +import com.bumptech.glide.signature.ObjectKey +import java.io.File + +fun String.getFileSignature() = ObjectKey(File(this).lastModified().toString()) 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 f6d8b1a80..134af8f40 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -7,15 +7,20 @@ import android.graphics.Color import android.graphics.Matrix import android.graphics.drawable.ColorDrawable import android.net.Uri +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.bumptech.glide.Glide import com.bumptech.glide.Priority +import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy +import com.bumptech.glide.load.engine.GlideException +import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions import com.bumptech.glide.request.RequestListener +import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView @@ -143,12 +148,15 @@ class PhotoFragment : ViewPagerFragment() { private fun loadImage() { if (medium.isGif()) { - Glide.with(this) - .load(medium.path) - .asGif() - .crossFade() + val options = RequestOptions() .priority(if (isFragmentVisible) Priority.IMMEDIATE else Priority.LOW) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(DiskCacheStrategy.DATA) + + Glide.with(this) + .asGif() + .load(medium.path) + .transition(DrawableTransitionOptions.withCrossFade()) + .apply(options) .into(view.photo_view) } else { loadBitmap() @@ -160,31 +168,37 @@ class PhotoFragment : ViewPagerFragment() { val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight - Glide.with(this) - .load(medium.path) - .asBitmap() - .signature(activity.getFileSignature(medium.path)) - .format(if (medium.isPng()) DecodeFormat.PREFER_ARGB_8888 else DecodeFormat.PREFER_RGB_565) + val options = RequestOptions() + .signature(medium.path.getFileSignature()) + .format(DecodeFormat.PREFER_ARGB_8888) .diskCacheStrategy(DiskCacheStrategy.NONE) .override(targetWidth, targetHeight) - .listener(object : RequestListener { - override fun onException(e: Exception?, model: String?, target: Target?, isFirstResource: Boolean): Boolean { + + Glide.with(this) + .asBitmap() + .load(medium.path) + .apply(options) + .listener(object : RequestListener { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { return false } - override fun onResourceReady(resource: Bitmap, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { + override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { if (isFragmentVisible) addZoomableView() return false } }).into(view.photo_view) } else { - Glide.with(this) - .load(medium.path) - .asBitmap() - .transform(GlideRotateTransformation(context, degrees)) - .thumbnail(0.2f) + val options = RequestOptions() .diskCacheStrategy(DiskCacheStrategy.NONE) + .transform(GlideRotateTransformation(context, degrees)) + + Glide.with(this) + .asBitmap() + .load(medium.path) + .thumbnail(0.2f) + .apply(options) .into(view.photo_view) } } @@ -257,7 +271,9 @@ class PhotoFragment : ViewPagerFragment() { override fun onDestroyView() { super.onDestroyView() - Glide.clear(view.photo_view) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !activity.isDestroyed) { + Glide.with(context).clear(view.photo_view) + } } override fun onConfigurationChanged(newConfig: Configuration?) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt index 4e347dd9e..8a48b23f4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/GlideRotateTransformation.kt @@ -5,9 +5,9 @@ import android.graphics.Bitmap import android.graphics.Matrix import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool import com.bumptech.glide.load.resource.bitmap.BitmapTransformation +import java.security.MessageDigest class GlideRotateTransformation(context: Context, val rotateRotationAngle: Float) : BitmapTransformation(context) { - override fun transform(pool: BitmapPool, bitmap: Bitmap, outWidth: Int, outHeight: Int): Bitmap { if (rotateRotationAngle % 360 == 0f) return bitmap @@ -17,5 +17,6 @@ class GlideRotateTransformation(context: Context, val rotateRotationAngle: Float return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) } - override fun getId() = "GlideRotateTransformation $rotateRotationAngle" + override fun updateDiskCacheKey(messageDigest: MessageDigest?) { + } } From 0b7a5a30f3b1ba9987b8a6861b3a210a7874a49e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 09:05:37 +0200 Subject: [PATCH 052/174] update leak canary to 1.5.1 --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c35fa18e8..7d977f0d0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,9 +41,9 @@ dependencies { compile 'it.sephiroth.android.exif:library:1.0.1' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' - releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' - testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' + testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' } buildscript { From 61fb25332d97792714db31e7e51cd32982c7d06c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 10:04:47 +0200 Subject: [PATCH 053/174] add a menu button for disabling Temporarily show hidden --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 11 +++++++---- .../gallery/activities/MediaActivity.kt | 11 +++++++---- app/src/main/res/menu/menu_main.xml | 4 ++++ app/src/main/res/menu/menu_main_intent.xml | 4 ++++ app/src/main/res/menu/menu_media.xml | 4 ++++ 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7d977f0d0..3753ab9c3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.22.0' + compile 'com.simplemobiletools:commons:2.22.1' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 f38eb9b82..f734026bc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -87,7 +87,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { menu.findItem(R.id.increase_column_count).isVisible = config.dirColumnCnt < 10 menu.findItem(R.id.reduce_column_count).isVisible = config.dirColumnCnt > 1 } - menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.showHiddenMedia + menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden + menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden return true } @@ -96,7 +97,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { R.id.sort -> showSortingDialog() R.id.open_camera -> launchCamera() R.id.show_all -> showAllMedia() - R.id.temporarily_show_hidden -> temporarilyShowHidden() + R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true) + R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false) R.id.increase_column_count -> increaseColumnCount() R.id.reduce_column_count -> reduceColumnCount() R.id.settings -> launchSettings() @@ -208,9 +210,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { finish() } - private fun temporarilyShowHidden() { - config.temporarilyShowHidden = true + private fun toggleTemporarilyShowHidden(show: Boolean) { + config.temporarilyShowHidden = show getDirectories() + invalidateOptionsMenu() } private fun checkIfColorChanged() { 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 0a5a34bab..5b5cb89a4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -197,7 +197,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { findItem(R.id.open_camera).isVisible = mShowAll findItem(R.id.about).isVisible = mShowAll - findItem(R.id.temporarily_show_hidden).isVisible = !config.showHiddenMedia + findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden + findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden findItem(R.id.increase_column_count).isVisible = config.mediaColumnCnt < 10 findItem(R.id.reduce_column_count).isVisible = config.mediaColumnCnt > 1 @@ -215,7 +216,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { R.id.hide_folder -> tryHideFolder() R.id.unhide_folder -> unhideFolder() R.id.exclude_folder -> tryExcludeFolder() - R.id.temporarily_show_hidden -> temporarilyShowHidden() + R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true) + R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false) R.id.increase_column_count -> increaseColumnCount() R.id.reduce_column_count -> reduceColumnCount() R.id.settings -> launchSettings() @@ -314,9 +316,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { false } - private fun temporarilyShowHidden() { - config.temporarilyShowHidden = true + private fun toggleTemporarilyShowHidden(show: Boolean) { + config.temporarilyShowHidden = show getMedia() + invalidateOptionsMenu() } private fun getRecyclerAdapter() = (media_grid.adapter as MediaAdapter) diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 01937ceb9..c32d48135 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -19,6 +19,10 @@ android:id="@+id/temporarily_show_hidden" android:title="@string/temporarily_show_hidden" app:showAsAction="never"/> + + diff --git a/app/src/main/res/menu/menu_media.xml b/app/src/main/res/menu/menu_media.xml index 8a0cc4b29..b8b9b53c5 100644 --- a/app/src/main/res/menu/menu_media.xml +++ b/app/src/main/res/menu/menu_media.xml @@ -36,6 +36,10 @@ android:id="@+id/temporarily_show_hidden" android:title="@string/temporarily_show_hidden" app:showAsAction="never"/> + Date: Sat, 1 Jul 2017 11:46:40 +0200 Subject: [PATCH 054/174] replace top margin with padding at the destination directory picker --- .../simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt | 3 +-- app/src/main/res/layout/dialog_directory_picker.xml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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 ea4fcb14d..3a8152d63 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -21,10 +21,9 @@ import kotlinx.android.synthetic.main.dialog_directory_picker.view.* class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, val callback: (path: String) -> Unit) { var dialog: AlertDialog var shownDirectories: ArrayList = ArrayList() - var view: View + var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null) init { - view = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null) (view.directories_grid.layoutManager as GridLayoutManager).apply { orientation = if (activity.config.scrollHorizontally) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL spanCount = activity.config.dirColumnCnt diff --git a/app/src/main/res/layout/dialog_directory_picker.xml b/app/src/main/res/layout/dialog_directory_picker.xml index 57c9fb4e8..0a586affb 100644 --- a/app/src/main/res/layout/dialog_directory_picker.xml +++ b/app/src/main/res/layout/dialog_directory_picker.xml @@ -4,13 +4,13 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/directories_grid_holder" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:paddingTop="@dimen/activity_margin"> From 7aa83fbff0171ddc63451d3a89bf64ff489dee5d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 15:29:38 +0200 Subject: [PATCH 055/174] update Commons to 2.22.3 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 3753ab9c3..587c9b935 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.22.1' + compile 'com.simplemobiletools:commons:2.22.3' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From fe63873c04fddf166b07ce819efb9f5aff154df9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 15:38:24 +0200 Subject: [PATCH 056/174] update version to 2.12.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 587c9b935..f01faa1c9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 115 - versionName "2.11.5" + versionCode 116 + versionName "2.12.0" } signingConfigs { From 693e93aa6cae82c5346bd52c367cc1c07c5919f7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Jul 2017 15:38:33 +0200 Subject: [PATCH 057/174] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42a01d851..1c7dc50bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 2.12.0 *(2017-07-01)* +---------------------------- + + * Added a button for disabling "Temporarily show hidden" + * Updated Glide (library used for loading images) to 4.0.0 + * Made playing gifs smooth + Version 2.11.5 *(2017-06-29)* ---------------------------- From 2acbc1a02eb0e84b6c568bb18502b879cf672012 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Jul 2017 08:52:31 +0200 Subject: [PATCH 058/174] add some activity checks at clearing Glide load --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 3 ++- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 646954bcf..d1845938e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -455,7 +455,8 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, } fun stopLoad() { - Glide.with(activity).clear(view.medium_thumbnail) + if (!activity.isDestroyed) + Glide.with(activity).clear(view.medium_thumbnail) } } From 13980f9a8e310136a2d3c0a121fa0800f73e70ee Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Jul 2017 09:07:34 +0200 Subject: [PATCH 059/174] make sure we populate the viewpager from the main thread --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 +++- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index f734026bc..0c7df443e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -382,7 +382,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mDirs = dirs - setupAdapter() + runOnUiThread { + setupAdapter() + } storeDirectories() } 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 5b5cb89a4..391edfe5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -449,7 +449,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mLastDrawnHashCode = media.hashCode() mMedia = media - setupAdapter() + runOnUiThread { + setupAdapter() + } storeFolder() } From d4fcf8038d54671b5ce7488ce9a968b2a647112d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Jul 2017 09:08:02 +0200 Subject: [PATCH 060/174] update version to 2.12.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f01faa1c9..f3da433eb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 116 - versionName "2.12.0" + versionCode 117 + versionName "2.12.1" } signingConfigs { From 36496b6f71870533a1c7e1d27bccdff49b719c8b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Jul 2017 09:08:30 +0200 Subject: [PATCH 061/174] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c7dc50bb..cd4cae81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 2.12.1 *(2017-07-02)* +---------------------------- + + * Couple crashfixes + Version 2.12.0 *(2017-07-01)* ---------------------------- From 722a7d1a4202068806dea65e5134f8583f5e3c29 Mon Sep 17 00:00:00 2001 From: anthologist Date: Sat, 8 Jul 2017 11:59:29 +0200 Subject: [PATCH 062/174] update italian --- app/src/main/res/values-it/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 942898085..9b9e85ac3 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -19,10 +19,10 @@ Nessuna app fotocamera trovata Aumenta numero colonne Riduci numero colonne - Change cover image - Select photo - Use default - Set as + Cambia immagine copertina + Seleziona foto + Usa predefinita + Imposta come 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? @@ -66,7 +66,7 @@ Capovolgi Capovolgi orizzontalmente Capovolgi verticalmente - Edit with + Modifica con Sfondo semplice @@ -86,8 +86,8 @@ Mostra tipo di media Solo immagini Solo video - GIFs only - Images, videos, GIFs + Solo GIF + Immagini, video, GIF Immagini e video Ripeti i video Anima le GIF in miniatura @@ -98,8 +98,8 @@ Rotazione dispositivo Proporzioni Sfondo scuro a schermo intero - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media + Scorri miniature orizzontalmente + Nascondi UI di sistema con media a schermo intero From d29b0be048aca7f46ad5d892fbac68fa4826f9b8 Mon Sep 17 00:00:00 2001 From: en2sv Date: Sat, 8 Jul 2017 20:25:08 +0200 Subject: [PATCH 063/174] Update Swedish translation --- app/src/main/res/values-sv/strings.xml | 92 +++++++++++++------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index cb0ed4d24..a1ab856cd 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -1,7 +1,7 @@ Simple Gallery - Gallery + Galleri Redigera Starta kameran Öppna med @@ -13,33 +13,33 @@ Alla mappar Byt till mappvy Andra mappar - Show on map - Unknown location - No application with maps has been found - No Camera app has been found - Increase column count - Reduce column count - Change cover image - Select photo - Use default - Set as + Visa på karta + Okänd plats + Ingen app med kartor hittades + Ingen Kamera-app hittades + Öka antalet kolumner + Minska antalet kolumner + Byt omslagsbild + Välj foto + Använd standard + Ange som - 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? - Exclude - Excluded folders - Manage excluded folders - This will exclude the selection together with its subfolders from Simple Gallery only. You can manage excluded folders in Settings. - Exclude a parent instead? - 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. - Remove all - Remove all folders from the list of excluded? This will not delete the folders. + 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? + Uteslut + Uteslutna mappar + Hantera uteslutna mappar + Detta utesluter bara den markerade mappen och dess undermappar från Simple Gallery. Du kan hantera uteslutna mappar i Inställningar. + Vill du utesluta en överordnad mapp istället? + Uteslutning av mappar döljer bara dem och deras undermappar i Simple Gallery, de visas fortfarande i andra appar.\\n\\nAnvänd Dölj-funktionen om du även vill dölja dem från andra appar. + Ta bort alla + Vill du ta bort alla mappar från uteslutningslistan? Detta raderar inte mapparna. - Included folders - Manage included folders - Add folder - If you have some folders which contain media, but were not recognized by the app, you can add them manually here. + Inkluderade mappar + Hantera inkluderade mappar + Lägg till mapp + 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. Ändra storlek @@ -55,18 +55,18 @@ Rotera Sökväg Ogiltig bildsökväg - Image editing failed + Bilden kunde inte redigeras Redigera bilden med: Hittade ingen bildredigerare Okänd filplats Det gick inte att skriva över källfilen - Rotate left - Rotate right - Rotate by 180º - Flip - Flip horizontally - Flip vertically - Edit with + Rotera åt vänster + Rotera åt höger + Rotera 180º + Vänd + Vänd horisontellt + Vänd vertikalt + Redigera med Bakgrundsbild @@ -76,8 +76,8 @@ Hittade ingen app som klarar av detta Inställningar för bakgrundsbild… Bakgrundsbilden är ändrad - Portrait aspect ratio - Landscape aspect ratio + Stående bildförhållande + Liggande bildförhållande Visa dolda mappar @@ -86,20 +86,20 @@ Visa media Endast bilder Endast videos - GIFs only - Images, videos, GIFs + Bara GIF-bilder + Bilder, videor, GIF-bilder Bilder och videos Återspela videos - Animate GIFs at thumbnails - Max brightness when viewing media - Crop thumbnails into squares - Rotate fullscreen media by - System setting - Device rotation - Aspect ratio - Dark background at fullscreen media - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media + Animera GIF-bilders miniatyrer + Maximal ljusstyrka när media visas + Beskär miniatyrer till kvadrater + Rotera media i helskärmsläge + Systeminställning + Enhetens rotation + Bildförhållande + Mörk bakgrund när media visas i helskärmsläge + Rulla horisontellt genom miniatyrer + Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge From 3df76261e0edd74ba6c9dd79c86ac967265ad59e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 09:28:26 +0200 Subject: [PATCH 064/174] fix #302, add a toggle for disabling leak canary --- app/src/main/kotlin/com/simplemobiletools/gallery/App.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt index 9e46e19a9..4cbda3237 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt @@ -4,11 +4,14 @@ import android.app.Application import com.squareup.leakcanary.LeakCanary class App : Application() { + val USE_LEAK_CANARY = false override fun onCreate() { super.onCreate() - if (LeakCanary.isInAnalyzerProcess(this)) { - return + if (USE_LEAK_CANARY) { + if (LeakCanary.isInAnalyzerProcess(this)) { + return + } + LeakCanary.install(this) } - LeakCanary.install(this) } } From 8f135b30a8fa1167407f246974e1af6e7281bcce Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 10:59:15 +0200 Subject: [PATCH 065/174] updating some German strings --- app/src/main/res/values-de/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index f22158f23..d1a6eeb5c 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -56,7 +56,7 @@ Pfad Ungültiger Dateipfad Bildbearbeitung fehlgeschlagen - Bild bearbeiten mit: + Bild bearbeiten mit Keine Bildeditor-App gefunden Unbekannter Dateiort Konnte Quelldatei nicht überschreiben @@ -66,13 +66,13 @@ Spiegeln Horizontal spiegeln Vertikal spiegeln - Edit with + Bearbeiten mit Schlichter Hintergrund Als Hintergrund festlegen Hintergrundbild festlegen fehlgeschlagen - Als Hintergrund festlegen mit: + Als Hintergrund festlegen mit Keine Hintergrundbild-App gefunden Hintergrund festlegen… Hintergrundbild erfolgreich festgelegt From a355b0a7b88ed530c840fed41fdf9cd00384a02f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 13:36:16 +0200 Subject: [PATCH 066/174] update kotlin to 1.1.3-2 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index f3da433eb..4596e75ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ dependencies { } buildscript { - ext.kotlin_version = '1.1.3' + ext.kotlin_version = '1.1.3-2' repositories { mavenCentral() } From ce41e5b7b94867f38dd674caa7846455b37938f7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 13:58:08 +0200 Subject: [PATCH 067/174] convert mMedia to a mutable list before providing to MyPagerAdapter --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- .../com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index f566b6333..0f1d6fa01 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -228,7 +228,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun updatePagerItems() { - val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia) + val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia.toMutableList()) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) { view_pager.apply { adapter = pagerAdapter diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt index b1d72481b..b7e5640ad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt @@ -42,9 +42,9 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m return fragment } - override fun destroyItem(container: ViewGroup?, position: Int, `object`: Any?) { + override fun destroyItem(container: ViewGroup?, position: Int, any: Any?) { mFragments.remove(position) - super.destroyItem(container, position, `object`) + super.destroyItem(container, position, any) } fun getCurrentFragment(position: Int) = mFragments.get(position) From 5c88ce9fa834f99f86b4adac389254cb9af77db0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 19:47:54 +0200 Subject: [PATCH 068/174] update PhotoView to 2.1.2 --- app/build.gradle | 2 +- .../gallery/fragments/PhotoFragment.kt | 15 ++++++--------- app/src/main/res/layout/pager_photo_item.xml | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4596e75ef..fe35d2c6a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ dependencies { compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.google.code.gson:gson:2.8.0' - compile 'com.github.chrisbanes:PhotoView:1.3.1' + compile 'com.github.chrisbanes:PhotoView:2.1.2' compile 'it.sephiroth.android.exif:library:1.0.1' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 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 134af8f40..1667d68c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -38,7 +38,6 @@ import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.models.Medium import it.sephiroth.android.library.exif2.ExifInterface import kotlinx.android.synthetic.main.pager_photo_item.view.* -import uk.co.senab.photoview.PhotoViewAttacher import java.io.File import java.io.FileOutputStream import java.io.IOException @@ -93,15 +92,13 @@ class PhotoFragment : ViewPagerFragment() { view.photo_view.apply { maximumScale = 8f mediumScale = 3f - setOnPhotoTapListener(object : PhotoViewAttacher.OnPhotoTapListener { - override fun onPhotoTap(view: View?, x: Float, y: Float) { - photoClicked() - } + setOnOutsidePhotoTapListener { + photoClicked() + } - override fun onOutsidePhotoTap() { - photoClicked() - } - }) + setOnPhotoTapListener { view, x, y -> + photoClicked() + } } loadImage() diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index 7d7cf1e82..1c4d2d76a 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - From dfb382adeb9e64aba42c64c6f926ea70b95d1977 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 20:17:57 +0200 Subject: [PATCH 069/174] add an additional share menu button to fullscreen view --- .../gallery/activities/ViewPagerActivity.kt | 3 ++- app/src/main/res/menu/menu_viewpager.xml | 20 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 0f1d6fa01..72d5314af 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -213,7 +213,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View R.id.menu_open_with -> openWith(getCurrentFile()) R.id.menu_hide -> toggleFileVisibility(true) R.id.menu_unhide -> toggleFileVisibility(false) - R.id.menu_share -> shareMedium(getCurrentMedium()!!) + R.id.menu_share_1 -> shareMedium(getCurrentMedium()!!) + R.id.menu_share_2 -> shareMedium(getCurrentMedium()!!) R.id.menu_delete -> askConfirmDelete() R.id.menu_rename -> renameFile() R.id.menu_edit -> openFileEditor(getCurrentFile()) diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index c668eab9c..cc9243396 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -2,9 +2,14 @@ + Date: Sun, 9 Jul 2017 20:34:14 +0200 Subject: [PATCH 070/174] add a toggle for replacing Share with Rotate at fullscreen media --- .../gallery/activities/SettingsActivity.kt | 9 +++++++++ .../gallery/activities/ViewPagerActivity.kt | 4 ++++ .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_settings.xml | 20 +++++++++++++++++++ app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 22 files changed, 55 insertions(+) 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 8b12f419a..02cf907aa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -35,6 +35,7 @@ class SettingsActivity : SimpleActivity() { setupDarkBackground() setupScrollHorizontally() setupScreenRotation() + setupReplaceShare() setupShowMedia() setupHideSystemUI() updateTextColors(settings_holder) @@ -130,6 +131,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupReplaceShare() { + settings_replace_share.isChecked = config.replaceShare + settings_replace_share_holder.setOnClickListener { + settings_replace_share.toggle() + config.replaceShare = settings_replace_share.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 72d5314af..cee4d7d42 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -179,6 +179,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } else if (config.screenRotation == ROTATE_BY_SYSTEM_SETTING) { requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED } + + invalidateOptionsMenu() } override fun onPause() { @@ -191,6 +193,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val currentMedium = getCurrentMedium() ?: return true menu.apply { + findItem(R.id.menu_share_1).isVisible = !config.replaceShare + findItem(R.id.menu_share_2).isVisible = config.replaceShare findItem(R.id.menu_set_as).isVisible = currentMedium.isImage() findItem(R.id.menu_edit).isVisible = currentMedium.isImage() findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 18ab38067..b221d32da 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -228,4 +228,8 @@ class Config(context: Context) : BaseConfig(context) { var hideSystemUI: Boolean get() = prefs.getBoolean(HIDE_SYSTEM_UI, false) set(hideSystemUI) = prefs.edit().putBoolean(HIDE_SYSTEM_UI, hideSystemUI).apply() + + var replaceShare: Boolean + get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false) + set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index d5fe939b0..30af458a7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -32,6 +32,7 @@ val INCLUDED_FOLDERS = "included_folders" val ALBUM_COVERS = "album_covers" val SCROLL_HORIZONTALLY = "scroll_horizontally" val HIDE_SYSTEM_UI = "hide_system_ui" +val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" val NOMEDIA = ".nomedia" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index a71c63bf1..78e405aad 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -248,6 +248,26 @@ + + + + + + Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d1a6eeb5c..b2d21fe1a 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -100,6 +100,7 @@ Schwarzer Hintergrund im Vollbild Kacheln horizontal scrollen Systemleisten ausblenden im Vollbild + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 739405284..6c54cc0b1 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -100,6 +100,7 @@ Utilizar siempre fondo oscuro en pantalla completa Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index e69143f01..2622e160c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 6c149d411..e8e38ae06 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9b9e85ac3..65de520a9 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -100,6 +100,7 @@ Sfondo scuro a schermo intero Scorri miniature orizzontalmente Nascondi UI di sistema con media a schermo intero + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 5306f014b..e4acc7a77 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 2667378be..6713484f2 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 91f6d6d79..d99f0285d 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -100,6 +100,7 @@ Fundo de tela escuro em mídia tela cheia Rolar miniaturas horizontalmente Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index dd3e9ccf7..38b62fd22 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -100,6 +100,7 @@ Usar sempre um fundo escuro se em ecrã completo Deslocação horizontal de miniaturas Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index acd50705f..deba93f66 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index f8e13c2a0..a3f5716c3 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -100,6 +100,7 @@ Tmavé pozadie pri médiách na celú obrazovku Prehliadať miniatúry vodorovne Automaticky skrývať systémové lišty pri celoobrazovkových médiách + Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index a1ab856cd..c99df493f 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -100,6 +100,7 @@ Mörk bakgrund när media visas i helskärmsläge Rulla horisontellt genom miniatyrer Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index f977c3114..667357ad5 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index fdc51b475..b9badef76 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -100,6 +100,7 @@ 全屏时黑色背景 水平滚动缩略图 Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a510c5181..4cba28d07 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 209bcfbe9..5fb46bcb5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -100,6 +100,7 @@ Dark background at fullscreen media Scroll thumbnails horizontally Automatically hide system UI at fullscreen media + Replace Share with Rotate at fullscreen menu From 8e5cdf78cd8e8414c4242d23d927b00988d6065c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 23:27:19 +0200 Subject: [PATCH 071/174] updating release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 0c7df443e..ba9476aec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -480,6 +480,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(112, R.string.release_112)) add(Release(114, R.string.release_114)) add(Release(115, R.string.release_115)) + add(Release(118, R.string.release_118)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index eb93d433e..df1915f19 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Added a toggle for replacing Share with Rotate at fullscreen media Added an indicator of folders located on SD cards Improved the way of rotating jpg images on the internal storage by modifying the exif tags + added autosave From 0f7d6c84a78fd208a94f104e94f00388b779b4e7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 23:27:29 +0200 Subject: [PATCH 072/174] updating commons to 2.22.5 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index fe35d2c6a..3308a645b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.22.3' + compile 'com.simplemobiletools:commons:2.22.5' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From dc973cd9e158e09d90a19b1d0d512845a62d58f8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 23:28:54 +0200 Subject: [PATCH 073/174] update version to 2.12.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3308a645b..8c287ec87 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 117 - versionName "2.12.1" + versionCode 118 + versionName "2.12.2" } signingConfigs { From 7952a1799c455a3496de73493445d709b8eb421a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 23:28:59 +0200 Subject: [PATCH 074/174] updating changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd4cae81c..562f1c55d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 2.12.2 *(2017-07-09)* +---------------------------- + + * Added a toggle for replacing Share with Rotate at fullscreen media + * Some crashfixes and translation updates + Version 2.12.1 *(2017-07-02)* ---------------------------- From 0f8f573d94fbb23c26a3ed3fc89378941678e4f9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Jul 2017 21:51:21 +0200 Subject: [PATCH 075/174] make sure the "Save as" menu button is visible after rotating fullscreen media --- app/src/main/res/menu/menu_viewpager.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index cc9243396..2ab54089e 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -1,6 +1,12 @@ + - Date: Mon, 10 Jul 2017 21:54:03 +0200 Subject: [PATCH 076/174] show the Delete menu as first at long pressing directories --- app/src/main/res/menu/cab_directories.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/menu/cab_directories.xml b/app/src/main/res/menu/cab_directories.xml index 2267e4c6e..ec47b283d 100644 --- a/app/src/main/res/menu/cab_directories.xml +++ b/app/src/main/res/menu/cab_directories.xml @@ -2,9 +2,9 @@ + - From 21c534cc711276948a4fcff9e0776e0e81963885 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 15 Jul 2017 10:30:08 +0200 Subject: [PATCH 077/174] updating a german string --- app/src/main/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index b2d21fe1a..5d49d1fc7 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -100,7 +100,7 @@ Schwarzer Hintergrund im Vollbild Kacheln horizontal scrollen Systemleisten ausblenden im Vollbild - Replace Share with Rotate at fullscreen menu + Teilen/Drehen im Vollbild-Menü vertauschen From e81cb5e82563c912f4ab5ba104b8cae3a23d77a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Marques?= Date: Wed, 19 Jul 2017 21:38:50 +0100 Subject: [PATCH 078/174] Update strings.xml --- app/src/main/res/values-pt/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 38b62fd22..5367eb25d 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -22,7 +22,7 @@ Alterar imagem da capa Selecionar foto Predefinição - Set as + Definir como 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? @@ -66,7 +66,7 @@ Inverter Horizontalmente Verticalmente - Edit with + Editar com Simple Wallpaper @@ -99,8 +99,8 @@ Proporção Usar sempre um fundo escuro se em ecrã completo Deslocação horizontal de miniaturas - Automatically hide system UI at fullscreen media - Replace Share with Rotate at fullscreen menu + Ocultar interface do sistema se em ecrã completo + Substituir a opção Partilhar pela opção Rodar se em ecrã completo From 00c309535b9b17c42c61bfb2f016a2d0dd3d2bde Mon Sep 17 00:00:00 2001 From: Alberto Rodriguez Date: Wed, 19 Jul 2017 20:46:40 -0400 Subject: [PATCH 079/174] Spanish translate Excellent app!! --- app/src/main/res/values-es/strings.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 6c54cc0b1..c723906fe 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1,7 +1,7 @@ Simple Gallery - Gallery + Galería Editar Abrir cámara Abrir con… @@ -19,10 +19,10 @@ No se encontró aplicación de cámara Aumentar el número de columnas Reducir el número de columnas - Change cover image - Select photo - Use default - Set as + Cambiar imagen de portada + Seleccionar imagen + Uso por defecto + Establecer como 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? @@ -31,7 +31,7 @@ Gestionar carpetas excluidas Esto excluirá la selección junto con sus subcarpetas, solamente de Simple Gallery. Puede gestionar las carpetas excluidas en los Ajustes. ¿Excluir mejor la carpeta superior? - 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. + Excluir las carpetas las hará junto a sus subcarpetas ocultas sólo en Simple Gallery, estas seguirán siendo visibles en otras aplicaciones.\\n\\nSi desea ocultarlo de otras aplicaciones, utilice la función de Ocultar. Eliminar todo ¿Eliminar todas las carpetas de la lista de excluidas? Esto no borrará las carpetas. @@ -66,7 +66,7 @@ Girar Horizontalmente Verticalmente - Edit with + Editar con Fondos de pantalla Simple Gallery @@ -86,8 +86,8 @@ Mostrar multimedia Solo imágenes Solo vídeos - GIFs only - Images, videos, GIFs + solo GIFs + Imágenes, vídeos, GIFs Imágenes y vídeos Reproducción continua de vídeos Animar las miniaturas de GIFs @@ -98,9 +98,9 @@ Rotación del dispositivo Relación de aspecto Utilizar siempre fondo oscuro en pantalla completa - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media - Replace Share with Rotate at fullscreen menu + Desplazar miniaturas horizontalmente + Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa + Reemplazar Compartir con Girar en el menú de pantalla completa From c755f88c51546b52b0b82d6b254f2d21e660ccbd Mon Sep 17 00:00:00 2001 From: gregory678 Date: Wed, 26 Jul 2017 17:52:34 +0200 Subject: [PATCH 080/174] Polish language update Lots of untranslated and buggy strings "fixed" --- app/src/main/res/values-pl/strings.xml | 101 ++++++++++++------------- 1 file changed, 48 insertions(+), 53 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 6713484f2..67ac0e913 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -1,13 +1,13 @@ Simple Gallery - Galeria + Simple Gallery Edytuj Aparat Otwórz w Nie znaleziono danych aplikacji (ukryty) - Pin folder + Przypnij folder Wypakuj folder Pokaż wszystko Wszystkie foldery @@ -19,27 +19,27 @@ Brak aplikacji powiązanej z aparatem Zwiększ liczbę kolumn Zmniejsz liczbę kolumn - Change cover image - Select photo - Use default - Set as + Zmień okładkę + Wybierz obraz + Użyj domyślnego + Ustaw jako - Ta funkcja ukrywa folder dodając \'. \' Nomedia plik do niego, można tak ukryć wszystkie podfoldery. Można je zobaczyć poprzez przełączanie \'Pokaż ukryte foldery \' opcję w ustawieniach. Kontyntynuj? + 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ć? Wyklucz - Wyklucz foldery + Wykluczone foldery Zarządzaj wykluczonymi folderami - Działa na folderach Galerii. Możesz zarządzać wykluczonymi folderami w Menu/Ustawienia. - Wykluczyć folder nadżędny ? - 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. + Działa na folderach galerii. Możesz zarządzać wykluczonymi folderami w ustawieniach aplikacji. + Wykluczyć folder nadrzędny? + Wykluczenie folderów ukryje je tylko w aplikacji Simple Gallery, w innych aplikacjach będą one wciąż widoczne.\n\nJeśli chcesz je ukryć także w innych aplikacjach, użyj funkcji ukrywania. Usuń wszystko - Usuń wszystkie foldery z listy wykluczone? To nie usuwa folderów. + Usunąć wszystkie foldery z listy wykluczonych? Foldery nie zostaną fizycznie usunięte. - Included folders - Manage included folders - Add folder - If you have some folders which contain media, but were not recognized by the app, you can add them manually here. + Dołączone foldery + Zarządzaj dołączonymi folderami + Dodaj folder + Jeśli masz jakieś foldery z multimediami, ale aplikacja ich nie wykryła, możesz je tutaj dodać ręcznie. Zmień rozmiar @@ -55,64 +55,59 @@ Obróć Ścieżka Nieprawidłowa ścieżka - Edycja obrazu nie powiodło się + Edycja obrazu nie powiodła się Edytuj obraz w: - Nie znaleziono edytora zdjęć + Nie znalazłem edytora zdjęć Nieznana lokalizacja pliku Nie udało się zastąpić pliku Obróć w lewo Obróć w prawo - Obróć o 180o - Flip - Flip poziomo - Flip pionowo - Edit with + Obróć o 180 stopni + Przewróć + Przewróć w poziomie + Przewróć w pionie + Edytuj w: Tapeta - Ustaw jako tapeta + Ustaw jako tapetę Ustawienie tapety nie powiodło się Ustaw jako tapetę w: Brak odpowiednich ustawień Ustawianie tapety… Tapeta ustawiona - Portrait aspect ratio - Landscape aspect ratio + Proporcje ekranu w trybie pionowym + Proporcje ekranu w trybie poziomym - Pokaż ukryte foldery + Pokazuj ukryte foldery Odtwarzaj pliki wideo automatycznie Włącz widoczność nazwy pliku Wybierz co pokazywać - Tylko Zdjęcia - Tylko Filmy - GIFs only - Images, videos, GIFs - Obrazy i wideo - Pętla wideo - Animowanie GIFy z miniaturkami - Max brightness when viewing media - Crop thumbnails into squares - Rotate fullscreen media by - System setting - Device rotation - Aspect ratio - Dark background at fullscreen media - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media - Replace Share with Rotate at fullscreen menu + Tylko obrazy + Tylko filmy + Tylko GIFy + Obrazy, filmy i GIFy + Obrazy i filmy + Zapętlaj odtwarzanie filmów + Animowane miniatury GIFów + Maksymalna jasność podczas wyświetlania multimediów + Przycinaj miniatury do kwadratów + Obracaj pełnoekranowe multimedia według + Ustawień systemowych + Orientacji urządzenia + Proporcji + Czarne tło przy podglądzie pełnoekranowym + Przewijaj miniatury poziomo + Ukrywaj automatycznie interfejs przy pełnoekranowym podglądzie + Zamień funkcję udostępniania na obracanie w menu pełnoekranowym - Darmowa Galeria bez reklam do przeglądania zdjęć i filmów. - - Prosta aplikacja galerii do oglądania zdjęć i filmów. Pliki mogą być sortowane według daty, rozmiaru, nazwy zarówno w porządku rosnącym lub malejącym, zdjęcia można powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu, można zmienić liczbę kolumn za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji mozna dowolnie ustawić według własnych preferencji. - - Galeria jest również oferowane do użytkowania przez osoby trzecie do podglądu zdjęć/filmów, dodawania załączników do klientów e-mail itp, Idealne nadaje się do codziennego użytku. - - Nie zawiera żadnych reklam ani niepotrzebnych uprawnień. Jest w pełni opensource. - - Ta aplikacja jest tylko jedą z większego szeregu naszych aplikacji. Można znaleźć resztę z nich w http://www.simplemobiletools.com + Darmowa galeria bez reklam do przeglądania zdjęć i filmów. + Prosta aplikacja galerii do oglądania zdjęć i filmów. Pliki mogą być sortowane według daty, rozmiaru i nazwy, zarówno w porządku rosnącym jak i malejącym. Można je również powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu. Liczbę kolumnbmożna zmienić za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji można dowolnie ustawiać według własnych preferencji. Galeria jest również oferowana do użytkowania przez osoby trzecie do podglądu zdjęć i filmów, dodawania załączników do emaili, itp. Idealne nadaje się do codziennego użytku. Nie zawiera żadnych reklam, ani niepotrzebnych uprawnień. Jest w pełni otawrtoźrodłowa. + +Ta aplikacja jest tylko jedną z wielu naszych aplikacji. Resztę można znaleźć na stronie http://www.simplemobiletools.com . - Darmowa galeria bez reklam do przeglądania zdjęć i filmów. - Prosta aplikacja galerii do oglądania zdjęć i filmów. Pliki mogą być sortowane według daty, rozmiaru i nazwy, zarówno w porządku rosnącym jak i malejącym. Można je również powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu. Liczbę kolumnbmożna zmienić za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji można dowolnie ustawiać według własnych preferencji. Galeria jest również oferowana do użytkowania przez osoby trzecie do podglądu zdjęć i filmów, dodawania załączników do emaili, itp. Idealne nadaje się do codziennego użytku. Nie zawiera żadnych reklam, ani niepotrzebnych uprawnień. Jest w pełni otawrtoźrodłowa. + Darmowa galeria bez reklam do przeglądania obrazów i filmów. + 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. Można je również powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu. Liczbę kolumn można zmienić za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji można dowolnie ustawiać według własnych preferencji. Galeria jest również oferowana do użytkowania przez osoby trzecie do podglądu zdjęć i filmów, dodawania załączników do emaili, itp. Idealne nadaje się do codziennego użytku. Nie zawiera żadnych reklam, ani niepotrzebnych uprawnień. Jest w pełni otawrtoźrodłowa. Ta aplikacja jest tylko jedną z wielu naszych aplikacji. Resztę można znaleźć na stronie http://www.simplemobiletools.com . From 859b69210981dc089ba361687b54bdbbf78a5ff9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 26 Jul 2017 18:26:29 +0200 Subject: [PATCH 082/174] updating some formatting at the polish translation --- app/src/main/res/values-pl/strings.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 666e96683..eeca72c1e 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -25,7 +25,7 @@ Ustaw jako - 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ć? + 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ć? Wyklucz Wykluczone foldery Zarządzaj wykluczonymi folderami @@ -105,14 +105,18 @@ Darmowa galeria bez reklam do przeglądania obrazów i filmów. - 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. Można je również powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu. Liczbę kolumn można zmienić za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji można dowolnie ustawiać według własnych preferencji. Galeria jest również oferowana do użytkowania przez osoby trzecie do podglądu zdjęć i filmów, dodawania załączników do emaili, itp. Idealne nadaje się do codziennego użytku. Nie zawiera żadnych reklam, ani niepotrzebnych uprawnień. Jest w pełni otawrtoźrodłowa. + + 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. Można je również powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu. Liczbę kolumn można zmienić za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji można dowolnie ustawiać według własnych preferencji. + + Galeria jest również oferowana do użytkowania przez osoby trzecie do podglądu zdjęć i filmów, dodawania załączników do emaili, itp. Idealne nadaje się do codziennego użytku. + + Nie zawiera żadnych reklam, ani niepotrzebnych uprawnień. Jest w pełni otawrtoźrodłowa. -Ta aplikacja jest tylko jedną z wielu naszych aplikacji. Resztę można znaleźć na stronie http://www.simplemobiletools.com . + Ta aplikacja jest tylko jedną z wielu naszych aplikacji. Resztę można znaleźć na stronie http://www.simplemobiletools.com. From be72e3fa0d77f88f52091e7bdafdb4b1cbb19d8d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 17:42:00 +0200 Subject: [PATCH 083/174] adding some password protection related strings --- app/src/main/res/values-cs/strings.xml | 9 +++++++++ app/src/main/res/values-de/strings.xml | 9 +++++++++ app/src/main/res/values-es/strings.xml | 9 +++++++++ app/src/main/res/values-fr/strings.xml | 9 +++++++++ app/src/main/res/values-hu/strings.xml | 9 +++++++++ app/src/main/res/values-it/strings.xml | 9 +++++++++ app/src/main/res/values-ja/strings.xml | 9 +++++++++ app/src/main/res/values-pl/strings.xml | 9 +++++++++ app/src/main/res/values-pt-rBR/strings.xml | 9 +++++++++ app/src/main/res/values-pt/strings.xml | 9 +++++++++ app/src/main/res/values-ru/strings.xml | 9 +++++++++ app/src/main/res/values-sk/strings.xml | 9 +++++++++ app/src/main/res/values-sv/strings.xml | 9 +++++++++ app/src/main/res/values-tr/strings.xml | 9 +++++++++ app/src/main/res/values-zh-rCN/strings.xml | 9 +++++++++ app/src/main/res/values-zh-rTW/strings.xml | 9 +++++++++ app/src/main/res/values/strings.xml | 9 +++++++++ 17 files changed, 153 insertions(+) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index fa6c527a5..7d591baf7 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -79,6 +79,14 @@ Portrait aspect ratio Landscape aspect ratio + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Zobrazit skryté média Automaticky přehrávat videa @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 5d49d1fc7..5c811111c 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -79,6 +79,14 @@ Hochformat Querformat + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Versteckte Ordner zeigen Videos automatisch abspielen @@ -101,6 +109,7 @@ Kacheln horizontal scrollen Systemleisten ausblenden im Vollbild Teilen/Drehen im Vollbild-Menü vertauschen + Password protect hidden folders diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c723906fe..018aace58 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -79,6 +79,14 @@ Relación de aspecto tipo retrato Relación de aspecto tipo paisaje + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Mostrar carpetas ocultas Reproducir vídeos automáticamente @@ -101,6 +109,7 @@ Desplazar miniaturas horizontalmente Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa Reemplazar Compartir con Girar en el menú de pantalla completa + Password protect hidden folders diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2622e160c..a17ddc010 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -79,6 +79,14 @@ Ratio aspect Portrait Ratio aspect Paysage + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Afficher les dossiers cachés Lecture automatique des vidéos @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index e8e38ae06..6a0254652 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -79,6 +79,14 @@ Portrait aspect ratio Landscape aspect ratio + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Show hidden media Play videos automatically @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 65de520a9..e12dea886 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -79,6 +79,14 @@ Proporzioni ritratto Proporzioni panorama + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Mostra cartelle nascoste Riproduci video automaticamente @@ -101,6 +109,7 @@ Scorri miniature orizzontalmente Nascondi UI di sistema con media a schermo intero Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e4acc7a77..cebdc055b 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -79,6 +79,14 @@ Portrait aspect ratio Landscape aspect ratio + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + 非表示フォルダーを表示 自動的にビデオを再生 @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index eeca72c1e..7875f20bc 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -79,6 +79,14 @@ Proporcje ekranu w trybie pionowym Proporcje ekranu w trybie poziomym + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Pokazuj ukryte foldery Odtwarzaj pliki wideo automatycznie @@ -101,6 +109,7 @@ Przewijaj miniatury poziomo Ukrywaj automatycznie interfejs przy pełnoekranowym podglądzie Zamień funkcję udostępniania na obracanie w menu pełnoekranowym + Password protect hidden folders diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index d99f0285d..ee583f55e 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -79,6 +79,14 @@ Retrato Paisagem + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Mostrar pastas ocultas Reproduzir vídeos automaticamente @@ -101,6 +109,7 @@ Rolar miniaturas horizontalmente Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 5367eb25d..95995f1cf 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -79,6 +79,14 @@ Proporção na vertical Proporção na horizontal + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Mostrar pastas ocultas Reproduzir vídeos automaticamente @@ -101,6 +109,7 @@ Deslocação horizontal de miniaturas Ocultar interface do sistema se em ecrã completo Substituir a opção Partilhar pela opção Rodar se em ecrã completo + Password protect hidden folders diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index deba93f66..bf5131d04 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -79,6 +79,14 @@ Формат изображения Пейзажное соотношение сторон + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Показать скрытые папки Воспроизводить видео автоматически @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index a3f5716c3..c8c76fa94 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -79,6 +79,14 @@ Orientácia nastojato Orientácia naležato + + PIN + Nesprávny PIN + Zopakujte PIN + Vzor + Nesprávny vzor + Zopakujte vzor + Zobraziť skryté médiá Spúšťať videá automaticky @@ -101,6 +109,7 @@ Prehliadať miniatúry vodorovne Automaticky skrývať systémové lišty pri celoobrazovkových médiách Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu + Uzamknúť zobrazovanie skrytých priečinkov heslom diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index c99df493f..f24744d90 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -79,6 +79,14 @@ Stående bildförhållande Liggande bildförhållande + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Visa dolda mappar Spela upp videos automatiskt @@ -101,6 +109,7 @@ Rulla horisontellt genom miniatyrer Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 667357ad5..fb11ac7d8 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -79,6 +79,14 @@ Portrait aspect ratio Landscape aspect ratio + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Gizli klasörleri göster Videoları otomatik olarak oynat @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index b9badef76..fffe77891 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -79,6 +79,14 @@ 纵向长宽比 横向长宽比 + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + 显示所有 自动播放 @@ -101,6 +109,7 @@ 水平滚动缩略图 Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 4cba28d07..ab2a0f4a5 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -79,6 +79,14 @@ Portrait aspect ratio Landscape aspect ratio + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + 秀出隱藏資料夾 自動播放影片 @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5fb46bcb5..92dbcef9b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -79,6 +79,14 @@ Portrait aspect ratio Landscape aspect ratio + + PIN + Wrong PIN + Repeat PIN + Pattern + Wrong pattern + Repeat pattern + Show hidden media Play videos automatically @@ -101,6 +109,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu + Password protect hidden folders From d9056ed057c78b0787d7376a6c501d626e534091 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 17:48:25 +0200 Subject: [PATCH 084/174] add the password protection toggle button --- .../gallery/activities/SettingsActivity.kt | 9 +++++++++ .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_settings.xml | 20 +++++++++++++++++++ 4 files changed, 34 insertions(+) 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 02cf907aa..5451dc6cf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -36,6 +36,7 @@ class SettingsActivity : SimpleActivity() { setupScrollHorizontally() setupScreenRotation() setupReplaceShare() + setupPasswordProtection() setupShowMedia() setupHideSystemUI() updateTextColors(settings_holder) @@ -139,6 +140,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupPasswordProtection() { + settings_password_protection.isChecked = config.passwordProtection + settings_password_protection_holder.setOnClickListener { + settings_password_protection.toggle() + config.passwordProtection = settings_password_protection.isChecked + } + } + private fun setupScreenRotation() { settings_screen_rotation.text = getScreenRotationText() settings_screen_rotation_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index b221d32da..b1d5b3918 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -232,4 +232,8 @@ class Config(context: Context) : BaseConfig(context) { var replaceShare: Boolean get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false) set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() + + var passwordProtection: Boolean + get() = prefs.getBoolean(PASSWORD_PROTECTION, false) + set(passwordProtection) = prefs.edit().putBoolean(PASSWORD_PROTECTION, passwordProtection).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 30af458a7..a10f57105 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -33,6 +33,7 @@ val ALBUM_COVERS = "album_covers" val SCROLL_HORIZONTALLY = "scroll_horizontally" val HIDE_SYSTEM_UI = "hide_system_ui" val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" +val PASSWORD_PROTECTION = "password_protection" val NOMEDIA = ".nomedia" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 78e405aad..718443de6 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -268,6 +268,26 @@ + + + + + + Date: Sat, 29 Jul 2017 20:13:19 +0200 Subject: [PATCH 085/174] adding a pattern protection to the toggle button --- app/build.gradle | 1 + .../gallery/activities/SettingsActivity.kt | 16 ++++- .../gallery/dialogs/PatternDialog.kt | 68 +++++++++++++++++++ .../gallery/helpers/Config.kt | 10 ++- .../gallery/helpers/Constants.kt | 3 +- app/src/main/res/layout/dialog_pattern.xml | 22 ++++++ app/src/main/res/values-cs/strings.xml | 2 + app/src/main/res/values-de/strings.xml | 2 + app/src/main/res/values-es/strings.xml | 2 + app/src/main/res/values-fr/strings.xml | 2 + app/src/main/res/values-hu/strings.xml | 2 + app/src/main/res/values-it/strings.xml | 2 + app/src/main/res/values-ja/strings.xml | 2 + app/src/main/res/values-pl/strings.xml | 2 + app/src/main/res/values-pt-rBR/strings.xml | 2 + app/src/main/res/values-pt/strings.xml | 2 + app/src/main/res/values-ru/strings.xml | 2 + app/src/main/res/values-sk/strings.xml | 2 + app/src/main/res/values-sv/strings.xml | 2 + app/src/main/res/values-tr/strings.xml | 2 + app/src/main/res/values-zh-rCN/strings.xml | 2 + app/src/main/res/values-zh-rTW/strings.xml | 2 + app/src/main/res/values/strings.xml | 2 + 23 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt create mode 100644 app/src/main/res/layout/dialog_pattern.xml diff --git a/app/build.gradle b/app/build.gradle index 8c287ec87..bcd35c2e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,6 +39,7 @@ dependencies { compile 'com.google.code.gson:gson:2.8.0' compile 'com.github.chrisbanes:PhotoView:2.1.2' compile 'it.sephiroth.android.exif:library:1.0.1' + compile 'com.andrognito.patternlockview:patternlockview:1.0.0' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' 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 5451dc6cf..8493c1dab 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -7,6 +7,7 @@ import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.dialogs.PatternDialog import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.helpers.* import kotlinx.android.synthetic.main.activity_settings.* @@ -141,10 +142,19 @@ class SettingsActivity : SimpleActivity() { } private fun setupPasswordProtection() { - settings_password_protection.isChecked = config.passwordProtection + settings_password_protection.isChecked = config.isPasswordProtectionOn settings_password_protection_holder.setOnClickListener { - settings_password_protection.toggle() - config.passwordProtection = settings_password_protection.isChecked + PatternDialog(this) { + if (config.isPasswordProtectionOn) { + settings_password_protection.isChecked = false + config.isPasswordProtectionOn = false + config.passwordHash = "" + } else { + settings_password_protection.isChecked = true + config.isPasswordProtectionOn = true + config.passwordHash = it + } + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt new file mode 100644 index 000000000..e0f27ab7f --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt @@ -0,0 +1,68 @@ +package com.simplemobiletools.gallery.dialogs + +import android.os.Handler +import android.support.v7.app.AlertDialog +import android.view.LayoutInflater +import com.andrognito.patternlockview.PatternLockView +import com.andrognito.patternlockview.listener.PatternLockViewListener +import com.andrognito.patternlockview.utils.PatternLockUtils +import com.simplemobiletools.commons.extensions.setupDialogStuff +import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.activities.SimpleActivity +import com.simplemobiletools.gallery.extensions.config +import kotlinx.android.synthetic.main.dialog_pattern.view.* + +class PatternDialog(val activity: SimpleActivity, val callback: (hash: String) -> Unit) { + var dialog: AlertDialog? = null + + init { + var hash = "" + val view = LayoutInflater.from(activity).inflate(R.layout.dialog_pattern, null) + view.apply { + pattern_lock_view.correctStateColor = activity.config.primaryColor + pattern_lock_view.normalStateColor = activity.config.textColor + pattern_lock_view.addPatternLockListener(object : PatternLockViewListener { + override fun onComplete(pattern: MutableList?) { + if (hash.isEmpty()) { + hash = PatternLockUtils.patternToSha1(pattern_lock_view, pattern) + pattern_lock_view.clearPattern() + pattern_dialog_title.setText(R.string.repeat_pattern) + } else { + val newHash = PatternLockUtils.patternToSha1(pattern_lock_view, pattern) + if (hash == newHash) { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) + Handler().postDelayed({ + callback(hash) + dialog!!.dismiss() + }, 300) + } else { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) + activity.toast(R.string.wrong_pattern) + Handler().postDelayed({ + hash = "" + pattern_lock_view.clearPattern() + pattern_dialog_title.setText(R.string.select_pattern) + }, 1000) + } + } + } + + override fun onCleared() { + } + + override fun onStarted() { + } + + override fun onProgress(progressPattern: MutableList?) { + } + }) + } + + dialog = AlertDialog.Builder(activity) + .setNegativeButton(R.string.cancel, null) + .create().apply { + activity.setupDialogStuff(view, this) + } + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index b1d5b3918..d02c78187 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -233,7 +233,11 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false) set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() - var passwordProtection: Boolean - get() = prefs.getBoolean(PASSWORD_PROTECTION, false) - set(passwordProtection) = prefs.edit().putBoolean(PASSWORD_PROTECTION, passwordProtection).apply() + var isPasswordProtectionOn: Boolean + get() = prefs.getBoolean(IS_PASSWORD_PROTECTION, false) + set(passwordProtection) = prefs.edit().putBoolean(IS_PASSWORD_PROTECTION, passwordProtection).apply() + + var passwordHash: String + get() = prefs.getString(PASSWORD_HASH, "") + set(passwordHash) = prefs.edit().putString(PASSWORD_HASH, passwordHash).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index a10f57105..01d829cc2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -33,7 +33,8 @@ val ALBUM_COVERS = "album_covers" val SCROLL_HORIZONTALLY = "scroll_horizontally" val HIDE_SYSTEM_UI = "hide_system_ui" val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" -val PASSWORD_PROTECTION = "password_protection" +val IS_PASSWORD_PROTECTION = "password_protection" +val PASSWORD_HASH = "password_hash" val NOMEDIA = ".nomedia" diff --git a/app/src/main/res/layout/dialog_pattern.xml b/app/src/main/res/layout/dialog_pattern.xml new file mode 100644 index 000000000..78eeb54ce --- /dev/null +++ b/app/src/main/res/layout/dialog_pattern.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 7d591baf7..6f0be4434 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 5c811111c..a289cc3a5 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 018aace58..806e9932d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a17ddc010..f54127ab1 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 6a0254652..495defe16 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e12dea886..8dbd7f1dd 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index cebdc055b..043c46c0f 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 7875f20bc..bca2227cf 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ee583f55e..f9aa512a7 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 95995f1cf..78e929e07 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index bf5131d04..60242d8a7 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index c8c76fa94..a1311d47d 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -81,9 +81,11 @@ PIN + Zadajte PIN Nesprávny PIN Zopakujte PIN Vzor + Zvoľte vzor Nesprávny vzor Zopakujte vzor diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index f24744d90..2dfadcbeb 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fb11ac7d8..93638100d 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index fffe77891..9bd074a5f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index ab2a0f4a5..ba3bf331e 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 92dbcef9b..956c73e77 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -81,9 +81,11 @@ PIN + Enter PIN Wrong PIN Repeat PIN Pattern + Select pattern Wrong pattern Repeat pattern From f039afaca6de6b9fb02c3a7364e3cf4ea7525739 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 21:20:21 +0200 Subject: [PATCH 086/174] require the pattern for disabling password protection --- .../gallery/activities/SettingsActivity.kt | 15 ++--- .../gallery/dialogs/PatternDialog.kt | 58 +++++++++++-------- app/src/main/res/layout/dialog_pattern.xml | 2 +- app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values-pt-rBR/strings.xml | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 2 +- app/src/main/res/values-tr/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 20 files changed, 56 insertions(+), 53 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 8493c1dab..714f146fa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -144,16 +144,11 @@ class SettingsActivity : SimpleActivity() { private fun setupPasswordProtection() { settings_password_protection.isChecked = config.isPasswordProtectionOn settings_password_protection_holder.setOnClickListener { - PatternDialog(this) { - if (config.isPasswordProtectionOn) { - settings_password_protection.isChecked = false - config.isPasswordProtectionOn = false - config.passwordHash = "" - } else { - settings_password_protection.isChecked = true - config.isPasswordProtectionOn = true - config.passwordHash = it - } + PatternDialog(this, config.passwordHash) { + val hasPasswordProtection = config.isPasswordProtectionOn + settings_password_protection.isChecked = !hasPasswordProtection + config.isPasswordProtectionOn = !hasPasswordProtection + config.passwordHash = if (hasPasswordProtection) "" else it } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt index e0f27ab7f..8a0e45296 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt @@ -13,39 +13,19 @@ import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.extensions.config import kotlinx.android.synthetic.main.dialog_pattern.view.* -class PatternDialog(val activity: SimpleActivity, val callback: (hash: String) -> Unit) { +class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) { var dialog: AlertDialog? = null + val view = LayoutInflater.from(activity).inflate(R.layout.dialog_pattern, null) + + var hash = requiredHash init { - var hash = "" - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_pattern, null) view.apply { pattern_lock_view.correctStateColor = activity.config.primaryColor pattern_lock_view.normalStateColor = activity.config.textColor pattern_lock_view.addPatternLockListener(object : PatternLockViewListener { override fun onComplete(pattern: MutableList?) { - if (hash.isEmpty()) { - hash = PatternLockUtils.patternToSha1(pattern_lock_view, pattern) - pattern_lock_view.clearPattern() - pattern_dialog_title.setText(R.string.repeat_pattern) - } else { - val newHash = PatternLockUtils.patternToSha1(pattern_lock_view, pattern) - if (hash == newHash) { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) - Handler().postDelayed({ - callback(hash) - dialog!!.dismiss() - }, 300) - } else { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) - activity.toast(R.string.wrong_pattern) - Handler().postDelayed({ - hash = "" - pattern_lock_view.clearPattern() - pattern_dialog_title.setText(R.string.select_pattern) - }, 1000) - } - } + receivedHash(PatternLockUtils.patternToSha1(pattern_lock_view, pattern)) } override fun onCleared() { @@ -65,4 +45,32 @@ class PatternDialog(val activity: SimpleActivity, val callback: (hash: String) - activity.setupDialogStuff(view, this) } } + + private fun receivedHash(newHash: String) { + view.apply { + if (hash.isEmpty()) { + hash = newHash + pattern_lock_view.clearPattern() + pattern_dialog_title.setText(R.string.repeat_pattern) + } else { + if (hash == newHash) { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) + Handler().postDelayed({ + callback(hash) + dialog!!.dismiss() + }, 300) + } else { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) + activity.toast(R.string.wrong_pattern) + Handler().postDelayed({ + pattern_lock_view.clearPattern() + if (requiredHash.isEmpty()) { + hash = "" + pattern_dialog_title.setText(R.string.insert_pattern) + } + }, 1000) + } + } + } + } } diff --git a/app/src/main/res/layout/dialog_pattern.xml b/app/src/main/res/layout/dialog_pattern.xml index 78eeb54ce..e900eb2f9 100644 --- a/app/src/main/res/layout/dialog_pattern.xml +++ b/app/src/main/res/layout/dialog_pattern.xml @@ -10,7 +10,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="@dimen/activity_margin" - android:text="@string/select_pattern"/> + android:text="@string/insert_pattern"/> Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index a289cc3a5..01261c7dc 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 806e9932d..7dba19efd 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f54127ab1..f1fd9704e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 495defe16..4ac31db20 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 8dbd7f1dd..9195f6eb3 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 043c46c0f..80e7abac5 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index bca2227cf..9242085a7 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index f9aa512a7..0d504ea11 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 78e929e07..60919649b 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 60242d8a7..fde9bbde2 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index a1311d47d..23781cf9e 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -85,7 +85,7 @@ Nesprávny PIN Zopakujte PIN Vzor - Zvoľte vzor + Zadajte vzor Nesprávny vzor Zopakujte vzor diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 2dfadcbeb..d567a7964 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 93638100d..e1c255b99 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 9bd074a5f..552305e1a 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index ba3bf331e..02e71ea97 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 956c73e77..e8352b0cd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -85,7 +85,7 @@ Wrong PIN Repeat PIN Pattern - Select pattern + Insert pattern Wrong pattern Repeat pattern From 2b518ec4f2ffbd834edeb9a0c9f9e36cb4bc62d8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 21:48:55 +0200 Subject: [PATCH 087/174] protect toggling Show hidden media with the pattern when appropriate --- .../gallery/activities/SettingsActivity.kt | 15 +++++++++++++-- .../gallery/extensions/activity.kt | 11 +++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 714f146fa..115ce1bd6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -9,6 +9,7 @@ import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.dialogs.PatternDialog import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.extensions.handleHiddenFolderPasswordProtection import com.simplemobiletools.gallery.helpers.* import kotlinx.android.synthetic.main.activity_settings.* @@ -64,11 +65,21 @@ class SettingsActivity : SimpleActivity() { private fun setupShowHiddenFolders() { settings_show_hidden_folders.isChecked = config.showHiddenMedia settings_show_hidden_folders_holder.setOnClickListener { - settings_show_hidden_folders.toggle() - config.showHiddenMedia = settings_show_hidden_folders.isChecked + if (config.showHiddenMedia) { + toggleHiddenFolders() + } else { + handleHiddenFolderPasswordProtection { + toggleHiddenFolders() + } + } } } + private fun toggleHiddenFolders() { + settings_show_hidden_folders.toggle() + config.showHiddenMedia = settings_show_hidden_folders.isChecked + } + private fun setupAutoplayVideos() { settings_autoplay_videos.isChecked = config.autoplayVideos settings_autoplay_videos_holder.setOnClickListener { 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 451e2bdff..dabe6ae16 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -24,6 +24,7 @@ import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity +import com.simplemobiletools.gallery.dialogs.PatternDialog import com.simplemobiletools.gallery.helpers.NOMEDIA import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.gallery.helpers.REQUEST_SET_AS @@ -332,6 +333,16 @@ fun Activity.loadStaticGif(path: String, target: MySquareImageView) { builder.apply(options).into(target) } +fun SimpleActivity.handleHiddenFolderPasswordProtection(callback: () -> Unit) { + if (config.isPasswordProtectionOn) { + PatternDialog(this, config.passwordHash) { + callback() + } + } else { + callback() + } +} + fun Activity.getCachedDirectories(): ArrayList { val token = object : TypeToken>() {}.type return Gson().fromJson>(config.directories, token) ?: ArrayList(1) From f789ecdf02de3a5da17ec189d563b0576d1b9176 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 21:56:45 +0200 Subject: [PATCH 088/174] apply the pattern protection to temporarily showing hidden folders too --- .../gallery/activities/MainActivity.kt | 14 ++++++++++++-- .../gallery/activities/MediaActivity.kt | 14 ++++++++++++-- .../gallery/activities/ViewPagerActivity.kt | 3 ++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index ba9476aec..25e104d4c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -97,8 +97,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { R.id.sort -> showSortingDialog() R.id.open_camera -> launchCamera() R.id.show_all -> showAllMedia() - R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true) - R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false) + R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden(true) + R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden(false) R.id.increase_column_count -> increaseColumnCount() R.id.reduce_column_count -> reduceColumnCount() R.id.settings -> launchSettings() @@ -210,6 +210,16 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { finish() } + private fun tryToggleTemporarilyShowHidden(show: Boolean) { + if (config.temporarilyShowHidden) { + toggleTemporarilyShowHidden(show) + } else { + handleHiddenFolderPasswordProtection { + toggleTemporarilyShowHidden(show) + } + } + } + private fun toggleTemporarilyShowHidden(show: Boolean) { config.temporarilyShowHidden = show getDirectories() 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 391edfe5d..c8f872de6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -216,8 +216,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { R.id.hide_folder -> tryHideFolder() R.id.unhide_folder -> unhideFolder() R.id.exclude_folder -> tryExcludeFolder() - R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true) - R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false) + R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden(true) + R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden(false) R.id.increase_column_count -> increaseColumnCount() R.id.reduce_column_count -> reduceColumnCount() R.id.settings -> launchSettings() @@ -316,6 +316,16 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { false } + private fun tryToggleTemporarilyShowHidden(show: Boolean) { + if (config.temporarilyShowHidden) { + toggleTemporarilyShowHidden(show) + } else { + handleHiddenFolderPasswordProtection { + toggleTemporarilyShowHidden(show) + } + } + } + private fun toggleTemporarilyShowHidden(show: Boolean) { config.temporarilyShowHidden = show getMedia() 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 cee4d7d42..3c46cbb1b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -89,7 +89,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) { - config.temporarilyShowHidden = true + if (!config.isPasswordProtectionOn) + config.temporarilyShowHidden = true } showSystemUI() From 5811f0dc56fb635bb4132932cbcdcf516fc5b96a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 22:06:24 +0200 Subject: [PATCH 089/174] adding the Pattern lock view license --- app/build.gradle | 2 +- .../kotlin/com/simplemobiletools/gallery/extensions/activity.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bcd35c2e4..5a9658b42 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.22.5' + compile 'com.simplemobiletools:commons:2.23.1' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 dabe6ae16..348b54037 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -196,7 +196,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_PHOTOVIEW or LICENSE_SUBSAMPLING, BuildConfig.VERSION_NAME) + or LICENSE_PHOTOVIEW or LICENSE_SUBSAMPLING or LICENSE_PATTERN, BuildConfig.VERSION_NAME) } fun AppCompatActivity.showSystemUI() { From a55943f0f0cec22ff60ef6ebcf41723b7eeaad48 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 29 Jul 2017 22:08:12 +0200 Subject: [PATCH 090/174] make the temporary hidden visibility toggling clearer --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ++-- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 25e104d4c..722a51631 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -212,10 +212,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun tryToggleTemporarilyShowHidden(show: Boolean) { if (config.temporarilyShowHidden) { - toggleTemporarilyShowHidden(show) + toggleTemporarilyShowHidden(false) } else { handleHiddenFolderPasswordProtection { - toggleTemporarilyShowHidden(show) + toggleTemporarilyShowHidden(true) } } } 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 c8f872de6..ec00fa19b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -318,10 +318,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun tryToggleTemporarilyShowHidden(show: Boolean) { if (config.temporarilyShowHidden) { - toggleTemporarilyShowHidden(show) + toggleTemporarilyShowHidden(false) } else { handleHiddenFolderPasswordProtection { - toggleTemporarilyShowHidden(show) + toggleTemporarilyShowHidden(true) } } } From 02ee4dcc037e9ffda04c7b20ab8222b8372fdb1a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 30 Jul 2017 23:07:53 +0200 Subject: [PATCH 091/174] create a viewpager for switching between pattern/pin protection --- .../gallery/adapters/PasswordTypesAdapter.kt | 33 ++++++++ .../gallery/dialogs/PatternDialog.kt | 60 +++------------ .../gallery/views/MyDialogViewPager.kt | 42 ++++++++++ .../gallery/views/PatternTab.kt | 76 +++++++++++++++++++ .../simplemobiletools/gallery/views/PinTab.kt | 11 +++ app/src/main/res/layout/dialog_pattern.xml | 39 ++++++---- app/src/main/res/layout/tab_pattern.xml | 22 ++++++ app/src/main/res/layout/tab_pin.xml | 8 ++ 8 files changed, 227 insertions(+), 64 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt create mode 100644 app/src/main/res/layout/tab_pattern.xml create mode 100644 app/src/main/res/layout/tab_pin.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt new file mode 100644 index 000000000..311c14815 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt @@ -0,0 +1,33 @@ +package com.simplemobiletools.gallery.adapters + +import android.content.Context +import android.support.v4.view.PagerAdapter +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.views.PatternTab + +class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: PatternTab.HashListener) : PagerAdapter() { + + override fun instantiateItem(container: ViewGroup, position: Int): Any { + val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) + container.addView(view) + if (position == 0) + (view as PatternTab).initTab(requiredHash, hashListener) + return view + } + + override fun destroyItem(container: ViewGroup, position: Int, item: Any) { + container.removeView(item as View) + } + + override fun getCount() = 2 + override fun isViewFromObject(view: View, item: Any) = view == item + + private fun layoutSelection(position: Int): Int = when (position) { + 0 -> R.layout.tab_pattern + 1 -> R.layout.tab_pin + else -> throw RuntimeException("Only 2 tabs allowed") + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt index 8a0e45296..8a909c945 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt @@ -1,42 +1,27 @@ package com.simplemobiletools.gallery.dialogs -import android.os.Handler import android.support.v7.app.AlertDialog import android.view.LayoutInflater -import com.andrognito.patternlockview.PatternLockView -import com.andrognito.patternlockview.listener.PatternLockViewListener -import com.andrognito.patternlockview.utils.PatternLockUtils import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity +import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.views.MyDialogViewPager +import com.simplemobiletools.gallery.views.PatternTab import kotlinx.android.synthetic.main.dialog_pattern.view.* -class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) { +class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : PatternTab.HashListener { var dialog: AlertDialog? = null val view = LayoutInflater.from(activity).inflate(R.layout.dialog_pattern, null) - var hash = requiredHash - init { view.apply { - pattern_lock_view.correctStateColor = activity.config.primaryColor - pattern_lock_view.normalStateColor = activity.config.textColor - pattern_lock_view.addPatternLockListener(object : PatternLockViewListener { - override fun onComplete(pattern: MutableList?) { - receivedHash(PatternLockUtils.patternToSha1(pattern_lock_view, pattern)) - } + val textColor = context.config.textColor + dialog_tab_layout.setTabTextColors(textColor, textColor) - override fun onCleared() { - } - - override fun onStarted() { - } - - override fun onProgress(progressPattern: MutableList?) { - } - }) + val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager + viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@PatternDialog) } dialog = AlertDialog.Builder(activity) @@ -46,31 +31,8 @@ class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val } } - private fun receivedHash(newHash: String) { - view.apply { - if (hash.isEmpty()) { - hash = newHash - pattern_lock_view.clearPattern() - pattern_dialog_title.setText(R.string.repeat_pattern) - } else { - if (hash == newHash) { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) - Handler().postDelayed({ - callback(hash) - dialog!!.dismiss() - }, 300) - } else { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) - activity.toast(R.string.wrong_pattern) - Handler().postDelayed({ - pattern_lock_view.clearPattern() - if (requiredHash.isEmpty()) { - hash = "" - pattern_dialog_title.setText(R.string.insert_pattern) - } - }, 1000) - } - } - } + override fun receivedHash(hash: String) { + callback(hash) + dialog!!.dismiss() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt new file mode 100644 index 000000000..e2f820dfe --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt @@ -0,0 +1,42 @@ +package com.simplemobiletools.gallery.views + +import android.content.Context +import android.support.v4.view.ViewPager +import android.util.AttributeSet +import android.view.MotionEvent +import android.view.View + +class MyDialogViewPager : ViewPager { + + constructor(context: Context) : super(context) + + constructor(context: Context, attrs: AttributeSet) : super(context, attrs) + + // disable manual swiping of viewpager at the dialog + override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { + return false + } + + override fun onTouchEvent(ev: MotionEvent): Boolean { + try { + return super.onTouchEvent(ev) + } catch (ignored: Exception) { + } + + return false + } + + // https://stackoverflow.com/a/20784791/1967672 + override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { + var height = 0 + for (i in 0..childCount - 1) { + val child = getChildAt(i) + child.measure(widthMeasureSpec, View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)) + val h = child.measuredHeight + if (h > height) height = h + } + + val newHeightMeasureSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY) + super.onMeasure(widthMeasureSpec, newHeightMeasureSpec) + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt new file mode 100644 index 000000000..5aada4281 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt @@ -0,0 +1,76 @@ +package com.simplemobiletools.gallery.views + +import android.content.Context +import android.os.Handler +import android.util.AttributeSet +import android.widget.RelativeLayout +import com.andrognito.patternlockview.PatternLockView +import com.andrognito.patternlockview.listener.PatternLockViewListener +import com.andrognito.patternlockview.utils.PatternLockUtils +import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.extensions.config +import kotlinx.android.synthetic.main.tab_pattern.view.* + +class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { + var hash = "" + var requiredHash = "" + lateinit var hashListener: HashListener + + override fun onFinishInflate() { + super.onFinishInflate() + val textColor = context.config.textColor + pattern_lock_title.setTextColor(textColor) + pattern_lock_view.correctStateColor = context.config.primaryColor + pattern_lock_view.normalStateColor = textColor + pattern_lock_view.addPatternLockListener(object : PatternLockViewListener { + override fun onComplete(pattern: MutableList?) { + receivedHash(PatternLockUtils.patternToSha1(pattern_lock_view, pattern)) + } + + override fun onCleared() { + } + + override fun onStarted() { + } + + override fun onProgress(progressPattern: MutableList?) { + } + }) + } + + fun initTab(requiredHash: String, listener: HashListener) { + this.requiredHash = requiredHash + hash = requiredHash + hashListener = listener + } + + private fun receivedHash(newHash: String) { + if (hash.isEmpty()) { + hash = newHash + pattern_lock_view.clearPattern() + pattern_lock_title.setText(R.string.repeat_pattern) + } else { + if (hash == newHash) { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) + Handler().postDelayed({ + hashListener.receivedHash(hash) + }, 300) + } else { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) + context.toast(R.string.wrong_pattern) + Handler().postDelayed({ + pattern_lock_view.clearPattern() + if (requiredHash.isEmpty()) { + hash = "" + pattern_lock_title.setText(R.string.insert_pattern) + } + }, 1000) + } + } + } + + interface HashListener { + fun receivedHash(hash: String) + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt new file mode 100644 index 000000000..0af058ebc --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -0,0 +1,11 @@ +package com.simplemobiletools.gallery.views + +import android.content.Context +import android.util.AttributeSet +import android.widget.RelativeLayout + +class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { + override fun onFinishInflate() { + super.onFinishInflate() + } +} diff --git a/app/src/main/res/layout/dialog_pattern.xml b/app/src/main/res/layout/dialog_pattern.xml index e900eb2f9..5cebd31ea 100644 --- a/app/src/main/res/layout/dialog_pattern.xml +++ b/app/src/main/res/layout/dialog_pattern.xml @@ -1,22 +1,31 @@ + android:id="@+id/dialog_holder" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> - + + + + + + + + - - + android:layout_below="@+id/dialog_tab_layout"/> diff --git a/app/src/main/res/layout/tab_pattern.xml b/app/src/main/res/layout/tab_pattern.xml new file mode 100644 index 000000000..13cae2fcb --- /dev/null +++ b/app/src/main/res/layout/tab_pattern.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/app/src/main/res/layout/tab_pin.xml b/app/src/main/res/layout/tab_pin.xml new file mode 100644 index 000000000..33f0f93a1 --- /dev/null +++ b/app/src/main/res/layout/tab_pin.xml @@ -0,0 +1,8 @@ + + + + From 9099aa176da1e8a204cfaa7f1f3ea86076691853 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 30 Jul 2017 23:13:02 +0200 Subject: [PATCH 092/174] remove some redundant variables --- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 +++--- .../simplemobiletools/gallery/activities/MediaActivity.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 722a51631..4f769e462 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -97,8 +97,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { R.id.sort -> showSortingDialog() R.id.open_camera -> launchCamera() R.id.show_all -> showAllMedia() - R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden(true) - R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden(false) + R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() + R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden() R.id.increase_column_count -> increaseColumnCount() R.id.reduce_column_count -> reduceColumnCount() R.id.settings -> launchSettings() @@ -210,7 +210,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { finish() } - private fun tryToggleTemporarilyShowHidden(show: Boolean) { + private fun tryToggleTemporarilyShowHidden() { if (config.temporarilyShowHidden) { toggleTemporarilyShowHidden(false) } else { 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 ec00fa19b..55c1f801a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -216,8 +216,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { R.id.hide_folder -> tryHideFolder() R.id.unhide_folder -> unhideFolder() R.id.exclude_folder -> tryExcludeFolder() - R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden(true) - R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden(false) + R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() + R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden() R.id.increase_column_count -> increaseColumnCount() R.id.reduce_column_count -> reduceColumnCount() R.id.settings -> launchSettings() @@ -316,7 +316,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { false } - private fun tryToggleTemporarilyShowHidden(show: Boolean) { + private fun tryToggleTemporarilyShowHidden() { if (config.temporarilyShowHidden) { toggleTemporarilyShowHidden(false) } else { From 615c49407d43b199dfbf9f0129e1687355ace278 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 31 Jul 2017 22:00:22 +0200 Subject: [PATCH 093/174] rename PatternDialog to SecurityDialog --- .../gallery/activities/SettingsActivity.kt | 4 ++-- .../dialogs/{PatternDialog.kt => SecurityDialog.kt} | 8 ++++---- .../com/simplemobiletools/gallery/extensions/activity.kt | 4 ++-- .../layout/{dialog_pattern.xml => dialog_security.xml} | 0 4 files changed, 8 insertions(+), 8 deletions(-) rename app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/{PatternDialog.kt => SecurityDialog.kt} (83%) rename app/src/main/res/layout/{dialog_pattern.xml => dialog_security.xml} (100%) 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 115ce1bd6..4e26b5f8b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -7,7 +7,7 @@ import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.dialogs.PatternDialog +import com.simplemobiletools.gallery.dialogs.SecurityDialog import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.handleHiddenFolderPasswordProtection import com.simplemobiletools.gallery.helpers.* @@ -155,7 +155,7 @@ class SettingsActivity : SimpleActivity() { private fun setupPasswordProtection() { settings_password_protection.isChecked = config.isPasswordProtectionOn settings_password_protection_holder.setOnClickListener { - PatternDialog(this, config.passwordHash) { + SecurityDialog(this, config.passwordHash) { val hasPasswordProtection = config.isPasswordProtectionOn settings_password_protection.isChecked = !hasPasswordProtection config.isPasswordProtectionOn = !hasPasswordProtection diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt similarity index 83% rename from app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index 8a909c945..e28ea54ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -9,11 +9,11 @@ import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.views.MyDialogViewPager import com.simplemobiletools.gallery.views.PatternTab -import kotlinx.android.synthetic.main.dialog_pattern.view.* +import kotlinx.android.synthetic.main.dialog_security.view.* -class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : PatternTab.HashListener { +class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : PatternTab.HashListener { var dialog: AlertDialog? = null - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_pattern, null) + val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) init { view.apply { @@ -21,7 +21,7 @@ class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val dialog_tab_layout.setTabTextColors(textColor, textColor) val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager - viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@PatternDialog) + viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) } dialog = AlertDialog.Builder(activity) 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 348b54037..fa035db0e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -24,7 +24,7 @@ import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity -import com.simplemobiletools.gallery.dialogs.PatternDialog +import com.simplemobiletools.gallery.dialogs.SecurityDialog import com.simplemobiletools.gallery.helpers.NOMEDIA import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.gallery.helpers.REQUEST_SET_AS @@ -335,7 +335,7 @@ fun Activity.loadStaticGif(path: String, target: MySquareImageView) { fun SimpleActivity.handleHiddenFolderPasswordProtection(callback: () -> Unit) { if (config.isPasswordProtectionOn) { - PatternDialog(this, config.passwordHash) { + SecurityDialog(this, config.passwordHash) { callback() } } else { diff --git a/app/src/main/res/layout/dialog_pattern.xml b/app/src/main/res/layout/dialog_security.xml similarity index 100% rename from app/src/main/res/layout/dialog_pattern.xml rename to app/src/main/res/layout/dialog_security.xml From 05da8af5e01b677859757f79e20849f4c85a9848 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 31 Jul 2017 22:10:32 +0200 Subject: [PATCH 094/174] sync the viewpager with tablayout at the security dialog --- .../gallery/dialogs/SecurityDialog.kt | 30 ++++++++++++++++++- app/src/main/res/layout/dialog_security.xml | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index e28ea54ba..a8a8d60e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -1,5 +1,7 @@ package com.simplemobiletools.gallery.dialogs +import android.support.design.widget.TabLayout +import android.support.v4.view.ViewPager import android.support.v7.app.AlertDialog import android.view.LayoutInflater import com.simplemobiletools.commons.extensions.setupDialogStuff @@ -17,11 +19,37 @@ class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val init { view.apply { + val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager val textColor = context.config.textColor dialog_tab_layout.setTabTextColors(textColor, textColor) + dialog_tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { + override fun onTabReselected(tab: TabLayout.Tab?) { + } + + override fun onTabUnselected(tab: TabLayout.Tab) { + } + + override fun onTabSelected(tab: TabLayout.Tab) { + if (tab.text.toString().equals(resources.getString(R.string.pattern), true)) { + viewPager.currentItem = 0 + } else { + viewPager.currentItem = 1 + } + } + }) - val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) + viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { + override fun onPageScrollStateChanged(state: Int) { + } + + override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { + } + + override fun onPageSelected(position: Int) { + dialog_tab_layout.getTabAt(position)!!.select() + } + }) } dialog = AlertDialog.Builder(activity) diff --git a/app/src/main/res/layout/dialog_security.xml b/app/src/main/res/layout/dialog_security.xml index 5cebd31ea..993c05bfa 100644 --- a/app/src/main/res/layout/dialog_security.xml +++ b/app/src/main/res/layout/dialog_security.xml @@ -11,11 +11,13 @@ android:layout_height="wrap_content"> From b10306a9b91ad6d3b21da4e1f55bf3f8cc117719 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 31 Jul 2017 22:24:48 +0200 Subject: [PATCH 095/174] use the primary color for selecting tablayout current item --- .../com/simplemobiletools/gallery/dialogs/SecurityDialog.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index a8a8d60e7..55d0064d5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -22,6 +22,7 @@ class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager val textColor = context.config.textColor dialog_tab_layout.setTabTextColors(textColor, textColor) + dialog_tab_layout.setSelectedTabIndicatorColor(context.config.primaryColor) dialog_tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { override fun onTabReselected(tab: TabLayout.Tab?) { } From 67d6b0482e40dcfb69fc5d516be23345182aead3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 31 Jul 2017 22:44:55 +0200 Subject: [PATCH 096/174] add asterisks at entering pin code --- .../gallery/views/PatternTab.kt | 3 ++- .../simplemobiletools/gallery/views/PinTab.kt | 3 +++ app/src/main/res/layout/tab_pin.xml | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt index 5aada4281..b2a6e0239 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt @@ -8,6 +8,7 @@ import com.andrognito.patternlockview.PatternLockView import com.andrognito.patternlockview.listener.PatternLockViewListener import com.andrognito.patternlockview.utils.PatternLockUtils import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config import kotlinx.android.synthetic.main.tab_pattern.view.* @@ -20,7 +21,7 @@ class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context override fun onFinishInflate() { super.onFinishInflate() val textColor = context.config.textColor - pattern_lock_title.setTextColor(textColor) + context.updateTextColors(pattern_lock_holder) pattern_lock_view.correctStateColor = context.config.primaryColor pattern_lock_view.normalStateColor = textColor pattern_lock_view.addPatternLockListener(object : PatternLockViewListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt index 0af058ebc..d7ab33618 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -3,9 +3,12 @@ package com.simplemobiletools.gallery.views import android.content.Context import android.util.AttributeSet import android.widget.RelativeLayout +import com.simplemobiletools.commons.extensions.updateTextColors +import kotlinx.android.synthetic.main.tab_pin.view.* class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { override fun onFinishInflate() { super.onFinishInflate() + context.updateTextColors(pin_lock_holder) } } diff --git a/app/src/main/res/layout/tab_pin.xml b/app/src/main/res/layout/tab_pin.xml index 33f0f93a1..91f41ae59 100644 --- a/app/src/main/res/layout/tab_pin.xml +++ b/app/src/main/res/layout/tab_pin.xml @@ -5,4 +5,25 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> + + + + From 16a5637d712d399eaf0a73cb8a4489aa8b771608 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 Aug 2017 21:53:59 +0200 Subject: [PATCH 097/174] add the numbers grid at the Pin tab --- .../simplemobiletools/gallery/views/PinTab.kt | 25 ++++ app/src/main/res/layout/tab_pin.xml | 132 ++++++++++++++++++ app/src/main/res/values-v21/styles.xml | 5 + app/src/main/res/values/styles.xml | 11 ++ 4 files changed, 173 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt index d7ab33618..b8eef638e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -10,5 +10,30 @@ class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, at override fun onFinishInflate() { super.onFinishInflate() context.updateTextColors(pin_lock_holder) + + pin_0.setOnClickListener { addNumber(0) } + pin_1.setOnClickListener { addNumber(1) } + pin_2.setOnClickListener { addNumber(2) } + pin_3.setOnClickListener { addNumber(3) } + pin_4.setOnClickListener { addNumber(4) } + pin_5.setOnClickListener { addNumber(5) } + pin_6.setOnClickListener { addNumber(6) } + pin_7.setOnClickListener { addNumber(7) } + pin_8.setOnClickListener { addNumber(8) } + pin_9.setOnClickListener { addNumber(9) } + pin_c.setOnClickListener { clear() } + pin_ok.setOnClickListener { confirmPIN() } + } + + private fun addNumber(number: Int) { + + } + + private fun clear() { + + } + + private fun confirmPIN() { + } } diff --git a/app/src/main/res/layout/tab_pin.xml b/app/src/main/res/layout/tab_pin.xml index 91f41ae59..125bb7579 100644 --- a/app/src/main/res/layout/tab_pin.xml +++ b/app/src/main/res/layout/tab_pin.xml @@ -26,4 +26,136 @@ android:paddingTop="@dimen/small_margin" android:textSize="@dimen/big_text_size"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 11e77efc5..65e4ec22c 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -3,4 +3,9 @@ + + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index f730c8f58..bc2a7b38e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -15,4 +15,15 @@ + + + + + From 2684fde1073f80c3531525f8422796d73c613df9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 Aug 2017 22:18:12 +0200 Subject: [PATCH 098/174] show asterisks at inserting pin --- .../simplemobiletools/gallery/views/PinTab.kt | 38 ++++++++++++------- app/src/main/res/layout/tab_pin.xml | 2 + 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt index b8eef638e..a800834fb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -7,33 +7,45 @@ import com.simplemobiletools.commons.extensions.updateTextColors import kotlinx.android.synthetic.main.tab_pin.view.* class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { + var pin = "" + override fun onFinishInflate() { super.onFinishInflate() context.updateTextColors(pin_lock_holder) - pin_0.setOnClickListener { addNumber(0) } - pin_1.setOnClickListener { addNumber(1) } - pin_2.setOnClickListener { addNumber(2) } - pin_3.setOnClickListener { addNumber(3) } - pin_4.setOnClickListener { addNumber(4) } - pin_5.setOnClickListener { addNumber(5) } - pin_6.setOnClickListener { addNumber(6) } - pin_7.setOnClickListener { addNumber(7) } - pin_8.setOnClickListener { addNumber(8) } - pin_9.setOnClickListener { addNumber(9) } + pin_0.setOnClickListener { addNumber("0") } + pin_1.setOnClickListener { addNumber("1") } + pin_2.setOnClickListener { addNumber("2") } + pin_3.setOnClickListener { addNumber("3") } + pin_4.setOnClickListener { addNumber("4") } + pin_5.setOnClickListener { addNumber("5") } + pin_6.setOnClickListener { addNumber("6") } + pin_7.setOnClickListener { addNumber("7") } + pin_8.setOnClickListener { addNumber("8") } + pin_9.setOnClickListener { addNumber("9") } pin_c.setOnClickListener { clear() } pin_ok.setOnClickListener { confirmPIN() } } - private fun addNumber(number: Int) { - + private fun addNumber(number: String) { + if (pin.length < 10) { + pin += number + updatePinCode() + } } private fun clear() { - + if (pin.isNotEmpty()) { + pin = pin.substring(0, pin.length - 1) + updatePinCode() + } } private fun confirmPIN() { } + + private fun updatePinCode() { + pin_lock_current_pin.text = "*".repeat(pin.length) + } } diff --git a/app/src/main/res/layout/tab_pin.xml b/app/src/main/res/layout/tab_pin.xml index 125bb7579..9645647ae 100644 --- a/app/src/main/res/layout/tab_pin.xml +++ b/app/src/main/res/layout/tab_pin.xml @@ -22,6 +22,8 @@ android:layout_below="@+id/pin_lock_title" android:gravity="center" android:letterSpacing="1.05" + android:lines="1" + android:maxLength="10" android:paddingBottom="@dimen/small_margin" android:paddingTop="@dimen/small_margin" android:textSize="@dimen/big_text_size"/> From 805633dfb6fcec6bd3415fe1aaaa348bf7fe1dc9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 Aug 2017 23:34:28 +0200 Subject: [PATCH 099/174] move the HashListener interface in a separate file --- .../gallery/adapters/PasswordTypesAdapter.kt | 3 ++- .../com/simplemobiletools/gallery/dialogs/SecurityDialog.kt | 4 ++-- .../com/simplemobiletools/gallery/interfaces/HashListener.kt | 5 +++++ .../kotlin/com/simplemobiletools/gallery/views/PatternTab.kt | 5 +---- 4 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt index 311c14815..ca462f8b6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt @@ -6,9 +6,10 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.views.PatternTab -class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: PatternTab.HashListener) : PagerAdapter() { +class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener) : PagerAdapter() { override fun instantiateItem(container: ViewGroup, position: Int): Any { val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index 55d0064d5..1f9cbd59c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -9,11 +9,11 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.views.MyDialogViewPager -import com.simplemobiletools.gallery.views.PatternTab import kotlinx.android.synthetic.main.dialog_security.view.* -class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : PatternTab.HashListener { +class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : HashListener { var dialog: AlertDialog? = null val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt new file mode 100644 index 000000000..e8145070c --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt @@ -0,0 +1,5 @@ +package com.simplemobiletools.gallery.interfaces + +interface HashListener { + fun receivedHash(hash: String) +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt index b2a6e0239..304974d98 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.interfaces.HashListener import kotlinx.android.synthetic.main.tab_pattern.view.* class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { @@ -70,8 +71,4 @@ class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context } } } - - interface HashListener { - fun receivedHash(hash: String) - } } From f0ace2f57d8631d331b4480a1da5c58fefd12810 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 00:00:32 +0200 Subject: [PATCH 100/174] add the functionality to the PIN fragment --- .../gallery/adapters/PasswordTypesAdapter.kt | 5 +- .../gallery/interfaces/SecurityTab.kt | 5 ++ .../gallery/views/PatternTab.kt | 39 +++++++-------- .../simplemobiletools/gallery/views/PinTab.kt | 49 ++++++++++++++++++- app/src/main/res/layout/tab_pin.xml | 25 +++++----- app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 5 +- app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 22 files changed, 105 insertions(+), 39 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt index ca462f8b6..4d92c275d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt @@ -7,15 +7,14 @@ import android.view.View import android.view.ViewGroup import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.interfaces.HashListener -import com.simplemobiletools.gallery.views.PatternTab +import com.simplemobiletools.gallery.interfaces.SecurityTab class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener) : PagerAdapter() { override fun instantiateItem(container: ViewGroup, position: Int): Any { val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) container.addView(view) - if (position == 0) - (view as PatternTab).initTab(requiredHash, hashListener) + (view as SecurityTab).initTab(requiredHash, hashListener) return view } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt new file mode 100644 index 000000000..000818e1f --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt @@ -0,0 +1,5 @@ +package com.simplemobiletools.gallery.interfaces + +interface SecurityTab { + fun initTab(requiredHash: String, listener: HashListener) +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt index 304974d98..0ca2b3aab 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt @@ -12,11 +12,12 @@ import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.interfaces.HashListener +import com.simplemobiletools.gallery.interfaces.SecurityTab import kotlinx.android.synthetic.main.tab_pattern.view.* -class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { - var hash = "" - var requiredHash = "" +class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs), SecurityTab { + private var hash = "" + private var requiredHash = "" lateinit var hashListener: HashListener override fun onFinishInflate() { @@ -41,7 +42,7 @@ class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context }) } - fun initTab(requiredHash: String, listener: HashListener) { + override fun initTab(requiredHash: String, listener: HashListener) { this.requiredHash = requiredHash hash = requiredHash hashListener = listener @@ -52,23 +53,21 @@ class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context hash = newHash pattern_lock_view.clearPattern() pattern_lock_title.setText(R.string.repeat_pattern) + } else if (hash == newHash) { + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) + Handler().postDelayed({ + hashListener.receivedHash(hash) + }, 300) } else { - if (hash == newHash) { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) - Handler().postDelayed({ - hashListener.receivedHash(hash) - }, 300) - } else { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) - context.toast(R.string.wrong_pattern) - Handler().postDelayed({ - pattern_lock_view.clearPattern() - if (requiredHash.isEmpty()) { - hash = "" - pattern_lock_title.setText(R.string.insert_pattern) - } - }, 1000) - } + pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) + context.toast(R.string.wrong_pattern) + Handler().postDelayed({ + pattern_lock_view.clearPattern() + if (requiredHash.isEmpty()) { + hash = "" + pattern_lock_title.setText(R.string.insert_pattern) + } + }, 1000) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt index a800834fb..a7b7a24f2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -3,11 +3,21 @@ package com.simplemobiletools.gallery.views import android.content.Context import android.util.AttributeSet import android.widget.RelativeLayout +import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors +import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.interfaces.HashListener +import com.simplemobiletools.gallery.interfaces.SecurityTab import kotlinx.android.synthetic.main.tab_pin.view.* +import java.math.BigInteger +import java.security.MessageDigest +import java.util.* -class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { - var pin = "" +class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs), SecurityTab { + private var hash = "" + private var requiredHash = "" + private var pin = "" + lateinit var hashListener: HashListener override fun onFinishInflate() { super.onFinishInflate() @@ -27,6 +37,12 @@ class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, at pin_ok.setOnClickListener { confirmPIN() } } + override fun initTab(requiredHash: String, listener: HashListener) { + this.requiredHash = requiredHash + hash = requiredHash + hashListener = listener + } + private fun addNumber(number: String) { if (pin.length < 10) { pin += number @@ -42,10 +58,39 @@ class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, at } private fun confirmPIN() { + val newHash = getHashedPin() + if (pin.isEmpty()) { + context.toast(R.string.please_enter_pin) + } else if (hash.isEmpty()) { + hash = newHash + resetPin() + pin_lock_title.setText(R.string.repeat_pin) + } else if (hash == newHash) { + hashListener.receivedHash(hash) + } else { + resetPin() + context.toast(R.string.wrong_pin) + if (requiredHash.isEmpty()) { + hash = "" + pin_lock_title.setText(R.string.enter_pin) + } + } + } + private fun resetPin() { + pin = "" + pin_lock_current_pin.text = "" } private fun updatePinCode() { pin_lock_current_pin.text = "*".repeat(pin.length) } + + private fun getHashedPin(): String { + val messageDigest = MessageDigest.getInstance("SHA-1") + messageDigest.update(pin.toByteArray(charset("UTF-8"))) + val digest = messageDigest.digest() + val bigInteger = BigInteger(1, digest) + return String.format(Locale.getDefault(), "%0${digest.size * 2}x", bigInteger).toLowerCase() + } } diff --git a/app/src/main/res/layout/tab_pin.xml b/app/src/main/res/layout/tab_pin.xml index 9645647ae..8a7c27695 100644 --- a/app/src/main/res/layout/tab_pin.xml +++ b/app/src/main/res/layout/tab_pin.xml @@ -45,7 +45,7 @@ android:id="@+id/pin_1" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="1"/> @@ -53,7 +53,7 @@ android:id="@+id/pin_2" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="2"/> @@ -61,7 +61,7 @@ android:id="@+id/pin_3" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="3"/> @@ -76,7 +76,7 @@ android:id="@+id/pin_4" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="4"/> @@ -84,7 +84,7 @@ android:id="@+id/pin_5" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="5"/> @@ -92,7 +92,7 @@ android:id="@+id/pin_6" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="6"/> @@ -107,7 +107,7 @@ android:id="@+id/pin_7" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="7"/> @@ -115,7 +115,7 @@ android:id="@+id/pin_8" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="8"/> @@ -123,7 +123,7 @@ android:id="@+id/pin_9" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="9"/> @@ -138,7 +138,7 @@ android:id="@+id/pin_c" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="C"/> @@ -146,7 +146,7 @@ android:id="@+id/pin_0" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:text="0"/> @@ -154,8 +154,9 @@ android:id="@+id/pin_ok" style="@style/PinNumberStyle" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" + android:padding="@dimen/activity_margin" android:src="@drawable/ic_check"/> diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 73053a373..90067954a 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 01261c7dc..0562ca799 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7dba19efd..be65972a7 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f1fd9704e..7a7f80b52 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 4ac31db20..60164e60a 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9195f6eb3..8f24b2f65 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 80e7abac5..6ca1e4fee 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 9242085a7..157bdd30c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 0d504ea11..9405ca4eb 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -76,12 +76,13 @@ Aplicativo não encontrado Definindo como papel de parede; Papel de parede com sucesso - Retrato - Paisagem + Retrato + Paisagem PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 60919649b..d2a173d8b 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index fde9bbde2..0e1aa9b87 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 23781cf9e..d7edc2cb6 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -82,6 +82,7 @@ PIN Zadajte PIN + Prosím zadajte PIN Nesprávny PIN Zopakujte PIN Vzor diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index d567a7964..8b3e840ec 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index e1c255b99..fad2fcdcd 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 552305e1a..0ed778250 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 02e71ea97..35f323e3c 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e8352b0cd..ee31aee06 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -82,6 +82,7 @@ PIN Enter PIN + Please enter a PIN Wrong PIN Repeat PIN Pattern From 51f07c9fa61a1f6637069d3b4c03c990605ee68d Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 22:14:05 +0200 Subject: [PATCH 101/174] store the protection type too, pattern/pin --- .../gallery/activities/SettingsActivity.kt | 5 +++-- .../com/simplemobiletools/gallery/dialogs/SecurityDialog.kt | 6 +++--- .../com/simplemobiletools/gallery/extensions/activity.kt | 2 +- .../kotlin/com/simplemobiletools/gallery/helpers/Config.kt | 4 ++++ .../com/simplemobiletools/gallery/helpers/Constants.kt | 6 ++++++ .../simplemobiletools/gallery/interfaces/HashListener.kt | 2 +- .../com/simplemobiletools/gallery/views/PatternTab.kt | 3 ++- .../kotlin/com/simplemobiletools/gallery/views/PinTab.kt | 3 ++- 8 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 4e26b5f8b..c7da656d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -155,11 +155,12 @@ class SettingsActivity : SimpleActivity() { private fun setupPasswordProtection() { settings_password_protection.isChecked = config.isPasswordProtectionOn settings_password_protection_holder.setOnClickListener { - SecurityDialog(this, config.passwordHash) { + SecurityDialog(this, config.passwordHash) { hash, type -> val hasPasswordProtection = config.isPasswordProtectionOn settings_password_protection.isChecked = !hasPasswordProtection config.isPasswordProtectionOn = !hasPasswordProtection - config.passwordHash = if (hasPasswordProtection) "" else it + config.passwordHash = if (hasPasswordProtection) "" else hash + config.protectionType = PROTECTION_PATTERN } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index 1f9cbd59c..f6a6a6b15 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -13,7 +13,7 @@ import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.views.MyDialogViewPager import kotlinx.android.synthetic.main.dialog_security.view.* -class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : HashListener { +class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String, type: Int) -> Unit) : HashListener { var dialog: AlertDialog? = null val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) @@ -60,8 +60,8 @@ class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val } } - override fun receivedHash(hash: String) { - callback(hash) + override fun receivedHash(hash: String, type: Int) { + callback(hash, type) dialog!!.dismiss() } } 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 fa035db0e..cc914d82e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -335,7 +335,7 @@ fun Activity.loadStaticGif(path: String, target: MySquareImageView) { fun SimpleActivity.handleHiddenFolderPasswordProtection(callback: () -> Unit) { if (config.isPasswordProtectionOn) { - SecurityDialog(this, config.passwordHash) { + SecurityDialog(this, config.passwordHash) { hash, type -> callback() } } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index d02c78187..89037e81b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -240,4 +240,8 @@ class Config(context: Context) : BaseConfig(context) { var passwordHash: String get() = prefs.getString(PASSWORD_HASH, "") set(passwordHash) = prefs.edit().putString(PASSWORD_HASH, passwordHash).apply() + + var protectionType: Int + get() = prefs.getInt(PROTECTION_TYPE, PROTECTION_PATTERN) + set(protectionType) = prefs.edit().putInt(PROTECTION_TYPE, protectionType).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 01d829cc2..0dbfbbf1f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -35,6 +35,7 @@ val HIDE_SYSTEM_UI = "hide_system_ui" val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" val IS_PASSWORD_PROTECTION = "password_protection" val PASSWORD_HASH = "password_hash" +val PROTECTION_TYPE = "protection_type" val NOMEDIA = ".nomedia" @@ -64,3 +65,8 @@ val ORIENT_PORTRAIT = 0 val ORIENT_LANDSCAPE_LEFT = 1 val ORIENT_LANDSCAPE_RIGHT = 2 val ORIENT_UPSIDE_DOWN = 3 + +// security +val PROTECTION_PATTERN = 1 +val PROTECTION_PIN = 2 +val PROTECTION_FINGERPRINT = 3 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt index e8145070c..2549eb4db 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt @@ -1,5 +1,5 @@ package com.simplemobiletools.gallery.interfaces interface HashListener { - fun receivedHash(hash: String) + fun receivedHash(hash: String, type: Int) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt index 0ca2b3aab..9200f797e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.helpers.PROTECTION_PATTERN import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.interfaces.SecurityTab import kotlinx.android.synthetic.main.tab_pattern.view.* @@ -56,7 +57,7 @@ class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context } else if (hash == newHash) { pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) Handler().postDelayed({ - hashListener.receivedHash(hash) + hashListener.receivedHash(hash, PROTECTION_PATTERN) }, 300) } else { pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt index a7b7a24f2..68614824d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -6,6 +6,7 @@ import android.widget.RelativeLayout import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.helpers.PROTECTION_PIN import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.interfaces.SecurityTab import kotlinx.android.synthetic.main.tab_pin.view.* @@ -66,7 +67,7 @@ class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, at resetPin() pin_lock_title.setText(R.string.repeat_pin) } else if (hash == newHash) { - hashListener.receivedHash(hash) + hashListener.receivedHash(hash, PROTECTION_PIN) } else { resetPin() context.toast(R.string.wrong_pin) From 45e1fba5352301fcdcc7fe714a9f41de20eda779 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 22:25:02 +0200 Subject: [PATCH 102/174] update commons to 2.23.2 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 5a9658b42..75900a6bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.23.1' + compile 'com.simplemobiletools:commons:2.23.2' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From 6e1f56f86496a36105e69bd1062fbcabbf8ffb28 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 22:56:26 +0200 Subject: [PATCH 103/174] do not allow swiping the protection viewpager when a password is set --- .../gallery/activities/SettingsActivity.kt | 5 +- .../gallery/dialogs/SecurityDialog.kt | 48 +++++++++++-------- .../gallery/extensions/activity.kt | 2 +- .../gallery/helpers/Constants.kt | 10 ++-- .../gallery/views/MyDialogViewPager.kt | 6 ++- 5 files changed, 44 insertions(+), 27 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index c7da656d8..5b32968ec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -155,12 +155,13 @@ class SettingsActivity : SimpleActivity() { private fun setupPasswordProtection() { settings_password_protection.isChecked = config.isPasswordProtectionOn settings_password_protection_holder.setOnClickListener { - SecurityDialog(this, config.passwordHash) { hash, type -> + val tabToShow = if (config.isPasswordProtectionOn) config.protectionType else SHOW_ALL_TABS + SecurityDialog(this, config.passwordHash, tabToShow) { hash, type -> val hasPasswordProtection = config.isPasswordProtectionOn settings_password_protection.isChecked = !hasPasswordProtection config.isPasswordProtectionOn = !hasPasswordProtection config.passwordHash = if (hasPasswordProtection) "" else hash - config.protectionType = PROTECTION_PATTERN + config.protectionType = type } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index f6a6a6b15..c732125ee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -4,41 +4,24 @@ import android.support.design.widget.TabLayout import android.support.v4.view.ViewPager import android.support.v7.app.AlertDialog import android.view.LayoutInflater +import com.simplemobiletools.commons.extensions.beGone import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.helpers.SHOW_ALL_TABS import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.views.MyDialogViewPager import kotlinx.android.synthetic.main.dialog_security.view.* -class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String, type: Int) -> Unit) : HashListener { +class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val showTabIndex: Int, val callback: (hash: String, type: Int) -> Unit) : HashListener { var dialog: AlertDialog? = null val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) init { view.apply { val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager - val textColor = context.config.textColor - dialog_tab_layout.setTabTextColors(textColor, textColor) - dialog_tab_layout.setSelectedTabIndicatorColor(context.config.primaryColor) - dialog_tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { - override fun onTabReselected(tab: TabLayout.Tab?) { - } - - override fun onTabUnselected(tab: TabLayout.Tab) { - } - - override fun onTabSelected(tab: TabLayout.Tab) { - if (tab.text.toString().equals(resources.getString(R.string.pattern), true)) { - viewPager.currentItem = 0 - } else { - viewPager.currentItem = 1 - } - } - }) - viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { override fun onPageScrollStateChanged(state: Int) { @@ -51,6 +34,31 @@ class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val dialog_tab_layout.getTabAt(position)!!.select() } }) + + if (showTabIndex == SHOW_ALL_TABS) { + val textColor = context.config.textColor + dialog_tab_layout.setTabTextColors(textColor, textColor) + dialog_tab_layout.setSelectedTabIndicatorColor(context.config.primaryColor) + dialog_tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { + override fun onTabReselected(tab: TabLayout.Tab?) { + } + + override fun onTabUnselected(tab: TabLayout.Tab) { + } + + override fun onTabSelected(tab: TabLayout.Tab) { + if (tab.text.toString().equals(resources.getString(R.string.pattern), true)) { + viewPager.currentItem = 0 + } else { + viewPager.currentItem = 1 + } + } + }) + } else { + dialog_tab_layout.beGone() + viewPager.currentItem = showTabIndex + viewPager.allowSwiping = false + } } dialog = AlertDialog.Builder(activity) 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 cc914d82e..00af3ac71 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -335,7 +335,7 @@ fun Activity.loadStaticGif(path: String, target: MySquareImageView) { fun SimpleActivity.handleHiddenFolderPasswordProtection(callback: () -> Unit) { if (config.isPasswordProtectionOn) { - SecurityDialog(this, config.passwordHash) { hash, type -> + SecurityDialog(this, config.passwordHash, config.protectionType) { hash, type -> callback() } } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 0dbfbbf1f..5b946fd5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -67,6 +67,10 @@ val ORIENT_LANDSCAPE_RIGHT = 2 val ORIENT_UPSIDE_DOWN = 3 // security -val PROTECTION_PATTERN = 1 -val PROTECTION_PIN = 2 -val PROTECTION_FINGERPRINT = 3 +val PROTECTION_PATTERN = 0 +val PROTECTION_PIN = 1 +val PROTECTION_FINGERPRINT = 2 + +val SHOW_ALL_TABS = -1 +val SHOW_PATTERN = 0 +val SHOW_PIN = 1 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt index e2f820dfe..5268e3a07 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt @@ -7,17 +7,21 @@ import android.view.MotionEvent import android.view.View class MyDialogViewPager : ViewPager { + var allowSwiping = true constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet) : super(context, attrs) - // disable manual swiping of viewpager at the dialog + // disable manual swiping of viewpager at the dialog by swiping over the pattern override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { return false } override fun onTouchEvent(ev: MotionEvent): Boolean { + if (!allowSwiping) + return false + try { return super.onTouchEvent(ev) } catch (ignored: Exception) { From ae3555b1c5a979a20c3d4bb697ff3ec9ad5347d0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:12:48 +0200 Subject: [PATCH 104/174] add some array size checks at deleting from media/directory view --- .../gallery/adapters/DirectoryAdapter.kt | 12 +++++++----- .../gallery/adapters/MediaAdapter.kt | 5 +++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index d1845938e..391386562 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -297,11 +297,13 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList it) { + val directory = dirs[it] + folders.add(File(directory.path)) + removeFolders.add(directory) + notifyItemRemoved(it) + itemViews.put(it, null) + } } dirs.removeAll(removeFolders) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index d62a63df9..7f8b511e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -232,6 +232,11 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, val files = ArrayList(selectedPositions.size) val removeMedia = ArrayList(selectedPositions.size) + if (media.size <= selectedPositions.first()) { + actMode?.finish() + return + } + activity.handleSAFDialog(File(media[selectedPositions.first()].path)) { selectedPositions.sortedDescending().forEach { val medium = media[it] From f269c70e5656e9730448f9dcb40cfba85388181a Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:14:56 +0200 Subject: [PATCH 105/174] make fragment in photoVideoActivity nullable --- .../gallery/activities/PhotoVideoActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 defe41a5f..36eb2aa1c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -31,9 +31,9 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList private val STORAGE_PERMISSION = 1 private var mMedium: Medium? = null private var mIsFullScreen = false + private var mFragment: ViewPagerFragment? = null lateinit var mUri: Uri - lateinit var mFragment: ViewPagerFragment companion object { var mIsVideo = false @@ -76,8 +76,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList if (savedInstanceState == null) { mFragment = if (mIsVideo) VideoFragment() else PhotoFragment() - mFragment.listener = this - mFragment.arguments = bundle + mFragment!!.listener = this + mFragment!!.arguments = bundle supportFragmentManager.beginTransaction().replace(R.id.fragment_holder, mFragment).commit() } @@ -101,7 +101,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> val isFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 - mFragment.fullscreenToggled(isFullscreen) + mFragment?.fullscreenToggled(isFullscreen) } } From 53948f8d904ff498f9f3a214c1f13f0f5b7f2ef9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:25:11 +0200 Subject: [PATCH 106/174] properly color the Check icon at the pin tab --- .../main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt index 68614824d..48aa73ada 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt @@ -1,11 +1,13 @@ package com.simplemobiletools.gallery.views import android.content.Context +import android.graphics.PorterDuff import android.util.AttributeSet import android.widget.RelativeLayout import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.helpers.PROTECTION_PIN import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.interfaces.SecurityTab @@ -36,6 +38,7 @@ class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, at pin_9.setOnClickListener { addNumber("9") } pin_c.setOnClickListener { clear() } pin_ok.setOnClickListener { confirmPIN() } + pin_ok.setColorFilter(context.config.textColor, PorterDuff.Mode.SRC_IN) } override fun initTab(requiredHash: String, listener: HashListener) { From 4d48faa44fb66952c4368ffeb019828de534c5fd Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:44:26 +0200 Subject: [PATCH 107/174] take the protection related strings from Commons --- app/build.gradle | 2 +- app/src/main/res/values-cs/strings.xml | 11 ----------- app/src/main/res/values-de/strings.xml | 11 ----------- app/src/main/res/values-es/strings.xml | 11 ----------- app/src/main/res/values-fr/strings.xml | 11 ----------- app/src/main/res/values-hu/strings.xml | 11 ----------- app/src/main/res/values-it/strings.xml | 11 ----------- app/src/main/res/values-ja/strings.xml | 11 ----------- app/src/main/res/values-pl/strings.xml | 11 ----------- app/src/main/res/values-pt-rBR/strings.xml | 11 ----------- app/src/main/res/values-pt/strings.xml | 11 ----------- app/src/main/res/values-ru/strings.xml | 11 ----------- app/src/main/res/values-sk/strings.xml | 11 ----------- app/src/main/res/values-sv/strings.xml | 11 ----------- app/src/main/res/values-tr/strings.xml | 11 ----------- app/src/main/res/values-zh-rCN/strings.xml | 11 ----------- app/src/main/res/values-zh-rTW/strings.xml | 11 ----------- app/src/main/res/values/strings.xml | 11 ----------- 18 files changed, 1 insertion(+), 188 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 75900a6bb..5a1b39579 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.23.2' + compile 'com.simplemobiletools:commons:2.23.3' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 90067954a..8f5f32fee 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -79,17 +79,6 @@ Portrait aspect ratio Landscape aspect ratio - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Zobrazit skryté média Automaticky přehrávat videa diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 0562ca799..4d5170f31 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -79,17 +79,6 @@ Hochformat Querformat - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Versteckte Ordner zeigen Videos automatisch abspielen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index be65972a7..1f217721d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -79,17 +79,6 @@ Relación de aspecto tipo retrato Relación de aspecto tipo paisaje - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Mostrar carpetas ocultas Reproducir vídeos automáticamente diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 7a7f80b52..9a258b186 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -79,17 +79,6 @@ Ratio aspect Portrait Ratio aspect Paysage - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Afficher les dossiers cachés Lecture automatique des vidéos diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 60164e60a..ade73ca6b 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -79,17 +79,6 @@ Portrait aspect ratio Landscape aspect ratio - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Show hidden media Play videos automatically diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 8f24b2f65..7d4e09e4c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -79,17 +79,6 @@ Proporzioni ritratto Proporzioni panorama - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Mostra cartelle nascoste Riproduci video automaticamente diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 6ca1e4fee..62f2d3e45 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -79,17 +79,6 @@ Portrait aspect ratio Landscape aspect ratio - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - 非表示フォルダーを表示 自動的にビデオを再生 diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 157bdd30c..8475e4373 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -79,17 +79,6 @@ Proporcje ekranu w trybie pionowym Proporcje ekranu w trybie poziomym - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Pokazuj ukryte foldery Odtwarzaj pliki wideo automatycznie diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 9405ca4eb..6d81a2352 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -79,17 +79,6 @@ Retrato Paisagem - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Mostrar pastas ocultas Reproduzir vídeos automaticamente diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d2a173d8b..5eaad8dbb 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -79,17 +79,6 @@ Proporção na vertical Proporção na horizontal - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Mostrar pastas ocultas Reproduzir vídeos automaticamente diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 0e1aa9b87..7d203a46b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -79,17 +79,6 @@ Формат изображения Пейзажное соотношение сторон - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Показать скрытые папки Воспроизводить видео автоматически diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index d7edc2cb6..5c5f176f9 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -79,17 +79,6 @@ Orientácia nastojato Orientácia naležato - - PIN - Zadajte PIN - Prosím zadajte PIN - Nesprávny PIN - Zopakujte PIN - Vzor - Zadajte vzor - Nesprávny vzor - Zopakujte vzor - Zobraziť skryté médiá Spúšťať videá automaticky diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 8b3e840ec..31351e0cc 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -79,17 +79,6 @@ Stående bildförhållande Liggande bildförhållande - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Visa dolda mappar Spela upp videos automatiskt diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fad2fcdcd..b7bcb2b25 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -79,17 +79,6 @@ Portrait aspect ratio Landscape aspect ratio - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Gizli klasörleri göster Videoları otomatik olarak oynat diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0ed778250..a29dde1b9 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -79,17 +79,6 @@ 纵向长宽比 横向长宽比 - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - 显示所有 自动播放 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 35f323e3c..26e559daa 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -79,17 +79,6 @@ Portrait aspect ratio Landscape aspect ratio - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - 秀出隱藏資料夾 自動播放影片 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ee31aee06..2e5a52af4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -79,17 +79,6 @@ Portrait aspect ratio Landscape aspect ratio - - PIN - Enter PIN - Please enter a PIN - Wrong PIN - Repeat PIN - Pattern - Insert pattern - Wrong pattern - Repeat pattern - Show hidden media Play videos automatically From 7f8cb4b8010ac846fb1208fa34d1d1af432bca26 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:44:35 +0200 Subject: [PATCH 108/174] disable lint on production builds --- app/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 5a1b39579..0e03448e1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,6 +29,11 @@ android { sourceSets { main.java.srcDirs += 'src/main/kotlin' } + + lintOptions { + checkReleaseBuilds false + abortOnError false + } } dependencies { From 4bfe5953d0aaba20ad9f4ec29d14ece0211608d0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:47:31 +0200 Subject: [PATCH 109/174] added pattern/pin protection to release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 4f769e462..3da7e96c0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -491,6 +491,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(114, R.string.release_114)) add(Release(115, R.string.release_115)) add(Release(118, R.string.release_118)) + add(Release(119, R.string.release_119)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index df1915f19..408607448 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Added pattern/pin protection for showing hidden items Added a toggle for replacing Share with Rotate at fullscreen media Added an indicator of folders located on SD cards From af961126ae4c65b822252a75a2d58b65ea50efe2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:48:09 +0200 Subject: [PATCH 110/174] update version to 2.12.3 (119) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0e03448e1..8dd6e15ea 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 118 - versionName "2.12.2" + versionCode 119 + versionName "2.12.3" } signingConfigs { From bb428e24d9eaa4bd2789a3460d7b69cfce76c317 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Aug 2017 23:49:05 +0200 Subject: [PATCH 111/174] updating changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 562f1c55d..1b1f5d962 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 2.12.3 *(2017-08-02)* +---------------------------- + + * Added pattern/pin protection for showing hidden items + * Hopefully fixed unintentional SD card file deleting + Version 2.12.2 *(2017-07-09)* ---------------------------- From a48c44ff93b3e33de038b65231201e3834d921c6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 18:25:31 +0200 Subject: [PATCH 112/174] update commons to 2.23.6 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 8dd6e15ea..cbb3818bd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.23.3' + compile 'com.simplemobiletools:commons:2.23.6' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From a61ed6a1b0a06ce413ab0357da5349b0949f456f Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 18:27:50 +0200 Subject: [PATCH 113/174] update version to 2.12.4 (120) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cbb3818bd..ed9e7a4d7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 119 - versionName "2.12.3" + versionCode 120 + versionName "2.12.4" } signingConfigs { From aa408b194034352972414d144abfd8bb3b1410b1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 18:27:56 +0200 Subject: [PATCH 114/174] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b1f5d962..7e734e166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 2.12.4 *(2017-08-03)* +---------------------------- + + * Fixed SD card file operations + Version 2.12.3 *(2017-08-02)* ---------------------------- From 799da5710dfe243b3153ad241c1be2dd9f6b5fc4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 20:51:00 +0200 Subject: [PATCH 115/174] update Commons to 2.23.7 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index ed9e7a4d7..953e23d8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.23.6' + compile 'com.simplemobiletools:commons:2.23.7' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From bdf2c574cdbb4692c4d32f8fc4f5fd4bd7d6f036 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 20:51:17 +0200 Subject: [PATCH 116/174] update version to 2.12.5 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 953e23d8e..e04ef4de6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 120 - versionName "2.12.4" + versionCode 121 + versionName "2.12.5" } signingConfigs { From 35944eef4d8d4f322eae8fdec1891c8421e1f9dc Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 20:51:42 +0200 Subject: [PATCH 117/174] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e734e166..035ed5b80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 2.12.5 *(2017-08-03)* +---------------------------- + + * Updating file operation on SD card + Version 2.12.4 *(2017-08-03)* ---------------------------- From 3fe5aaa451ba3dd9c13d2a503f4a3ba9dae7ff8d Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Aug 2017 23:43:04 +0200 Subject: [PATCH 118/174] move the protection related things in the Commons library --- app/build.gradle | 3 +- .../gallery/activities/SettingsActivity.kt | 5 +- .../gallery/adapters/PasswordTypesAdapter.kt | 33 ---- .../gallery/dialogs/SecurityDialog.kt | 75 -------- .../gallery/extensions/activity.kt | 11 -- .../gallery/helpers/Config.kt | 12 -- .../gallery/helpers/Constants.kt | 12 -- .../gallery/interfaces/HashListener.kt | 5 - .../gallery/interfaces/SecurityTab.kt | 5 - .../gallery/views/MyDialogViewPager.kt | 46 ----- .../gallery/views/PatternTab.kt | 74 -------- .../simplemobiletools/gallery/views/PinTab.kt | 100 ----------- app/src/main/res/layout/dialog_security.xml | 33 ---- app/src/main/res/layout/tab_pattern.xml | 22 --- app/src/main/res/layout/tab_pin.xml | 164 ------------------ app/src/main/res/values-v21/styles.xml | 4 - app/src/main/res/values/styles.xml | 10 -- 17 files changed, 4 insertions(+), 610 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt delete mode 100644 app/src/main/res/layout/dialog_security.xml delete mode 100644 app/src/main/res/layout/tab_pattern.xml delete mode 100644 app/src/main/res/layout/tab_pin.xml diff --git a/app/build.gradle b/app/build.gradle index e04ef4de6..24aabd87a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,14 +37,13 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.23.7' + compile 'com.simplemobiletools:commons:2.23.8' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.google.code.gson:gson:2.8.0' compile 'com.github.chrisbanes:PhotoView:2.1.2' compile 'it.sephiroth.android.exif:library:1.0.1' - compile 'com.andrognito.patternlockview:patternlockview:1.0.0' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' 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 5b32968ec..b5125dff1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -4,12 +4,13 @@ import android.content.Intent import android.content.res.Resources import android.os.Bundle import com.simplemobiletools.commons.dialogs.RadioGroupDialog +import com.simplemobiletools.commons.dialogs.SecurityDialog +import com.simplemobiletools.commons.extensions.handleHiddenFolderPasswordProtection import com.simplemobiletools.commons.extensions.updateTextColors +import com.simplemobiletools.commons.helpers.SHOW_ALL_TABS import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.dialogs.SecurityDialog import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.extensions.handleHiddenFolderPasswordProtection import com.simplemobiletools.gallery.helpers.* import kotlinx.android.synthetic.main.activity_settings.* diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt deleted file mode 100644 index 4d92c275d..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.simplemobiletools.gallery.adapters - -import android.content.Context -import android.support.v4.view.PagerAdapter -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.interfaces.HashListener -import com.simplemobiletools.gallery.interfaces.SecurityTab - -class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener) : PagerAdapter() { - - override fun instantiateItem(container: ViewGroup, position: Int): Any { - val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) - container.addView(view) - (view as SecurityTab).initTab(requiredHash, hashListener) - return view - } - - override fun destroyItem(container: ViewGroup, position: Int, item: Any) { - container.removeView(item as View) - } - - override fun getCount() = 2 - override fun isViewFromObject(view: View, item: Any) = view == item - - private fun layoutSelection(position: Int): Int = when (position) { - 0 -> R.layout.tab_pattern - 1 -> R.layout.tab_pin - else -> throw RuntimeException("Only 2 tabs allowed") - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt deleted file mode 100644 index c732125ee..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ /dev/null @@ -1,75 +0,0 @@ -package com.simplemobiletools.gallery.dialogs - -import android.support.design.widget.TabLayout -import android.support.v4.view.ViewPager -import android.support.v7.app.AlertDialog -import android.view.LayoutInflater -import com.simplemobiletools.commons.extensions.beGone -import com.simplemobiletools.commons.extensions.setupDialogStuff -import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.activities.SimpleActivity -import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter -import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.helpers.SHOW_ALL_TABS -import com.simplemobiletools.gallery.interfaces.HashListener -import com.simplemobiletools.gallery.views.MyDialogViewPager -import kotlinx.android.synthetic.main.dialog_security.view.* - -class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val showTabIndex: Int, val callback: (hash: String, type: Int) -> Unit) : HashListener { - var dialog: AlertDialog? = null - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) - - init { - view.apply { - val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager - viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) - viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { - override fun onPageScrollStateChanged(state: Int) { - } - - override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { - } - - override fun onPageSelected(position: Int) { - dialog_tab_layout.getTabAt(position)!!.select() - } - }) - - if (showTabIndex == SHOW_ALL_TABS) { - val textColor = context.config.textColor - dialog_tab_layout.setTabTextColors(textColor, textColor) - dialog_tab_layout.setSelectedTabIndicatorColor(context.config.primaryColor) - dialog_tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { - override fun onTabReselected(tab: TabLayout.Tab?) { - } - - override fun onTabUnselected(tab: TabLayout.Tab) { - } - - override fun onTabSelected(tab: TabLayout.Tab) { - if (tab.text.toString().equals(resources.getString(R.string.pattern), true)) { - viewPager.currentItem = 0 - } else { - viewPager.currentItem = 1 - } - } - }) - } else { - dialog_tab_layout.beGone() - viewPager.currentItem = showTabIndex - viewPager.allowSwiping = false - } - } - - dialog = AlertDialog.Builder(activity) - .setNegativeButton(R.string.cancel, null) - .create().apply { - activity.setupDialogStuff(view, this) - } - } - - override fun receivedHash(hash: String, type: Int) { - callback(hash, type) - dialog!!.dismiss() - } -} 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 00af3ac71..ddb92198c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -24,7 +24,6 @@ import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity -import com.simplemobiletools.gallery.dialogs.SecurityDialog import com.simplemobiletools.gallery.helpers.NOMEDIA import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.gallery.helpers.REQUEST_SET_AS @@ -333,16 +332,6 @@ fun Activity.loadStaticGif(path: String, target: MySquareImageView) { builder.apply(options).into(target) } -fun SimpleActivity.handleHiddenFolderPasswordProtection(callback: () -> Unit) { - if (config.isPasswordProtectionOn) { - SecurityDialog(this, config.passwordHash, config.protectionType) { hash, type -> - callback() - } - } else { - callback() - } -} - fun Activity.getCachedDirectories(): ArrayList { val token = object : TypeToken>() {}.type return Gson().fromJson>(config.directories, token) ?: ArrayList(1) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 89037e81b..b221d32da 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -232,16 +232,4 @@ class Config(context: Context) : BaseConfig(context) { var replaceShare: Boolean get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false) set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() - - var isPasswordProtectionOn: Boolean - get() = prefs.getBoolean(IS_PASSWORD_PROTECTION, false) - set(passwordProtection) = prefs.edit().putBoolean(IS_PASSWORD_PROTECTION, passwordProtection).apply() - - var passwordHash: String - get() = prefs.getString(PASSWORD_HASH, "") - set(passwordHash) = prefs.edit().putString(PASSWORD_HASH, passwordHash).apply() - - var protectionType: Int - get() = prefs.getInt(PROTECTION_TYPE, PROTECTION_PATTERN) - set(protectionType) = prefs.edit().putInt(PROTECTION_TYPE, protectionType).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 5b946fd5d..30af458a7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -33,9 +33,6 @@ val ALBUM_COVERS = "album_covers" val SCROLL_HORIZONTALLY = "scroll_horizontally" val HIDE_SYSTEM_UI = "hide_system_ui" val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" -val IS_PASSWORD_PROTECTION = "password_protection" -val PASSWORD_HASH = "password_hash" -val PROTECTION_TYPE = "protection_type" val NOMEDIA = ".nomedia" @@ -65,12 +62,3 @@ val ORIENT_PORTRAIT = 0 val ORIENT_LANDSCAPE_LEFT = 1 val ORIENT_LANDSCAPE_RIGHT = 2 val ORIENT_UPSIDE_DOWN = 3 - -// security -val PROTECTION_PATTERN = 0 -val PROTECTION_PIN = 1 -val PROTECTION_FINGERPRINT = 2 - -val SHOW_ALL_TABS = -1 -val SHOW_PATTERN = 0 -val SHOW_PIN = 1 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt deleted file mode 100644 index 2549eb4db..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.simplemobiletools.gallery.interfaces - -interface HashListener { - fun receivedHash(hash: String, type: Int) -} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt deleted file mode 100644 index 000818e1f..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/SecurityTab.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.simplemobiletools.gallery.interfaces - -interface SecurityTab { - fun initTab(requiredHash: String, listener: HashListener) -} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt deleted file mode 100644 index 5268e3a07..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/MyDialogViewPager.kt +++ /dev/null @@ -1,46 +0,0 @@ -package com.simplemobiletools.gallery.views - -import android.content.Context -import android.support.v4.view.ViewPager -import android.util.AttributeSet -import android.view.MotionEvent -import android.view.View - -class MyDialogViewPager : ViewPager { - var allowSwiping = true - - constructor(context: Context) : super(context) - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) - - // disable manual swiping of viewpager at the dialog by swiping over the pattern - override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { - return false - } - - override fun onTouchEvent(ev: MotionEvent): Boolean { - if (!allowSwiping) - return false - - try { - return super.onTouchEvent(ev) - } catch (ignored: Exception) { - } - - return false - } - - // https://stackoverflow.com/a/20784791/1967672 - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { - var height = 0 - for (i in 0..childCount - 1) { - val child = getChildAt(i) - child.measure(widthMeasureSpec, View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)) - val h = child.measuredHeight - if (h > height) height = h - } - - val newHeightMeasureSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY) - super.onMeasure(widthMeasureSpec, newHeightMeasureSpec) - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt deleted file mode 100644 index 9200f797e..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt +++ /dev/null @@ -1,74 +0,0 @@ -package com.simplemobiletools.gallery.views - -import android.content.Context -import android.os.Handler -import android.util.AttributeSet -import android.widget.RelativeLayout -import com.andrognito.patternlockview.PatternLockView -import com.andrognito.patternlockview.listener.PatternLockViewListener -import com.andrognito.patternlockview.utils.PatternLockUtils -import com.simplemobiletools.commons.extensions.toast -import com.simplemobiletools.commons.extensions.updateTextColors -import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.helpers.PROTECTION_PATTERN -import com.simplemobiletools.gallery.interfaces.HashListener -import com.simplemobiletools.gallery.interfaces.SecurityTab -import kotlinx.android.synthetic.main.tab_pattern.view.* - -class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs), SecurityTab { - private var hash = "" - private var requiredHash = "" - lateinit var hashListener: HashListener - - override fun onFinishInflate() { - super.onFinishInflate() - val textColor = context.config.textColor - context.updateTextColors(pattern_lock_holder) - pattern_lock_view.correctStateColor = context.config.primaryColor - pattern_lock_view.normalStateColor = textColor - pattern_lock_view.addPatternLockListener(object : PatternLockViewListener { - override fun onComplete(pattern: MutableList?) { - receivedHash(PatternLockUtils.patternToSha1(pattern_lock_view, pattern)) - } - - override fun onCleared() { - } - - override fun onStarted() { - } - - override fun onProgress(progressPattern: MutableList?) { - } - }) - } - - override fun initTab(requiredHash: String, listener: HashListener) { - this.requiredHash = requiredHash - hash = requiredHash - hashListener = listener - } - - private fun receivedHash(newHash: String) { - if (hash.isEmpty()) { - hash = newHash - pattern_lock_view.clearPattern() - pattern_lock_title.setText(R.string.repeat_pattern) - } else if (hash == newHash) { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.CORRECT) - Handler().postDelayed({ - hashListener.receivedHash(hash, PROTECTION_PATTERN) - }, 300) - } else { - pattern_lock_view.setViewMode(PatternLockView.PatternViewMode.WRONG) - context.toast(R.string.wrong_pattern) - Handler().postDelayed({ - pattern_lock_view.clearPattern() - if (requiredHash.isEmpty()) { - hash = "" - pattern_lock_title.setText(R.string.insert_pattern) - } - }, 1000) - } - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt deleted file mode 100644 index 48aa73ada..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PinTab.kt +++ /dev/null @@ -1,100 +0,0 @@ -package com.simplemobiletools.gallery.views - -import android.content.Context -import android.graphics.PorterDuff -import android.util.AttributeSet -import android.widget.RelativeLayout -import com.simplemobiletools.commons.extensions.toast -import com.simplemobiletools.commons.extensions.updateTextColors -import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.helpers.PROTECTION_PIN -import com.simplemobiletools.gallery.interfaces.HashListener -import com.simplemobiletools.gallery.interfaces.SecurityTab -import kotlinx.android.synthetic.main.tab_pin.view.* -import java.math.BigInteger -import java.security.MessageDigest -import java.util.* - -class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs), SecurityTab { - private var hash = "" - private var requiredHash = "" - private var pin = "" - lateinit var hashListener: HashListener - - override fun onFinishInflate() { - super.onFinishInflate() - context.updateTextColors(pin_lock_holder) - - pin_0.setOnClickListener { addNumber("0") } - pin_1.setOnClickListener { addNumber("1") } - pin_2.setOnClickListener { addNumber("2") } - pin_3.setOnClickListener { addNumber("3") } - pin_4.setOnClickListener { addNumber("4") } - pin_5.setOnClickListener { addNumber("5") } - pin_6.setOnClickListener { addNumber("6") } - pin_7.setOnClickListener { addNumber("7") } - pin_8.setOnClickListener { addNumber("8") } - pin_9.setOnClickListener { addNumber("9") } - pin_c.setOnClickListener { clear() } - pin_ok.setOnClickListener { confirmPIN() } - pin_ok.setColorFilter(context.config.textColor, PorterDuff.Mode.SRC_IN) - } - - override fun initTab(requiredHash: String, listener: HashListener) { - this.requiredHash = requiredHash - hash = requiredHash - hashListener = listener - } - - private fun addNumber(number: String) { - if (pin.length < 10) { - pin += number - updatePinCode() - } - } - - private fun clear() { - if (pin.isNotEmpty()) { - pin = pin.substring(0, pin.length - 1) - updatePinCode() - } - } - - private fun confirmPIN() { - val newHash = getHashedPin() - if (pin.isEmpty()) { - context.toast(R.string.please_enter_pin) - } else if (hash.isEmpty()) { - hash = newHash - resetPin() - pin_lock_title.setText(R.string.repeat_pin) - } else if (hash == newHash) { - hashListener.receivedHash(hash, PROTECTION_PIN) - } else { - resetPin() - context.toast(R.string.wrong_pin) - if (requiredHash.isEmpty()) { - hash = "" - pin_lock_title.setText(R.string.enter_pin) - } - } - } - - private fun resetPin() { - pin = "" - pin_lock_current_pin.text = "" - } - - private fun updatePinCode() { - pin_lock_current_pin.text = "*".repeat(pin.length) - } - - private fun getHashedPin(): String { - val messageDigest = MessageDigest.getInstance("SHA-1") - messageDigest.update(pin.toByteArray(charset("UTF-8"))) - val digest = messageDigest.digest() - val bigInteger = BigInteger(1, digest) - return String.format(Locale.getDefault(), "%0${digest.size * 2}x", bigInteger).toLowerCase() - } -} diff --git a/app/src/main/res/layout/dialog_security.xml b/app/src/main/res/layout/dialog_security.xml deleted file mode 100644 index 993c05bfa..000000000 --- a/app/src/main/res/layout/dialog_security.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/tab_pattern.xml b/app/src/main/res/layout/tab_pattern.xml deleted file mode 100644 index 13cae2fcb..000000000 --- a/app/src/main/res/layout/tab_pattern.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout/tab_pin.xml b/app/src/main/res/layout/tab_pin.xml deleted file mode 100644 index 8a7c27695..000000000 --- a/app/src/main/res/layout/tab_pin.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 65e4ec22c..78a798255 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -4,8 +4,4 @@ true - - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index bc2a7b38e..f7114219d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -16,14 +16,4 @@ @style/AppTheme.ActionBar.TitleTextStyle - - - - From 28f03124e97d3ff39d70c98ef31c3fb4c94e0ca1 Mon Sep 17 00:00:00 2001 From: gregory678 Date: Fri, 4 Aug 2017 11:31:36 +0200 Subject: [PATCH 119/174] Updates and fixes --- app/src/main/res/values-pl/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 8475e4373..e16890b7a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -3,7 +3,7 @@ Simple Gallery Simple Gallery Edytuj - Aparat + Uruchom aplikację aparatu Otwórz w Nie znaleziono danych aplikacji (ukryty) @@ -51,7 +51,7 @@ Edycja - zapisz + Zapisz Obróć Ścieżka Nieprawidłowa ścieżka @@ -74,16 +74,16 @@ Ustawienie tapety nie powiodło się Ustaw jako tapetę w: Brak odpowiednich ustawień - Ustawianie tapety… - Tapeta ustawiona + Ustawiam tapetę… + Tapeta została ustawiona Proporcje ekranu w trybie pionowym Proporcje ekranu w trybie poziomym Pokazuj ukryte foldery - Odtwarzaj pliki wideo automatycznie - Włącz widoczność nazwy pliku - Wybierz co pokazywać + Odtwarzaj filmy automatycznie + Pokazuj / ukrywaj nazwy plików + Pokazywane typy multimediów Tylko obrazy Tylko filmy Tylko GIFy @@ -99,9 +99,9 @@ Proporcji Czarne tło przy podglądzie pełnoekranowym Przewijaj miniatury poziomo - Ukrywaj automatycznie interfejs przy pełnoekranowym podglądzie + Ukrywaj interfejs przy pełnoekranowym podglądzie Zamień funkcję udostępniania na obracanie w menu pełnoekranowym - Password protect hidden folders + Zabezpiecz ukryte foldery From 12c10c4bf2956e126fe9a2a93bbfaa4f2f613f73 Mon Sep 17 00:00:00 2001 From: gregory678 Date: Fri, 4 Aug 2017 11:45:34 +0200 Subject: [PATCH 120/174] Updates and fixes --- app/src/main/res/values-pl/strings.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index e16890b7a..0f1173bb8 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -107,13 +107,11 @@ Darmowa galeria bez reklam do przeglądania obrazów i filmów. - 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. Można je również powiększać. Pliki multimedialne są wyświetlane w wielu kolumnach w zależności od wielkości ekranu. Liczbę kolumn można zmienić za pomocą gestów. Obrazy mogą być edytowane w galerii. Zdjęcia mogą być przycięte, można je obracać lub ustawić jako tapetę bezpośrednio z aplikacji. Kolor aplikacji można dowolnie ustawiać według własnych preferencji. + 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ć. - Galeria jest również oferowana do użytkowania przez osoby trzecie do podglądu zdjęć i filmów, dodawania załączników do emaili, itp. Idealne nadaje się do codziennego użytku. - - Nie zawiera żadnych reklam, ani niepotrzebnych uprawnień. Jest w pełni otawrtoźrodłowa. + Aplikacja nie zawiera żadnych reklam ani niepotrzebnych uprawnień. Jest też w pełni otawrtoźrodłowa. - Ta aplikacja jest tylko jedną z wielu naszych aplikacji. Resztę można znaleźć na stronie http://www.simplemobiletools.com. + Niniejsza aplikacja jest tylko częścią naszego zestawu prostych aplikacji. Znajdziecie je na stronie http://www.simplemobiletools.com. From 8ff6c8d1f74c63acf1ac09b8ccdc4eae2916b3f7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 4 Aug 2017 20:36:29 +0200 Subject: [PATCH 122/174] adding a slideshow menu button --- app/build.gradle | 2 +- .../gallery/activities/ViewPagerActivity.kt | 5 +++++ app/src/main/res/menu/menu_viewpager.xml | 4 ++++ app/src/main/res/values-cs/strings.xml | 7 +++++++ app/src/main/res/values-de/strings.xml | 7 +++++++ app/src/main/res/values-es/strings.xml | 7 +++++++ app/src/main/res/values-fr/strings.xml | 7 +++++++ app/src/main/res/values-hu/strings.xml | 7 +++++++ app/src/main/res/values-it/strings.xml | 7 +++++++ app/src/main/res/values-ja/strings.xml | 7 +++++++ app/src/main/res/values-pl/strings.xml | 7 +++++++ app/src/main/res/values-pt-rBR/strings.xml | 13 +++++++++++-- app/src/main/res/values-pt/strings.xml | 7 +++++++ app/src/main/res/values-ru/strings.xml | 7 +++++++ app/src/main/res/values-sk/strings.xml | 7 +++++++ app/src/main/res/values-sv/strings.xml | 7 +++++++ app/src/main/res/values-tr/strings.xml | 7 +++++++ app/src/main/res/values-zh-rCN/strings.xml | 7 +++++++ app/src/main/res/values-zh-rTW/strings.xml | 7 +++++++ app/src/main/res/values/strings.xml | 7 +++++++ 20 files changed, 133 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 24aabd87a..161d4d82b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.23.8' + compile 'com.simplemobiletools:commons:2.24.0' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 3c46cbb1b..d8c9cd241 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -213,6 +213,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View when (item.itemId) { R.id.menu_set_as -> trySetAs(getCurrentFile()) + R.id.slideshow -> initSlideshow() R.id.menu_copy_to -> copyMoveTo(true) R.id.menu_move_to -> copyMoveTo(false) R.id.menu_open_with -> openWith(getCurrentFile()) @@ -245,6 +246,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } + private fun initSlideshow() { + + } + private fun copyMoveTo(isCopyOperation: Boolean) { val files = ArrayList(1).apply { add(getCurrentFile()) } tryCopyMoveFilesTo(files, isCopyOperation) { diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index 2ab54089e..192458087 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -28,6 +28,10 @@ android:title="@string/share" android:visible="false" app:showAsAction="ifRoom"/> + Portrait aspect ratio Landscape aspect ratio + + Slideshow + Interval + Include videos + Random order + Use fade animations + Zobrazit skryté média Automaticky přehrávat videa diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4d5170f31..7fc9f8aae 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -79,6 +79,13 @@ Hochformat Querformat + + Slideshow + Interval + Include videos + Random order + Use fade animations + Versteckte Ordner zeigen Videos automatisch abspielen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 1f217721d..686bf180c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -79,6 +79,13 @@ Relación de aspecto tipo retrato Relación de aspecto tipo paisaje + + Slideshow + Interval + Include videos + Random order + Use fade animations + Mostrar carpetas ocultas Reproducir vídeos automáticamente diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 9a258b186..edf38033b 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -79,6 +79,13 @@ Ratio aspect Portrait Ratio aspect Paysage + + Slideshow + Interval + Include videos + Random order + Use fade animations + Afficher les dossiers cachés Lecture automatique des vidéos diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index ade73ca6b..a4a9b8135 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -79,6 +79,13 @@ Portrait aspect ratio Landscape aspect ratio + + Slideshow + Interval + Include videos + Random order + Use fade animations + Show hidden media Play videos automatically diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 7d4e09e4c..756b14eb4 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -79,6 +79,13 @@ Proporzioni ritratto Proporzioni panorama + + Slideshow + Interval + Include videos + Random order + Use fade animations + Mostra cartelle nascoste Riproduci video automaticamente diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 62f2d3e45..1db0cc43d 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -79,6 +79,13 @@ Portrait aspect ratio Landscape aspect ratio + + Slideshow + Interval + Include videos + Random order + Use fade animations + 非表示フォルダーを表示 自動的にビデオを再生 diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 935ca5a09..eff70d5e4 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -79,6 +79,13 @@ Proporcje ekranu w trybie pionowym Proporcje ekranu w trybie poziomym + + Slideshow + Interval + Include videos + Random order + Use fade animations + Pokazuj ukryte foldery Odtwarzaj filmy automatycznie diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 6d81a2352..21f64ac03 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -6,7 +6,8 @@ Abrir câmera Abrir com Nenhum aplicativo encontrado -    (oculto) +     + (oculto) Fixar pasta Desfixar pasta Mostrar conteúdo de todas as pastas @@ -79,6 +80,13 @@ Retrato Paisagem + + Slideshow + Interval + Include videos + Random order + Use fade animations + Mostrar pastas ocultas Reproduzir vídeos automaticamente @@ -91,7 +99,8 @@ Imagens e vídeos Reproduzir vídeos em ciclo Animação de GIFs nas miniaturas -    Brilho máximo ao visualizar mídia +     + Brilho máximo ao visualizar mídia Recortar miniaturas em quadrados Critério para rotação de tela Padrão do sistema diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 5eaad8dbb..3352875be 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -79,6 +79,13 @@ Proporção na vertical Proporção na horizontal + + Slideshow + Interval + Include videos + Random order + Use fade animations + Mostrar pastas ocultas Reproduzir vídeos automaticamente diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 7d203a46b..85c64a684 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -79,6 +79,13 @@ Формат изображения Пейзажное соотношение сторон + + Slideshow + Interval + Include videos + Random order + Use fade animations + Показать скрытые папки Воспроизводить видео автоматически diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 5c5f176f9..f9bd2312a 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -79,6 +79,13 @@ Orientácia nastojato Orientácia naležato + + Prezentácia + Interval + Zahrnúť videá + Náhodné poradie + Používať miznúce animácie + Zobraziť skryté médiá Spúšťať videá automaticky diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 31351e0cc..540589920 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -79,6 +79,13 @@ Stående bildförhållande Liggande bildförhållande + + Slideshow + Interval + Include videos + Random order + Use fade animations + Visa dolda mappar Spela upp videos automatiskt diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index b7bcb2b25..19408787d 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -79,6 +79,13 @@ Portrait aspect ratio Landscape aspect ratio + + Slideshow + Interval + Include videos + Random order + Use fade animations + Gizli klasörleri göster Videoları otomatik olarak oynat diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index a29dde1b9..bf147404b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -79,6 +79,13 @@ 纵向长宽比 横向长宽比 + + Slideshow + Interval + Include videos + Random order + Use fade animations + 显示所有 自动播放 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 26e559daa..b0403528b 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -79,6 +79,13 @@ Portrait aspect ratio Landscape aspect ratio + + Slideshow + Interval + Include videos + Random order + Use fade animations + 秀出隱藏資料夾 自動播放影片 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2e5a52af4..7bd64fd1b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -79,6 +79,13 @@ Portrait aspect ratio Landscape aspect ratio + + Slideshow + Interval + Include videos + Random order + Use fade animations + Show hidden media Play videos automatically From c06fe43a687252e16a172bfaefd68eec9d0dc10b Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 4 Aug 2017 21:19:04 +0200 Subject: [PATCH 123/174] adding an initial slideshow setup dialog --- .../gallery/activities/ViewPagerActivity.kt | 4 + .../gallery/dialogs/ExcludeFolderDialog.kt | 1 - .../gallery/dialogs/SlideshowDialog.kt | 51 +++++++++ app/src/main/res/layout/dialog_slideshow.xml | 104 ++++++++++++++++++ app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values-pt-rBR/strings.xml | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 2 +- app/src/main/res/values-tr/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 21 files changed, 176 insertions(+), 18 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt create mode 100644 app/src/main/res/layout/dialog_slideshow.xml 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 d8c9cd241..9f34993cd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -17,6 +17,7 @@ import android.os.Build import android.os.Bundle import android.provider.MediaStore import android.support.v4.view.ViewPager +import android.transition.Slide import android.util.DisplayMetrics import android.view.* import com.simplemobiletools.commons.dialogs.ConfirmationDialog @@ -28,6 +29,7 @@ import com.simplemobiletools.gallery.activities.MediaActivity.Companion.mMedia import com.simplemobiletools.gallery.adapters.MyPagerAdapter import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.dialogs.SaveAsDialog +import com.simplemobiletools.gallery.dialogs.SlideshowDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.fragments.PhotoFragment import com.simplemobiletools.gallery.fragments.ViewPagerFragment @@ -247,7 +249,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun initSlideshow() { + SlideshowDialog(this) { + } } private fun copyMoveTo(isCopyOperation: Boolean) { 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 936433cb3..defa365fc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt @@ -14,7 +14,6 @@ import com.simplemobiletools.gallery.extensions.config import kotlinx.android.synthetic.main.dialog_exclude_folder.view.* class ExcludeFolderDialog(val activity: SimpleActivity, val selectedPaths: List, val callback: () -> Unit) { - var dialog: AlertDialog? = null val alternativePaths = getAlternativePathsList() var radioGroup: RadioGroup? = null diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt new file mode 100644 index 000000000..8ce824e02 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -0,0 +1,51 @@ +package com.simplemobiletools.gallery.dialogs + +import android.support.v7.app.AlertDialog +import android.view.LayoutInflater +import android.view.WindowManager +import com.simplemobiletools.commons.extensions.setupDialogStuff +import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.activities.SimpleActivity +import kotlinx.android.synthetic.main.dialog_slideshow.view.* + + +class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { + var dialog: AlertDialog + + init { + val view = LayoutInflater.from(activity).inflate(R.layout.dialog_slideshow, null).apply { + interval_value.setOnClickListener { + val text = interval_value.text + if (text.isNotEmpty()) { + text.replace(0, 1, text.subSequence(0, 1), 0, 1) + interval_value.selectAll() + } + } + + include_videos_holder.setOnClickListener { + include_videos.toggle() + } + + random_order_holder.setOnClickListener { + random_order.toggle() + } + + use_fade_holder.setOnClickListener { + use_fade.toggle() + } + } + + dialog = AlertDialog.Builder(activity) + .setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() }) + .setNegativeButton(R.string.cancel, null) + .create().apply { + window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) + activity.setupDialogStuff(view, this) + currentFocus?.clearFocus() + } + } + + private fun dialogConfirmed() { + + } +} diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml new file mode 100644 index 000000000..6558dc17c --- /dev/null +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index ae6d5e5d3..40d71a3fc 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 7fc9f8aae..39aed4245 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 686bf180c..fb1fbb8ce 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index edf38033b..84d095ab4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index a4a9b8135..ce5ecab3b 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 756b14eb4..57da6ce18 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 1db0cc43d..e2f372b89 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index eff70d5e4..49e9e8802 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 21f64ac03..310109fa2 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -82,7 +82,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 3352875be..b2401407b 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 85c64a684..363f435fb 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index f9bd2312a..f5beb86b5 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -81,7 +81,7 @@ Prezentácia - Interval + Interval (sekundy): Zahrnúť videá Náhodné poradie Používať miznúce animácie diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 540589920..fa8881770 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 19408787d..b79d919d5 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index bf147404b..d04ea72bc 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index b0403528b..651704630 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7bd64fd1b..a10a370cd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -81,7 +81,7 @@ Slideshow - Interval + Interval (seconds): Include videos Random order Use fade animations From 1dec1b7457cc94e5daef695285ca23c8b359a277 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 4 Aug 2017 22:53:43 +0200 Subject: [PATCH 124/174] store values set at the slideshow setup dialog --- .../gallery/activities/ViewPagerActivity.kt | 1 - .../gallery/dialogs/ChangeSortingDialog.kt | 2 +- .../gallery/dialogs/ExcludeFolderDialog.kt | 2 +- .../gallery/dialogs/PickDirectoryDialog.kt | 4 +-- .../gallery/dialogs/ResizeDialog.kt | 2 +- .../gallery/dialogs/SaveAsDialog.kt | 4 +-- .../gallery/dialogs/SlideshowDialog.kt | 32 ++++++++++++++++--- .../gallery/helpers/Config.kt | 16 ++++++++++ .../gallery/helpers/Constants.kt | 7 ++++ app/src/main/res/layout/dialog_slideshow.xml | 1 - 10 files changed, 58 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 9f34993cd..2331be6a4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -17,7 +17,6 @@ import android.os.Build import android.os.Bundle import android.provider.MediaStore import android.support.v4.view.ViewPager -import android.transition.Slide import android.util.DisplayMetrics import android.view.* import com.simplemobiletools.commons.dialogs.ConfirmationDialog 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 8d334b11d..f7020498d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -84,6 +84,6 @@ class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting: config.fileSorting = sorting } } - callback.invoke() + callback() } } 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 defa365fc..ea386870f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt @@ -45,7 +45,7 @@ class ExcludeFolderDialog(val activity: SimpleActivity, val selectedPaths: List< private fun dialogConfirmed() { val path = if (alternativePaths.isEmpty()) selectedPaths[0] else alternativePaths[radioGroup!!.checkedRadioButtonId] activity.config.addExcludedFolder(path) - callback.invoke() + callback() } private fun getAlternativePathsList(): List { 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 3a8152d63..39d0ca7f2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -50,7 +50,7 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, fun showOtherFolder() { val showHidden = activity.config.shouldShowHidden FilePickerDialog(activity, sourcePath, false, showHidden, true) { - callback.invoke(it) + callback(it) } } @@ -64,7 +64,7 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, activity.toast(R.string.source_and_destination_same) return@DirectoryAdapter } else { - callback.invoke(it.path) + callback(it.path) dialog.dismiss() } } 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 0d339dcc8..c82c5fdce 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt @@ -84,7 +84,7 @@ class ResizeDialog(val activity: SimpleActivity, val size: Point, val callback: } val newSize = Point(getViewValue(widthView), getViewValue(heightView)) - callback.invoke(newSize) + callback(newSize) dismiss() }) } 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 3a5bd3320..503e0f741 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -66,11 +66,11 @@ class SaveAsDialog(val activity: SimpleActivity, val path: String, val callback: if (newFile.exists()) { val title = String.format(activity.getString(R.string.file_already_exists_overwrite), newFile.name) ConfirmationDialog(activity, title) { - callback.invoke(newFile.absolutePath) + callback(newFile.absolutePath) dismiss() } } else { - callback.invoke(newFile.absolutePath) + callback(newFile.absolutePath) dismiss() } }) 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 8ce824e02..94533b0e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -2,18 +2,21 @@ 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.extensions.setupDialogStuff import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity +import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.helpers.SLIDESHOW_DEFAULT_DURATION import kotlinx.android.synthetic.main.dialog_slideshow.view.* - class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { - var dialog: AlertDialog + val dialog: AlertDialog + val view: View init { - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_slideshow, null).apply { + view = LayoutInflater.from(activity).inflate(R.layout.dialog_slideshow, null).apply { interval_value.setOnClickListener { val text = interval_value.text if (text.isNotEmpty()) { @@ -34,6 +37,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { use_fade.toggle() } } + setupValues() dialog = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() }) @@ -41,11 +45,31 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { .create().apply { window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) activity.setupDialogStuff(view, this) - currentFocus?.clearFocus() + } + } + + private fun setupValues() { + val config = activity.config + view.apply { + interval_value.setText(config.slideshowInterval.toString()) + include_videos.isChecked = config.slideshowIncludeVideos + random_order.isChecked = config.slideshowRandomOrder + use_fade.isChecked = config.slideshowUseFade } } private fun dialogConfirmed() { + var interval = view.interval_value.text.toString() + if (interval.trim('0').isEmpty()) + interval = SLIDESHOW_DEFAULT_DURATION.toString() + activity.config.apply { + slideshowInterval = interval.toInt() + slideshowIncludeVideos = view.include_videos.isChecked + slideshowRandomOrder = view.random_order.isChecked + slideshowUseFade = view.use_fade.isChecked + } + dialog.dismiss() + callback() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index b221d32da..32632a0d5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -232,4 +232,20 @@ class Config(context: Context) : BaseConfig(context) { var replaceShare: Boolean get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false) set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() + + var slideshowInterval: Int + get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_DURATION) + set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply() + + var slideshowIncludeVideos: Boolean + get() = prefs.getBoolean(SLIDESHOW_INCLUDE_VIDEOS, false) + set(slideshowIncludeVideos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_VIDEOS, slideshowIncludeVideos).apply() + + var slideshowRandomOrder: Boolean + get() = prefs.getBoolean(SLIDESHOW_RANDOM_ORDER, false) + set(slideshowRandomOrder) = prefs.edit().putBoolean(SLIDESHOW_RANDOM_ORDER, slideshowRandomOrder).apply() + + var slideshowUseFade: Boolean + get() = prefs.getBoolean(SLIDESHOW_USE_FADE, false) + set(slideshowUseFade) = prefs.edit().putBoolean(SLIDESHOW_USE_FADE, slideshowUseFade).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 30af458a7..465904cea 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -34,6 +34,13 @@ val SCROLL_HORIZONTALLY = "scroll_horizontally" val HIDE_SYSTEM_UI = "hide_system_ui" val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" +// slideshow +val SLIDESHOW_INTERVAL = "slideshow_interval" +val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos" +val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order" +val SLIDESHOW_USE_FADE = "slideshow_use_fade" +val SLIDESHOW_DEFAULT_DURATION = 5 + val NOMEDIA = ".nomedia" val DIRECTORY = "directory" diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index 6558dc17c..50817ee1e 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -35,7 +35,6 @@ android:imeOptions="actionDone" android:inputType="number" android:maxLength="2" - android:text="5" android:textCursorDrawable="@null"/> Date: Fri, 4 Aug 2017 23:10:22 +0200 Subject: [PATCH 125/174] create the system for toggling the slideshow --- .../gallery/activities/ViewPagerActivity.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 2331be6a4..6b6c47cf2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -47,6 +47,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mIsFullScreen = false private var mPos = -1 private var mShowAll = false + private var mIsSlideshowActive = false private var mRotationDegrees = 0f private var mLastHandledOrientation = 0 private var mPrevHashcode = 0 @@ -249,7 +250,19 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun initSlideshow() { SlideshowDialog(this) { + startSlideshow() + } + } + private fun startSlideshow() { + hideSystemUI() + mIsSlideshowActive = true + } + + private fun stopSlideshow() { + if (mIsSlideshowActive) { + showSystemUI() + mIsSlideshowActive = false } } @@ -538,6 +551,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (mIsFullScreen) { hideSystemUI() } else { + stopSlideshow() showSystemUI() } } From 86a5107cc6590ff592036fae9a60b7c92b7e1492 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 12:27:48 +0200 Subject: [PATCH 126/174] adding some basic slideshow functionality --- .../gallery/activities/ViewPagerActivity.kt | 21 +++++++++++++++++++ .../gallery/dialogs/SlideshowDialog.kt | 4 ++-- .../gallery/helpers/Config.kt | 2 +- .../gallery/helpers/Constants.kt | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 6b6c47cf2..e77a47a48 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -15,6 +15,7 @@ import android.media.ExifInterface import android.net.Uri import android.os.Build import android.os.Bundle +import android.os.Handler import android.provider.MediaStore import android.support.v4.view.ViewPager import android.util.DisplayMetrics @@ -51,6 +52,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mRotationDegrees = 0f private var mLastHandledOrientation = 0 private var mPrevHashcode = 0 + private var mSlideshowHandler = Handler() + private var mSlideshowInterval = SLIDESHOW_DEFAULT_INTERVAL companion object { var screenWidth = 0 @@ -189,6 +192,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun onPause() { super.onPause() mOrientationEventListener.disable() + stopSlideshow() } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -256,13 +260,29 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun startSlideshow() { hideSystemUI() + mSlideshowInterval = config.slideshowInterval mIsSlideshowActive = true + scheduleSwipe() + window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) } private fun stopSlideshow() { if (mIsSlideshowActive) { showSystemUI() mIsSlideshowActive = false + mSlideshowHandler.removeCallbacksAndMessages(null) + window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + } + } + + private fun scheduleSwipe() { + mSlideshowHandler.removeCallbacksAndMessages(null) + if (mIsSlideshowActive) { + mSlideshowHandler.postDelayed({ + if (mIsSlideshowActive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) { + view_pager.currentItem = ++view_pager.currentItem + } + }, mSlideshowInterval * 1000L) } } @@ -587,6 +607,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View updateActionbarTitle() mRotationDegrees = 0f supportInvalidateOptionsMenu() + scheduleSwipe() } override fun onPageScrollStateChanged(state: Int) { 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 94533b0e7..8bc0ca1ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -8,7 +8,7 @@ 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.SLIDESHOW_DEFAULT_DURATION +import com.simplemobiletools.gallery.helpers.SLIDESHOW_DEFAULT_INTERVAL import kotlinx.android.synthetic.main.dialog_slideshow.view.* class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { @@ -61,7 +61,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { private fun dialogConfirmed() { var interval = view.interval_value.text.toString() if (interval.trim('0').isEmpty()) - interval = SLIDESHOW_DEFAULT_DURATION.toString() + interval = SLIDESHOW_DEFAULT_INTERVAL.toString() activity.config.apply { slideshowInterval = interval.toInt() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 32632a0d5..a80d599d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -234,7 +234,7 @@ class Config(context: Context) : BaseConfig(context) { set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply() var slideshowInterval: Int - get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_DURATION) + get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL) set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply() var slideshowIncludeVideos: Boolean diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 465904cea..f3350813f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -39,7 +39,7 @@ val SLIDESHOW_INTERVAL = "slideshow_interval" val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos" val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order" val SLIDESHOW_USE_FADE = "slideshow_use_fade" -val SLIDESHOW_DEFAULT_DURATION = 5 +val SLIDESHOW_DEFAULT_INTERVAL = 5 val NOMEDIA = ".nomedia" From e3a5b9356e655d046ad071c8b664954c21d4dd59 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 12:33:57 +0200 Subject: [PATCH 127/174] adding a new slideshow option, moving backwards --- .../gallery/dialogs/SlideshowDialog.kt | 6 ++++++ .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/dialog_slideshow.xml | 21 +++++++++++++++++++ app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 21 files changed, 49 insertions(+) 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 8bc0ca1ff..a3b9aae99 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -36,6 +36,10 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { use_fade_holder.setOnClickListener { use_fade.toggle() } + + move_backwards_holder.setOnClickListener { + move_backwards.toggle() + } } setupValues() @@ -55,6 +59,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { include_videos.isChecked = config.slideshowIncludeVideos random_order.isChecked = config.slideshowRandomOrder use_fade.isChecked = config.slideshowUseFade + move_backwards.isChecked = config.slideshowMoveBackwards } } @@ -68,6 +73,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { slideshowIncludeVideos = view.include_videos.isChecked slideshowRandomOrder = view.random_order.isChecked slideshowUseFade = view.use_fade.isChecked + slideshowMoveBackwards = view.move_backwards.isChecked } dialog.dismiss() callback() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index a80d599d8..6dd00d0e4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -248,4 +248,8 @@ class Config(context: Context) : BaseConfig(context) { var slideshowUseFade: Boolean get() = prefs.getBoolean(SLIDESHOW_USE_FADE, false) set(slideshowUseFade) = prefs.edit().putBoolean(SLIDESHOW_USE_FADE, slideshowUseFade).apply() + + var slideshowMoveBackwards: Boolean + get() = prefs.getBoolean(SLIDESHOW_MOVE_BACKWARDS, false) + set(slideshowMoveBackwards) = prefs.edit().putBoolean(SLIDESHOW_MOVE_BACKWARDS, slideshowMoveBackwards).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index f3350813f..5cf46791d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -39,6 +39,7 @@ val SLIDESHOW_INTERVAL = "slideshow_interval" val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos" val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order" val SLIDESHOW_USE_FADE = "slideshow_use_fade" +val SLIDESHOW_MOVE_BACKWARDS = "slideshow_move_backwards" val SLIDESHOW_DEFAULT_INTERVAL = 5 val NOMEDIA = ".nomedia" diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index 50817ee1e..398f667ac 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -99,5 +99,26 @@ android:text="@string/use_fade"/> + + + + + + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 40d71a3fc..4d39e6c5f 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Zobrazit skryté média diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 39aed4245..9e0ac1425 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Versteckte Ordner zeigen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index fb1fbb8ce..cf6a7a911 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Mostrar carpetas ocultas diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 84d095ab4..fb407d8ef 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Afficher les dossiers cachés diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index ce5ecab3b..1e265dc4f 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Show hidden media diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 57da6ce18..f3a0bfe81 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Mostra cartelle nascoste diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e2f372b89..f87a0df6a 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards 非表示フォルダーを表示 diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 49e9e8802..b78f4f67b 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Pokazuj ukryte foldery diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 310109fa2..273f27178 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -86,6 +86,7 @@ Include videos Random order Use fade animations + Move backwards Mostrar pastas ocultas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index b2401407b..e32e84203 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Mostrar pastas ocultas diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 363f435fb..90f874c2c 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Показать скрытые папки diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index f5beb86b5..73de54dca 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -85,6 +85,7 @@ Zahrnúť videá Náhodné poradie Používať miznúce animácie + Ísť opačným smerom Zobraziť skryté médiá diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index fa8881770..c282c6a00 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Visa dolda mappar diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index b79d919d5..ee696c2d9 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Gizli klasörleri göster diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index d04ea72bc..8bfcd3d45 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards 显示所有 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 651704630..7145b811c 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards 秀出隱藏資料夾 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a10a370cd..f0d57ca99 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -85,6 +85,7 @@ Include videos Random order Use fade animations + Move backwards Show hidden media From c47ddc536db76b3291e59435ef101a736ce97193 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 13:34:30 +0200 Subject: [PATCH 128/174] show a toast if the slideshow ended + implement moving backwards --- .../gallery/activities/ViewPagerActivity.kt | 10 +++++++++- app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 18 files changed, 26 insertions(+), 1 deletion(-) 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 e77a47a48..f8921e581 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -52,8 +52,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mRotationDegrees = 0f private var mLastHandledOrientation = 0 private var mPrevHashcode = 0 + private var mSlideshowHandler = Handler() private var mSlideshowInterval = SLIDESHOW_DEFAULT_INTERVAL + private var mSlideshowMoveBackwards = false companion object { var screenWidth = 0 @@ -261,6 +263,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun startSlideshow() { hideSystemUI() mSlideshowInterval = config.slideshowInterval + mSlideshowMoveBackwards = config.slideshowMoveBackwards mIsSlideshowActive = true scheduleSwipe() window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) @@ -280,7 +283,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (mIsSlideshowActive) { mSlideshowHandler.postDelayed({ if (mIsSlideshowActive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) { - view_pager.currentItem = ++view_pager.currentItem + val before = view_pager.currentItem + view_pager.currentItem = if (mSlideshowMoveBackwards) --view_pager.currentItem else ++view_pager.currentItem + if (before == view_pager.currentItem) { + stopSlideshow() + toast(R.string.slideshow_ended) + } } }, mSlideshowInterval * 1000L) } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 4d39e6c5f..1493a9c34 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Zobrazit skryté média diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9e0ac1425..040131968 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Versteckte Ordner zeigen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index cf6a7a911..a6eb944ae 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Mostrar carpetas ocultas diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index fb407d8ef..d993abc15 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Afficher les dossiers cachés diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 1e265dc4f..720943b49 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Show hidden media diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index f3a0bfe81..904972ae8 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Mostra cartelle nascoste diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index f87a0df6a..a7c0bbb20 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended 非表示フォルダーを表示 diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index b78f4f67b..05867cb6d 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Pokazuj ukryte foldery diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 273f27178..b57ea381a 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -87,6 +87,7 @@ Random order Use fade animations Move backwards + The slideshow ended Mostrar pastas ocultas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index e32e84203..077c17e7e 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Mostrar pastas ocultas diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 90f874c2c..15eb352d2 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Показать скрытые папки diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 73de54dca..3b3d198ba 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -86,6 +86,7 @@ Náhodné poradie Používať miznúce animácie Ísť opačným smerom + Prezentácia skončila Zobraziť skryté médiá diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index c282c6a00..4d9d2e355 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Visa dolda mappar diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index ee696c2d9..689996d7f 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Gizli klasörleri göster diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8bfcd3d45..65ee6ea6e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended 显示所有 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 7145b811c..3490d4708 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended 秀出隱藏資料夾 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f0d57ca99..624a33b7f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -86,6 +86,7 @@ Random order Use fade animations Move backwards + The slideshow ended Show hidden media From 3757616a4762e2edc94f594d48f18e6183b3dd35 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 14:05:51 +0200 Subject: [PATCH 129/174] hide the keyboard at togglig a slideshow setup checkbox --- app/build.gradle | 2 +- .../gallery/dialogs/SlideshowDialog.kt | 11 +++++++++++ app/src/main/res/layout/dialog_slideshow.xml | 2 -- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 161d4d82b..047a51425 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.24.0' + compile 'com.simplemobiletools:commons:2.24.1' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 a3b9aae99..18b97c326 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -4,6 +4,7 @@ import android.support.v7.app.AlertDialog import android.view.LayoutInflater import android.view.View import android.view.WindowManager +import com.simplemobiletools.commons.extensions.hideKeyboard import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity @@ -11,6 +12,7 @@ import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.helpers.SLIDESHOW_DEFAULT_INTERVAL import kotlinx.android.synthetic.main.dialog_slideshow.view.* + class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { val dialog: AlertDialog val view: View @@ -25,19 +27,28 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { } } + interval_value.setOnFocusChangeListener { v, hasFocus -> + if (!hasFocus) + activity.hideKeyboard(v) + } + include_videos_holder.setOnClickListener { + interval_value.clearFocus() include_videos.toggle() } random_order_holder.setOnClickListener { + interval_value.clearFocus() random_order.toggle() } use_fade_holder.setOnClickListener { + interval_value.clearFocus() use_fade.toggle() } move_backwards_holder.setOnClickListener { + interval_value.clearFocus() move_backwards.toggle() } } diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index 398f667ac..7679ec6d9 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -5,8 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - Date: Sat, 5 Aug 2017 14:52:42 +0200 Subject: [PATCH 130/174] filter out videos, or shuffle the media at slideshow when appropriate --- .../gallery/activities/ViewPagerActivity.kt | 49 ++++++++++++++----- app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 18 files changed, 54 insertions(+), 12 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index f8921e581..d22d0d7e4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -242,8 +242,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return true } - private fun updatePagerItems() { - val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia.toMutableList()) + private fun updatePagerItems(media: MutableList) { + val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, media) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) { view_pager.apply { adapter = pagerAdapter @@ -261,12 +261,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun startSlideshow() { - hideSystemUI() - mSlideshowInterval = config.slideshowInterval - mSlideshowMoveBackwards = config.slideshowMoveBackwards - mIsSlideshowActive = true - scheduleSwipe() - window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + if (getMediaForSlideshow()) { + hideSystemUI() + mSlideshowInterval = config.slideshowInterval + mSlideshowMoveBackwards = config.slideshowMoveBackwards + mIsSlideshowActive = true + scheduleSwipe() + window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + } } private fun stopSlideshow() { @@ -294,6 +296,29 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } + private fun getMediaForSlideshow(): Boolean { + var slideshowMedia = mMedia.toMutableList() + if (!config.slideshowIncludeVideos) { + slideshowMedia = slideshowMedia.filter { it.isImage() || it.isGif() } as MutableList + } + + if (config.slideshowRandomOrder) { + Collections.shuffle(slideshowMedia) + mPos = 0 + } else { + mPath = getCurrentPath() + mPos = getPositionInList(slideshowMedia) + } + + return if (slideshowMedia.isEmpty()) { + toast(R.string.no_media_for_slideshow) + false + } else { + updatePagerItems(slideshowMedia) + true + } + } + private fun copyMoveTo(isCopyOperation: Boolean) { val files = ArrayList(1).apply { add(getCurrentFile()) } tryCopyMoveFilesTo(files, isCopyOperation) { @@ -527,21 +552,21 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mPrevHashcode = media.hashCode() mMedia = media if (mPos == -1) { - mPos = getProperPosition() + mPos = getPositionInList(media) } else { mPos = Math.min(mPos, mMedia.size - 1) } updateActionbarTitle() - updatePagerItems() + updatePagerItems(mMedia.toMutableList()) invalidateOptionsMenu() checkOrientation() } - private fun getProperPosition(): Int { + private fun getPositionInList(items: MutableList): Int { mPos = 0 var i = 0 - for (medium in mMedia) { + for (medium in items) { if (medium.path == mPath) { return i } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 1493a9c34..b8d448371 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Zobrazit skryté média diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 040131968..e6ff1b2c1 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Versteckte Ordner zeigen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index a6eb944ae..209da01f5 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Mostrar carpetas ocultas diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d993abc15..1ccc71678 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Afficher les dossiers cachés diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 720943b49..c4cd345d5 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Show hidden media diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 904972ae8..a5d45c2ca 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Mostra cartelle nascoste diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index a7c0bbb20..4091adc4a 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found 非表示フォルダーを表示 diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 05867cb6d..c54a4e2ec 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Pokazuj ukryte foldery diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index b57ea381a..e54551925 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -88,6 +88,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Mostrar pastas ocultas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 077c17e7e..d4a248432 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Mostrar pastas ocultas diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 15eb352d2..581c31ace 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Показать скрытые папки diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 3b3d198ba..b2f2f7a72 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -87,6 +87,7 @@ Používať miznúce animácie Ísť opačným smerom Prezentácia skončila + Pre prezentáciu sa nenašli žiadne vhodné súbory Zobraziť skryté médiá diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 4d9d2e355..67d51e72a 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Visa dolda mappar diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 689996d7f..fba714c2a 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Gizli klasörleri göster diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 65ee6ea6e..ed7d6b9ab 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found 显示所有 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 3490d4708..d036415d4 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found 秀出隱藏資料夾 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 624a33b7f..8ad387a9b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -87,6 +87,7 @@ Use fade animations Move backwards The slideshow ended + No media for the slideshow have been found Show hidden media From 3f1cfab6338656b4aa7cb6c991a557046dd52330 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 15:53:02 +0200 Subject: [PATCH 131/174] properly handle launching videos in slideshows --- .../gallery/activities/PhotoVideoActivity.kt | 2 + .../gallery/activities/ViewPagerActivity.kt | 84 ++++++++++++------- .../gallery/fragments/VideoFragment.kt | 15 ++-- .../gallery/fragments/ViewPagerFragment.kt | 2 + 4 files changed, 70 insertions(+), 33 deletions(-) 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 36eb2aa1c..96fc44b10 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -162,4 +162,6 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList showSystemUI() } } + + override fun videoEnded() = false } 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 d22d0d7e4..a44cea9a6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -32,6 +32,7 @@ import com.simplemobiletools.gallery.dialogs.SaveAsDialog import com.simplemobiletools.gallery.dialogs.SlideshowDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.fragments.PhotoFragment +import com.simplemobiletools.gallery.fragments.VideoFragment import com.simplemobiletools.gallery.fragments.ViewPagerFragment import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium @@ -56,6 +57,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mSlideshowHandler = Handler() private var mSlideshowInterval = SLIDESHOW_DEFAULT_INTERVAL private var mSlideshowMoveBackwards = false + private var mSlideshowMedia = mutableListOf() + private var mAreSlideShowMediaVisible = false companion object { var screenWidth = 0 @@ -262,12 +265,20 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun startSlideshow() { if (getMediaForSlideshow()) { - hideSystemUI() - mSlideshowInterval = config.slideshowInterval - mSlideshowMoveBackwards = config.slideshowMoveBackwards - mIsSlideshowActive = true - scheduleSwipe() - window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + view_pager.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { + override fun onGlobalLayout() { + view_pager.viewTreeObserver.removeOnGlobalLayoutListener(this) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && isDestroyed) + return + + hideSystemUI() + mSlideshowInterval = config.slideshowInterval + mSlideshowMoveBackwards = config.slideshowMoveBackwards + mIsSlideshowActive = true + window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + scheduleSwipe() + } + }) } } @@ -283,38 +294,47 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun scheduleSwipe() { mSlideshowHandler.removeCallbacksAndMessages(null) if (mIsSlideshowActive) { - mSlideshowHandler.postDelayed({ - if (mIsSlideshowActive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) { - val before = view_pager.currentItem - view_pager.currentItem = if (mSlideshowMoveBackwards) --view_pager.currentItem else ++view_pager.currentItem - if (before == view_pager.currentItem) { - stopSlideshow() - toast(R.string.slideshow_ended) + if (getCurrentMedium()!!.isImage() || getCurrentMedium()!!.isGif()) { + mSlideshowHandler.postDelayed({ + if (mIsSlideshowActive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) { + swipeToNextMedium() } - } - }, mSlideshowInterval * 1000L) + }, mSlideshowInterval * 1000L) + } else { + (getCurrentFragment() as? VideoFragment)!!.playVideo() + } + } + } + + private fun swipeToNextMedium() { + val before = view_pager.currentItem + 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 { - var slideshowMedia = mMedia.toMutableList() + mSlideshowMedia = mMedia.toMutableList() if (!config.slideshowIncludeVideos) { - slideshowMedia = slideshowMedia.filter { it.isImage() || it.isGif() } as MutableList + mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGif() } as MutableList } if (config.slideshowRandomOrder) { - Collections.shuffle(slideshowMedia) + Collections.shuffle(mSlideshowMedia) mPos = 0 } else { mPath = getCurrentPath() - mPos = getPositionInList(slideshowMedia) + mPos = getPositionInList(mSlideshowMedia) } - return if (slideshowMedia.isEmpty()) { + return if (mSlideshowMedia.isEmpty()) { toast(R.string.no_media_for_slideshow) false } else { - updatePagerItems(slideshowMedia) + updatePagerItems(mSlideshowMedia) + mAreSlideShowMediaVisible = true true } } @@ -336,7 +356,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View getCurrentMedium()!!.apply { name = newFileName path = it.absolutePath - mMedia[mPos] = this + getCurrentMedia()[mPos] = this } invalidateOptionsMenu() } @@ -498,7 +518,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun askConfirmDelete() { ConfirmationDialog(this) { - deleteFileBg(File(mMedia[mPos].path)) { + deleteFileBg(File(getCurrentMedia()[mPos].path)) { reloadViewPager() } } @@ -515,7 +535,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun renameFile() { RenameItemDialog(this, getCurrentPath()) { - mMedia[mPos].path = it + getCurrentMedia()[mPos].path = it updateActionbarTitle() } } @@ -600,6 +620,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View checkSystemUI() } + override fun videoEnded(): Boolean { + if (mIsSlideshowActive) + swipeToNextMedium() + return mIsSlideshowActive + } + private fun checkSystemUI() { if (mIsFullScreen) { hideSystemUI() @@ -611,19 +637,21 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun updateActionbarTitle() { runOnUiThread { - if (mPos < mMedia.size) { - title = mMedia[mPos].path.getFilenameFromPath() + if (mPos < getCurrentMedia().size) { + title = getCurrentMedia()[mPos].path.getFilenameFromPath() } } } private fun getCurrentMedium(): Medium? { - return if (mMedia.isEmpty() || mPos == -1) + return if (getCurrentMedia().isEmpty() || mPos == -1) null else - mMedia[Math.min(mPos, mMedia.size - 1)] + getCurrentMedia()[Math.min(mPos, getCurrentMedia().size - 1)] } + private fun getCurrentMedia() = if (mAreSlideShowMediaVisible) mSlideshowMedia else mMedia + private fun getCurrentPath() = getCurrentMedium()!!.path private fun getCurrentFile() = File(getCurrentPath()) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 70815d787..4987a6f3b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -39,6 +39,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mIsDragged = false private var mIsFullscreen = false private var mIsFragmentVisible = false + private var mPlayOnPrepare = false private var mCurrTime = 0 private var mDuration = 0 @@ -194,9 +195,13 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } } - private fun playVideo() { - mIsPlaying = true - mMediaPlayer?.start() + fun playVideo() { + if (mMediaPlayer != null) { + mIsPlaying = true + mMediaPlayer?.start() + } else { + mPlayOnPrepare = true + } mView.video_play_outline.setImageDrawable(null) activity.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) } @@ -271,12 +276,12 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee setupTimeHolder() setProgress(mCurrTime) - if (mIsFragmentVisible && context.config.autoplayVideos) + if (mIsFragmentVisible && (context.config.autoplayVideos || mPlayOnPrepare)) playVideo() } private fun videoCompleted() { - if (context.config.loopVideos) { + if (listener?.videoEnded() == false && context.config.loopVideos) { playVideo() } else { mSeekBar!!.progress = mSeekBar!!.max diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt index c8f443502..6121151ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt @@ -9,5 +9,7 @@ abstract class ViewPagerFragment : Fragment() { interface FragmentListener { fun fragmentClicked() + + fun videoEnded(): Boolean } } From 5b3fa4443239a54ee8e1d6bce88c2c4dab3d134f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 16:12:19 +0200 Subject: [PATCH 132/174] add a new slideshow setup toggle for including photos --- .../gallery/activities/ViewPagerActivity.kt | 4 ++++ .../gallery/dialogs/SlideshowDialog.kt | 7 ++++++ .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/dialog_slideshow.xml | 23 ++++++++++++++++++- app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 22 files changed, 55 insertions(+), 1 deletion(-) 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 a44cea9a6..fbdb2ca2a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -317,6 +317,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun getMediaForSlideshow(): Boolean { mSlideshowMedia = mMedia.toMutableList() + if (!config.slideshowIncludePhotos) { + mSlideshowMedia = mSlideshowMedia.filter { !it.isImage() && !it.isGif() } as MutableList + } + if (!config.slideshowIncludeVideos) { mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGif() } as MutableList } 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 18b97c326..f28d8ef62 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -32,6 +32,11 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { activity.hideKeyboard(v) } + include_photos_holder.setOnClickListener { + interval_value.clearFocus() + include_photos.toggle() + } + include_videos_holder.setOnClickListener { interval_value.clearFocus() include_videos.toggle() @@ -67,6 +72,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { val config = activity.config view.apply { interval_value.setText(config.slideshowInterval.toString()) + include_photos.isChecked = config.slideshowIncludePhotos include_videos.isChecked = config.slideshowIncludeVideos random_order.isChecked = config.slideshowRandomOrder use_fade.isChecked = config.slideshowUseFade @@ -81,6 +87,7 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) { activity.config.apply { slideshowInterval = interval.toInt() + slideshowIncludePhotos = view.include_photos.isChecked slideshowIncludeVideos = view.include_videos.isChecked slideshowRandomOrder = view.random_order.isChecked slideshowUseFade = view.use_fade.isChecked diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 6dd00d0e4..167988674 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -237,6 +237,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getInt(SLIDESHOW_INTERVAL, SLIDESHOW_DEFAULT_INTERVAL) set(slideshowInterval) = prefs.edit().putInt(SLIDESHOW_INTERVAL, slideshowInterval).apply() + var slideshowIncludePhotos: Boolean + get() = prefs.getBoolean(SLIDESHOW_INCLUDE_PHOTOS, true) + set(slideshowIncludePhotos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_PHOTOS, slideshowIncludePhotos).apply() + var slideshowIncludeVideos: Boolean get() = prefs.getBoolean(SLIDESHOW_INCLUDE_VIDEOS, false) set(slideshowIncludeVideos) = prefs.edit().putBoolean(SLIDESHOW_INCLUDE_VIDEOS, slideshowIncludeVideos).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 5cf46791d..3efd48714 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -36,6 +36,7 @@ val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" // slideshow val SLIDESHOW_INTERVAL = "slideshow_interval" +val SLIDESHOW_INCLUDE_PHOTOS = "slideshow_include_photos" val SLIDESHOW_INCLUDE_VIDEOS = "slideshow_include_videos" val SLIDESHOW_RANDOM_ORDER = "slideshow_random_order" val SLIDESHOW_USE_FADE = "slideshow_use_fade" diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index 7679ec6d9..1d5a8ef07 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -36,7 +36,7 @@ android:textCursorDrawable="@null"/> + + + + + + Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e6ff1b2c1..15edc4c14 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 209da01f5..289f5952d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 1ccc71678..8de03c48b 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index c4cd345d5..bac507479 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index a5d45c2ca..f44110e78 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 4091adc4a..6ce45effd 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index c54a4e2ec..af31be8ef 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index e54551925..7e5802637 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -83,6 +83,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d4a248432..58837e577 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 581c31ace..0a5bac819 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index b2f2f7a72..479cd2c35 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -82,6 +82,7 @@ Prezentácia Interval (sekundy): + Zahrnúť fotky a GIF súbory Zahrnúť videá Náhodné poradie Používať miznúce animácie diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 67d51e72a..2ddde4be5 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fba714c2a..b149647dd 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index ed7d6b9ab..45a0ab99a 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d036415d4..e72c34abd 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8ad387a9b..69c044f18 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -82,6 +82,7 @@ Slideshow Interval (seconds): + Include photos and GIFs Include videos Random order Use fade animations From 5c448081f068ba608869e0725c021fd661d85608 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 16:23:52 +0200 Subject: [PATCH 133/174] hide the Use fade animations slideshow toggle for now --- app/src/main/res/layout/dialog_slideshow.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/dialog_slideshow.xml b/app/src/main/res/layout/dialog_slideshow.xml index 1d5a8ef07..d057acf77 100644 --- a/app/src/main/res/layout/dialog_slideshow.xml +++ b/app/src/main/res/layout/dialog_slideshow.xml @@ -107,7 +107,8 @@ android:paddingBottom="@dimen/activity_margin" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:paddingTop="@dimen/activity_margin"> + android:paddingTop="@dimen/activity_margin" + android:visibility="gone"> Date: Sat, 5 Aug 2017 16:34:49 +0200 Subject: [PATCH 134/174] replace the selected directory foreground marker with a temporary check icon --- .../gallery/adapters/DirectoryAdapter.kt | 31 +++---------------- app/src/main/res/layout-v23/directory_tmb.xml | 6 ---- app/src/main/res/layout/directory_item.xml | 22 ++++++++----- app/src/main/res/layout/directory_tmb.xml | 15 --------- 4 files changed, 18 insertions(+), 56 deletions(-) delete mode 100644 app/src/main/res/layout-v23/directory_tmb.xml delete mode 100644 app/src/main/res/layout/directory_tmb.xml 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 391386562..f359bccf1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -1,11 +1,9 @@ package com.simplemobiletools.gallery.adapters -import android.os.Build import android.support.v7.view.ActionMode import android.support.v7.widget.RecyclerView import android.util.SparseArray import android.view.* -import android.widget.FrameLayout import com.bignerdranch.android.multiselector.ModalMultiSelectorCallback import com.bignerdranch.android.multiselector.MultiSelector import com.bignerdranch.android.multiselector.SwappingHolder @@ -23,7 +21,6 @@ import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.models.AlbumCover import com.simplemobiletools.gallery.models.Directory import kotlinx.android.synthetic.main.directory_item.view.* -import kotlinx.android.synthetic.main.directory_tmb.view.* import java.io.File import java.util.* @@ -42,7 +39,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList = selectedPositions } @@ -136,7 +117,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList } diff --git a/app/src/main/res/layout-v23/directory_tmb.xml b/app/src/main/res/layout-v23/directory_tmb.xml deleted file mode 100644 index aab55c8ac..000000000 --- a/app/src/main/res/layout-v23/directory_tmb.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/app/src/main/res/layout/directory_item.xml b/app/src/main/res/layout/directory_item.xml index 0ffe85d1a..1f71cde77 100644 --- a/app/src/main/res/layout/directory_item.xml +++ b/app/src/main/res/layout/directory_item.xml @@ -6,14 +6,20 @@ android:layout_height="wrap_content" android:padding="1px"> - + android:layout_height="match_parent"/> - - - + - - - - - - - From 15159de4e981d2abdfb0c1a8cd0f11e510fa9ce7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 16:55:12 +0200 Subject: [PATCH 135/174] add colored background to the currently selected directory thumbnail --- .../gallery/activities/MainActivity.kt | 4 ++-- .../gallery/adapters/DirectoryAdapter.kt | 23 ++++++++----------- .../main/res/drawable/circle_background.xml | 9 ++++++++ app/src/main/res/layout/directory_item.xml | 6 +++-- app/src/main/res/values-sw600dp/dimens.xml | 1 + app/src/main/res/values/dimens.xml | 1 + 6 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 app/src/main/res/drawable/circle_background.xml 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 3da7e96c0..b665c7f06 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -227,8 +227,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun checkIfColorChanged() { - if (directories_grid.adapter != null && getRecyclerAdapter().foregroundColor != config.primaryColor) { - getRecyclerAdapter().updatePrimaryColor(config.primaryColor) + if (directories_grid.adapter != null && getRecyclerAdapter().primaryColor != config.primaryColor) { + getRecyclerAdapter().primaryColor = config.primaryColor directories_vertical_fastscroller.updateHandleColor() directories_horizontal_fastscroller.updateHandleColor() } 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 f359bccf1..18feb60e0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -1,5 +1,6 @@ package com.simplemobiletools.gallery.adapters +import android.graphics.PorterDuff import android.support.v7.view.ActionMode import android.support.v7.widget.RecyclerView import android.util.SparseArray @@ -33,19 +34,19 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList() val selectedPositions = HashSet() - var foregroundColor = config.primaryColor + var primaryColor = config.primaryColor var pinnedFolders = config.pinnedFolders var scrollVertically = !config.scrollHorizontally fun toggleItemSelection(select: Boolean, pos: Int) { - if (itemViews[pos] != null) - itemViews[pos].dir_check.beVisibleIf(select) - - if (select) + if (select) { + itemViews[pos].dir_check.background.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN) selectedPositions.add(pos) - else + } else selectedPositions.remove(pos) + itemViews[pos]?.dir_check?.beVisibleIf(select) + if (selectedPositions.isEmpty()) { actMode?.finish() return @@ -59,14 +60,6 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList + + + + + diff --git a/app/src/main/res/layout/directory_item.xml b/app/src/main/res/layout/directory_item.xml index 1f71cde77..98e94a3e2 100644 --- a/app/src/main/res/layout/directory_item.xml +++ b/app/src/main/res/layout/directory_item.xml @@ -13,12 +13,14 @@ 150dp 120dp 30dp + 38dp 60dp 230dp 32dp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 7e8edefbe..7301b88ac 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -3,6 +3,7 @@ 150dp 100dp 20dp + 26dp 40dp 150dp 24dp From 9ee127399551e82488267ed835ca18075bfc0181 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 17:02:18 +0200 Subject: [PATCH 136/174] fix #171, change multiselector to use colored circle Check icons --- .../gallery/activities/MediaActivity.kt | 4 +- .../gallery/adapters/DirectoryAdapter.kt | 3 +- .../gallery/adapters/MediaAdapter.kt | 48 ++++--------------- .../gallery/extensions/Int.kt | 24 ---------- .../main/res/layout-v23/photo_video_tmb.xml | 6 --- app/src/main/res/layout/photo_video_item.xml | 24 ++++++---- app/src/main/res/layout/photo_video_tmb.xml | 16 ------- 7 files changed, 28 insertions(+), 97 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Int.kt delete mode 100644 app/src/main/res/layout-v23/photo_video_tmb.xml delete mode 100644 app/src/main/res/layout/photo_video_tmb.xml 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 55c1f801a..6229ffce7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -129,8 +129,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } private fun checkIfColorChanged() { - if (media_grid.adapter != null && getRecyclerAdapter().foregroundColor != config.primaryColor) { - getRecyclerAdapter().updatePrimaryColor(config.primaryColor) + if (media_grid.adapter != null && getRecyclerAdapter().primaryColor != config.primaryColor) { + getRecyclerAdapter().primaryColor = config.primaryColor media_horizontal_fastscroller.updateHandleColor() media_vertical_fastscroller.updateHandleColor() } 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 18feb60e0..daec3c8cc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -109,8 +109,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, var actMode: ActionMode? = null var itemViews = SparseArray() val selectedPositions = HashSet() - var foregroundColor = config.primaryColor + var primaryColor = config.primaryColor var displayFilenames = config.displayFileNames var scrollVertically = !config.scrollHorizontally fun toggleItemSelection(select: Boolean, pos: Int) { - if (itemViews[pos] != null) - getProperView(itemViews[pos]!!).isSelected = select - - if (select) + if (select) { + itemViews[pos].medium_check.background.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN) selectedPositions.add(pos) - else + } else selectedPositions.remove(pos) + itemViews[pos]?.medium_check?.beVisibleIf(select) + if (selectedPositions.isEmpty()) { actMode?.finish() return @@ -53,40 +52,16 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, updateTitle(selectedPositions.size) } - fun getProperView(itemView: View): View { - return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) - itemView.medium_thumbnail_holder - else - itemView.medium_thumbnail - } - fun updateTitle(cnt: Int) { actMode?.title = "$cnt / ${media.size}" actMode?.invalidate() } - fun updatePrimaryColor(color: Int) { - foregroundColor = color - (0..itemViews.size() - 1).mapNotNull { itemViews[it] } - .forEach { setupItemViewForeground(it) } - } - - private fun setupItemViewForeground(itemView: View) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) - (getProperView(itemView) as FrameLayout).foreground = foregroundColor.createSelector() - else - getProperView(itemView).foreground = foregroundColor.createSelector() - } - val adapterListener = object : MyAdapterListener { override fun toggleItemSelectionAdapter(select: Boolean, position: Int) { toggleItemSelection(select, position) } - override fun setupItemForeground(itemView: View) { - setupItemViewForeground(itemView) - } - override fun getSelectedPositions(): HashSet = selectedPositions } @@ -127,8 +102,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, override fun onDestroyActionMode(actionMode: ActionMode?) { super.onDestroyActionMode(actionMode) selectedPositions.forEach { - if (itemViews[it] != null) - getProperView(itemViews[it]!!).isSelected = false + itemViews[it]?.medium_check?.beGone() } selectedPositions.clear() actMode = null @@ -348,8 +322,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, setOnClickListener { viewClicked(medium) } setOnLongClickListener { if (isPickIntent) viewClicked(medium) else viewLongClicked(); true } - - adapterListener.setupItemForeground(this) } return itemView } @@ -383,8 +355,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, interface MyAdapterListener { fun toggleItemSelectionAdapter(select: Boolean, position: Int) - fun setupItemForeground(itemView: View) - fun getSelectedPositions(): HashSet } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Int.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Int.kt deleted file mode 100644 index 064c348b6..000000000 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Int.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.simplemobiletools.gallery.extensions - -import android.content.res.ColorStateList -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.RippleDrawable -import android.graphics.drawable.StateListDrawable -import android.os.Build -import com.simplemobiletools.commons.extensions.adjustAlpha - -fun Int.createSelector(): StateListDrawable { - val statelist = StateListDrawable() - val selectedDrawable = ColorDrawable(adjustAlpha(0.5f)) - statelist.addState(intArrayOf(android.R.attr.state_selected), selectedDrawable) - - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - val pressedDrawable = ColorDrawable(adjustAlpha(0.2f)) - statelist.addState(intArrayOf(android.R.attr.state_pressed), pressedDrawable) - } else { - val pressedDrawable = RippleDrawable(ColorStateList.valueOf(adjustAlpha(0.2f)), null, ColorDrawable(Color.WHITE)) - statelist.addState(intArrayOf(), pressedDrawable) - } - return statelist -} diff --git a/app/src/main/res/layout-v23/photo_video_tmb.xml b/app/src/main/res/layout-v23/photo_video_tmb.xml deleted file mode 100644 index 5044be391..000000000 --- a/app/src/main/res/layout-v23/photo_video_tmb.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/app/src/main/res/layout/photo_video_item.xml b/app/src/main/res/layout/photo_video_item.xml index 1ba94a083..f8fe7a6b6 100644 --- a/app/src/main/res/layout/photo_video_item.xml +++ b/app/src/main/res/layout/photo_video_item.xml @@ -6,14 +6,22 @@ android:layout_height="wrap_content" android:padding="1px"> - + android:layout_height="match_parent"/> - - - + - - - - - - - - From b98ac025dba4e3080bafa32c72d8be037beaab40 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 18:19:43 +0200 Subject: [PATCH 137/174] update commons to 2.25.0 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 047a51425..bc155dee1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.24.1' + compile 'com.simplemobiletools:commons:2.25.0' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From 6ed4c15f9e1547f26716d48948318b9ca049f577 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 18:22:15 +0200 Subject: [PATCH 138/174] added slideshow to release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index b665c7f06..5e6f94ec4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -492,6 +492,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(115, R.string.release_115)) add(Release(118, R.string.release_118)) add(Release(119, R.string.release_119)) + add(Release(122, R.string.release_122)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 408607448..10834335c 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Added slideshow at the fullscreen view Added pattern/pin protection for showing hidden items Added a toggle for replacing Share with Rotate at fullscreen media From f2a25d5fa3dd8752a06dbea66f9085efb1f86fa4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 18:22:23 +0200 Subject: [PATCH 139/174] update version to 2.12.6 (122) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bc155dee1..3e3bc000c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 121 - versionName "2.12.5" + versionCode 122 + versionName "2.12.6" } signingConfigs { From 2978db38acff09ca0a0fa052b65d35f9eca095da Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Aug 2017 23:42:23 +0200 Subject: [PATCH 140/174] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035ed5b80..21d7dc7f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 2.12.6 *(2017-08-05)* +---------------------------- + + * Added slideshow at the fullscreen view + * Replaced the foreground color of selected items with a check + * Made copy/move to SD card a lot faster + Version 2.12.5 *(2017-08-03)* ---------------------------- From 178c92c993ee647fe2993fe41621a66b9d4b65aa Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 12:20:12 +0200 Subject: [PATCH 141/174] move the thumbnail video icon to the top left corner --- app/src/main/res/layout/photo_video_item.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/photo_video_item.xml b/app/src/main/res/layout/photo_video_item.xml index f8fe7a6b6..911cd1a72 100644 --- a/app/src/main/res/layout/photo_video_item.xml +++ b/app/src/main/res/layout/photo_video_item.xml @@ -27,8 +27,8 @@ android:id="@+id/play_outline" android:layout_width="@dimen/play_outline_size" android:layout_height="@dimen/play_outline_size" - android:layout_alignParentEnd="true" - android:layout_alignParentRight="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_margin="@dimen/tiny_margin" android:src="@drawable/img_play_outline" From 7fa71c530223bb06aa5a8934a8619d9e5cb48ada Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 12:21:31 +0200 Subject: [PATCH 142/174] add null checks at toggleItemSelection of adapters --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 2 +- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index daec3c8cc..3ef268ecf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -40,7 +40,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, fun toggleItemSelection(select: Boolean, pos: Int) { 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) } else selectedPositions.remove(pos) From a493595207be6d6861da28112a4c61c3e7edea69 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 13:38:54 +0200 Subject: [PATCH 143/174] compare directory paths incasesensitively on the first screen --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 539e78e1e..db9845f72 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -43,8 +43,8 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va cancel(true) val parentDir = File(path).parent ?: continue - if (directories.containsKey(parentDir)) { - val directory = directories[parentDir]!! + if (directories.containsKey(parentDir.toLowerCase())) { + val directory = directories[parentDir.toLowerCase()]!! val newImageCnt = directory.mediaCnt + 1 directory.mediaCnt = newImageCnt directory.addSize(size) @@ -71,7 +71,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } val directory = Directory(parentDir, thumbnail, dirName, 1, dateModified, dateTaken, size) - directories.put(parentDir, directory) + directories.put(parentDir.toLowerCase(), directory) } } return directories From 1074043c93572644c02e2b7e741e495760014a23 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 14:08:17 +0200 Subject: [PATCH 144/174] update commons to 2.25.1 for proper alphanumeric sorting --- app/build.gradle | 2 +- .../gallery/models/Directory.kt | 7 ++----- .../gallery/models/Medium.kt | 19 ++++++++----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3e3bc000c..572ac4a1a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.25.0' + compile 'com.simplemobiletools:commons:2.25.1' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 77cd94602..6293eba76 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -1,9 +1,6 @@ package com.simplemobiletools.gallery.models -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.commons.helpers.* 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, @@ -20,7 +17,7 @@ data class Directory(val path: String, val tmb: String, val name: String, var me override fun compareTo(other: Directory): Int { var result: Int if (sorting and SORT_BY_NAME != 0) { - result = name.toLowerCase().compareTo(other.name.toLowerCase()) + result = AlphanumComparator().compare(name.toLowerCase(), other.name.toLowerCase()) } else if (sorting and SORT_BY_SIZE != 0) { result = if (size == other.size) 0 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 0fb1aa59a..1663c60b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -3,10 +3,7 @@ package com.simplemobiletools.gallery.models import com.simplemobiletools.commons.extensions.getMimeType import com.simplemobiletools.commons.extensions.isGif import com.simplemobiletools.commons.extensions.isPng -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.commons.helpers.* import java.io.File import java.io.Serializable @@ -27,25 +24,25 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo fun getMimeType() = File(path).getMimeType() override fun compareTo(other: Medium): Int { - var res: Int + var result: Int if (sorting and SORT_BY_NAME != 0) { - res = name.toLowerCase().compareTo(other.name.toLowerCase()) + result = AlphanumComparator().compare(name.toLowerCase(), other.name.toLowerCase()) } else if (sorting and SORT_BY_SIZE != 0) { - res = if (size == other.size) + result = if (size == other.size) 0 else if (size > other.size) 1 else -1 } else if (sorting and SORT_BY_DATE_MODIFIED != 0) { - res = if (modified == other.modified) + result = if (modified == other.modified) 0 else if (modified > other.modified) 1 else -1 } else { - res = if (taken == other.taken) + result = if (taken == other.taken) 0 else if (taken > other.taken) 1 @@ -54,8 +51,8 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo } if (sorting and SORT_DESCENDING != 0) { - res *= -1 + result *= -1 } - return res + return result } } From 15c20ab75866617c69d7cb4a56f3cbd018130661 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 16:44:00 +0200 Subject: [PATCH 145/174] add a volume slider at the video fragments right side --- .../gallery/fragments/VideoFragment.kt | 39 +++++++++++++++++++ app/src/main/res/layout/pager_video_item.xml | 7 ++++ app/src/main/res/values/dimens.xml | 1 + 3 files changed, 47 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 4987a6f3b..a2e2202b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -17,6 +17,7 @@ import com.simplemobiletools.commons.extensions.getFormattedDuration import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.getNavBarHeight import com.simplemobiletools.gallery.extensions.hasNavBar @@ -26,6 +27,7 @@ import kotlinx.android.synthetic.main.pager_video_item.view.* import java.io.IOException class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSeekBarChangeListener { + private val CLICK_MAX_DURATION = 150 private var mMediaPlayer: MediaPlayer? = null private var mSurfaceView: SurfaceView? = null @@ -43,6 +45,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mCurrTime = 0 private var mDuration = 0 + private var mTouchDownX = 0f + private var mTouchDownY = 0f + private var mTouchDownTime = 0L + lateinit var mView: View lateinit var medium: Medium @@ -82,6 +88,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mSurfaceHolder!!.addCallback(this) mSurfaceView!!.setOnClickListener({ toggleFullscreen() }) mView.video_holder.setOnClickListener { toggleFullscreen() } + mView.video_volume_controller.setOnTouchListener { v, event -> + handleVolumeTouched(event) + true + } initTimeHolder() } @@ -112,6 +122,35 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee listener?.fragmentClicked() } + private fun handleVolumeTouched(event: MotionEvent) { + when (event.action) { + MotionEvent.ACTION_DOWN -> { + mTouchDownX = event.x + mTouchDownY = event.y + mTouchDownTime = System.currentTimeMillis() + } + MotionEvent.ACTION_MOVE -> { + val diffX = mTouchDownX - event.x + val diffY = mTouchDownY - event.y + + if (Math.abs(diffY) > Math.abs(diffX)) { + var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 2 + percent = Math.min(100, Math.max(-100, percent)) + volumePercentChanged(percent) + } + } + MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { + if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { + mView.video_holder.performClick() + } + } + } + } + + private fun volumePercentChanged(percent: Int) { + + } + private fun initTimeHolder() { mTimeHolder = mView.video_time_holder val res = resources diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml index 572e96c33..5ccf04cb8 100644 --- a/app/src/main/res/layout/pager_video_item.xml +++ b/app/src/main/res/layout/pager_video_item.xml @@ -12,6 +12,13 @@ android:layout_centerInParent="true" android:background="@android:color/transparent"/> + + 150dp 24dp 50dp + 150dp From dc42dd566f29ed29294d8682feec24173ad28df2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 16:54:58 +0200 Subject: [PATCH 146/174] show hidden items in viewpager only if the selected item is hidden --- .../gallery/activities/ViewPagerActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index fbdb2ca2a..b88493874 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -98,9 +98,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return } - if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) { - if (!config.isPasswordProtectionOn) + if (intent.extras?.containsKey(IS_VIEW_INTENT) == true && File(mPath).isHidden) { + if (!config.isPasswordProtectionOn) { config.temporarilyShowHidden = true + } } showSystemUI() From af84b8e9e3cba9e124aa596d7dab2420a77ad0b0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 18:35:28 +0200 Subject: [PATCH 147/174] allow changing the volume by finger dragging on the right side of the video --- .../simplemobiletools/gallery/extensions/context.kt | 2 ++ .../gallery/fragments/VideoFragment.kt | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index ebbf2772f..2d990287a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -4,6 +4,7 @@ import android.content.Context import android.content.Intent import android.content.res.Configuration import android.database.Cursor +import android.media.AudioManager import android.net.Uri import android.provider.MediaStore import com.simplemobiletools.commons.extensions.* @@ -21,6 +22,7 @@ import java.io.File import java.util.* val Context.portrait get() = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT +val Context.audioManager get() = getSystemService(Context.AUDIO_SERVICE) as AudioManager fun Context.getRealPathFromURI(uri: Uri): String? { var cursor: Cursor? = null diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index a2e2202b9..a816ee4bb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -18,6 +18,7 @@ import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.ViewPagerActivity +import com.simplemobiletools.gallery.extensions.audioManager import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.getNavBarHeight import com.simplemobiletools.gallery.extensions.hasNavBar @@ -26,6 +27,7 @@ import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.pager_video_item.view.* import java.io.IOException + class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSeekBarChangeListener { private val CLICK_MAX_DURATION = 150 @@ -48,6 +50,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mTouchDownX = 0f private var mTouchDownY = 0f private var mTouchDownTime = 0L + private var mTouchDownVolume = 0 lateinit var mView: View lateinit var medium: Medium @@ -128,6 +131,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mTouchDownX = event.x mTouchDownY = event.y mTouchDownTime = System.currentTimeMillis() + mTouchDownVolume = getCurrentVolume() } MotionEvent.ACTION_MOVE -> { val diffX = mTouchDownX - event.x @@ -147,8 +151,15 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } } - private fun volumePercentChanged(percent: Int) { + private fun getCurrentVolume() = context.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) + private fun volumePercentChanged(percent: Int) { + val stream = AudioManager.STREAM_MUSIC + val maxVolume = context.audioManager.getStreamMaxVolume(stream) + val percentPerPoint = Math.ceil(100 / maxVolume.toDouble()).toInt() + val addPoints = percent / percentPerPoint + val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownVolume + addPoints)) + context.audioManager.setStreamVolume(stream, newVolume, 0) } private fun initTimeHolder() { From 622ebde68ff87e320378b0cae956a4d15e3e6668 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 19:39:11 +0200 Subject: [PATCH 148/174] tweak the volume setter a bit --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index a816ee4bb..ac79cdec9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -138,7 +138,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee val diffY = mTouchDownY - event.y if (Math.abs(diffY) > Math.abs(diffX)) { - var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 2 + var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 percent = Math.min(100, Math.max(-100, percent)) volumePercentChanged(percent) } @@ -156,7 +156,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private fun volumePercentChanged(percent: Int) { val stream = AudioManager.STREAM_MUSIC val maxVolume = context.audioManager.getStreamMaxVolume(stream) - val percentPerPoint = Math.ceil(100 / maxVolume.toDouble()).toInt() + val percentPerPoint = 100 / maxVolume val addPoints = percent / percentPerPoint val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownVolume + addPoints)) context.audioManager.setStreamVolume(stream, newVolume, 0) From f3cddb1a6ba94942e22ea2a1f86ad1e35943bbc3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 20:03:37 +0200 Subject: [PATCH 149/174] add an indicator of the volume at sliding --- .../res/drawable/black_rounded_background.xml | 12 ++++++++++++ app/src/main/res/layout/pager_video_item.xml | 17 +++++++++++++++++ app/src/main/res/values-cs/strings.xml | 2 ++ app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values-es/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-hu/strings.xml | 2 ++ app/src/main/res/values-it/strings.xml | 2 ++ app/src/main/res/values-ja/strings.xml | 2 ++ app/src/main/res/values-pl/strings.xml | 2 ++ app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values-pt/strings.xml | 2 ++ app/src/main/res/values-ru/strings.xml | 2 ++ app/src/main/res/values-sk/strings.xml | 2 ++ app/src/main/res/values-sv/strings.xml | 2 ++ app/src/main/res/values-tr/strings.xml | 2 ++ app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 19 files changed, 63 insertions(+) create mode 100644 app/src/main/res/drawable/black_rounded_background.xml diff --git a/app/src/main/res/drawable/black_rounded_background.xml b/app/src/main/res/drawable/black_rounded_background.xml new file mode 100644 index 000000000..edf046060 --- /dev/null +++ b/app/src/main/res/drawable/black_rounded_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml index 5ccf04cb8..47de68c41 100644 --- a/app/src/main/res/layout/pager_video_item.xml +++ b/app/src/main/res/layout/pager_video_item.xml @@ -28,6 +28,23 @@ android:padding="@dimen/activity_margin" android:src="@drawable/img_play_outline_big"/> + + Select photo Use default Nastavit jako + Volume + Brightness 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? diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 15edc4c14..02de040d9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -23,6 +23,8 @@ Auswählen Standard Festlegen als + Volume + Brightness 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? diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 289f5952d..cdbaa4f91 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -23,6 +23,8 @@ Seleccionar imagen Uso por defecto Establecer como + Volume + Brightness 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? diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 8de03c48b..799a16f16 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness 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 ? diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index bac507479..ff22affba 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness 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? diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index f44110e78..9fed60a2a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -23,6 +23,8 @@ Seleziona foto Usa predefinita Imposta come + Volume + Brightness 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? diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 6ce45effd..cf5bcd268 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness 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? diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index af31be8ef..b1a6616e1 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -23,6 +23,8 @@ Wybierz obraz Użyj domyślnej Ustaw jako + Volume + Brightness 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ć? diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 7e5802637..47d8492cf 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -24,6 +24,8 @@ Selecionar foto Usar padrão Set as + Volume + Brightness 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? diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 58837e577..1a24729c8 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -23,6 +23,8 @@ Selecionar foto Predefinição Definir como + Volume + Brightness 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? diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 0a5bac819..b7d315abb 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness Эта опция скрывает папку, добавляя в неё файл \'.nomedia\'; будут скрыты все подпапки. Можно показывать их, переключая \'Показать скрытые папки\' в настройках. Продолжить? diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 479cd2c35..2472a8814 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -23,6 +23,8 @@ Zvoliť foto Použiť predvolený Nastaviť ako + Hlasitosť + Jas 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ť? diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 2ddde4be5..3c18193c3 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -23,6 +23,8 @@ Välj foto Använd standard Ange som + Volume + Brightness 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? diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index b149647dd..0d9c60a05 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness 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? diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 45a0ab99a..a9101a53f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -23,6 +23,8 @@ 选择图片 使用默认 设置为 + Volume + Brightness 通过添加文件 \'.nomedia\' 到目录,可以防止目录及其子目录下的所有媒体被扫描。您可以通过设置中的 \'显示隐藏目录\' 选项改变设置,是否继续? diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index e72c34abd..3a8698391 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness 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? diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 69c044f18..ec64ebeae 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,6 +23,8 @@ Select photo Use default Set as + Volume + Brightness 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? From 8aaf1df56814a69d0be045720f6e8ce4069432e9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 20:36:15 +0200 Subject: [PATCH 150/174] show the current volume if changed via sliding --- .../gallery/fragments/VideoFragment.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index ac79cdec9..dee60aa8e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -27,9 +27,9 @@ import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.pager_video_item.view.* import java.io.IOException - class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSeekBarChangeListener { private val CLICK_MAX_DURATION = 150 + private val SLIDE_INFO_FADE_DELAY = 1000L private var mMediaPlayer: MediaPlayer? = null private var mSurfaceView: SurfaceView? = null @@ -52,6 +52,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mTouchDownTime = 0L private var mTouchDownVolume = 0 + private var mSlideInfoText = "" + private var mSlideInfoFadeHandler = Handler() + lateinit var mView: View lateinit var medium: Medium @@ -132,6 +135,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mTouchDownY = event.y mTouchDownTime = System.currentTimeMillis() mTouchDownVolume = getCurrentVolume() + mSlideInfoText = "${getString(R.string.volume)}:\n" } MotionEvent.ACTION_MOVE -> { val diffX = mTouchDownX - event.x @@ -160,6 +164,17 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee val addPoints = percent / percentPerPoint val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownVolume + addPoints)) context.audioManager.setStreamVolume(stream, newVolume, 0) + + val absolutePercent = ((newVolume / maxVolume.toFloat()) * 100).toInt() + mView.slide_info.apply { + text = "$mSlideInfoText$absolutePercent%" + alpha = 1f + } + + mSlideInfoFadeHandler.removeCallbacksAndMessages(null) + mSlideInfoFadeHandler.postDelayed({ + mView.slide_info.animate().alpha(0f) + }, SLIDE_INFO_FADE_DELAY) } private fun initTimeHolder() { From c857c17f50ce65c58a25cb0fec93d00265c19ca4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Aug 2017 22:35:19 +0200 Subject: [PATCH 151/174] improve the volume slider ux --- .../gallery/fragments/PhotoFragment.kt | 2 +- .../gallery/fragments/VideoFragment.kt | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 1667d68c3..3d634a516 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -273,7 +273,7 @@ class PhotoFragment : ViewPagerFragment() { } } - override fun onConfigurationChanged(newConfig: Configuration?) { + override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) loadImage() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index dee60aa8e..5914da11f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -51,6 +51,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mTouchDownY = 0f private var mTouchDownTime = 0L private var mTouchDownVolume = 0 + private var mLastTouchY = 0f private var mSlideInfoText = "" private var mSlideInfoFadeHandler = Handler() @@ -118,7 +119,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } } - override fun onConfigurationChanged(newConfig: Configuration?) { + override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) setVideoSize() initTimeHolder() @@ -133,6 +134,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee MotionEvent.ACTION_DOWN -> { mTouchDownX = event.x mTouchDownY = event.y + mLastTouchY = event.y mTouchDownTime = System.currentTimeMillis() mTouchDownVolume = getCurrentVolume() mSlideInfoText = "${getString(R.string.volume)}:\n" @@ -144,8 +146,15 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee if (Math.abs(diffY) > Math.abs(diffX)) { var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 percent = Math.min(100, Math.max(-100, percent)) + + if ((percent == 100 && event.y > mLastTouchY) || (percent == -100 && event.y < mLastTouchY)) { + mTouchDownY = event.y + mTouchDownVolume = getCurrentVolume() + } + volumePercentChanged(percent) } + mLastTouchY = event.y } MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { From b0562e7ed10a1a2d420ac74bedfda068fd508c86 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 21:56:25 +0200 Subject: [PATCH 152/174] allow controlling the brightness with sliding too --- .../gallery/fragments/VideoFragment.kt | 70 +++++++++++++++++++ app/src/main/res/layout/pager_video_item.xml | 5 ++ 2 files changed, 75 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 5914da11f..f93bc617e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -7,6 +7,7 @@ import android.net.Uri import android.os.Build import android.os.Bundle import android.os.Handler +import android.provider.Settings import android.util.DisplayMetrics import android.util.Log import android.view.* @@ -51,6 +52,8 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mTouchDownY = 0f private var mTouchDownTime = 0L private var mTouchDownVolume = 0 + private var mTouchDownBrightness = -1 + private var mTempBrightness = 0 private var mLastTouchY = 0f private var mSlideInfoText = "" @@ -100,6 +103,11 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee true } + mView.video_brightness_controller.setOnTouchListener { v, event -> + handleBrightnessTouched(event) + true + } + initTimeHolder() } @@ -164,8 +172,48 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } } + private fun handleBrightnessTouched(event: MotionEvent) { + when (event.action) { + MotionEvent.ACTION_DOWN -> { + mTouchDownX = event.x + mTouchDownY = event.y + mLastTouchY = event.y + mTouchDownTime = System.currentTimeMillis() + mSlideInfoText = "${getString(R.string.brightness)}:\n" + if (mTouchDownBrightness == -1) + mTouchDownBrightness = getCurrentBrightness() + } + MotionEvent.ACTION_MOVE -> { + val diffX = mTouchDownX - event.x + val diffY = mTouchDownY - event.y + + if (Math.abs(diffY) > Math.abs(diffX)) { + var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 + percent = Math.min(100, Math.max(-100, percent)) + + if ((percent == 100 && event.y > mLastTouchY) || (percent == -100 && event.y < mLastTouchY)) { + mTouchDownY = event.y + mTouchDownBrightness = mTempBrightness + } + + brightnessPercentChanged(percent) + } + mLastTouchY = event.y + } + MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { + if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { + mView.video_holder.performClick() + } + mTouchDownBrightness = mTempBrightness + } + } + mView.video_holder + } + private fun getCurrentVolume() = context.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) + private fun getCurrentBrightness() = Settings.System.getInt(activity.contentResolver, Settings.System.SCREEN_BRIGHTNESS) + private fun volumePercentChanged(percent: Int) { val stream = AudioManager.STREAM_MUSIC val maxVolume = context.audioManager.getStreamMaxVolume(stream) @@ -186,6 +234,28 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee }, SLIDE_INFO_FADE_DELAY) } + private fun brightnessPercentChanged(percent: Int) { + val maxBrightness = 255f + var newBrightness = (mTouchDownBrightness + 2.55 * percent).toFloat() + newBrightness = Math.min(maxBrightness, Math.max(0f, newBrightness)) + mTempBrightness = newBrightness.toInt() + + val absolutePercent = ((newBrightness / maxBrightness) * 100).toInt() + mView.slide_info.apply { + text = "$mSlideInfoText$absolutePercent%" + alpha = 1f + } + + val attributes = activity.window.attributes + attributes.screenBrightness = absolutePercent / 100f + activity.window.attributes = attributes + + mSlideInfoFadeHandler.removeCallbacksAndMessages(null) + mSlideInfoFadeHandler.postDelayed({ + mView.slide_info.animate().alpha(0f) + }, SLIDE_INFO_FADE_DELAY) + } + private fun initTimeHolder() { mTimeHolder = mView.video_time_holder val res = resources diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml index 47de68c41..3d88f52f7 100644 --- a/app/src/main/res/layout/pager_video_item.xml +++ b/app/src/main/res/layout/pager_video_item.xml @@ -19,6 +19,11 @@ android:layout_alignParentEnd="true" android:layout_alignParentRight="true"/> + + Date: Mon, 7 Aug 2017 22:17:37 +0200 Subject: [PATCH 153/174] move the password protection string in commons --- app/build.gradle | 2 +- app/src/main/res/layout/activity_settings.xml | 2 +- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-hu/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 2 -- app/src/main/res/values-pt/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sk/strings.xml | 1 - app/src/main/res/values-sv/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values-zh-rTW/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 19 files changed, 2 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 572ac4a1a..6ad120cc7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.25.1' + compile 'com.simplemobiletools:commons:2.25.3' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 718443de6..ae31ddb62 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -284,7 +284,7 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/password_protect_hidden_folders"/> + android:text="@string/password_protect_hidden_items"/> diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 749ed4a11..3b88dc92d 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 02de040d9..560702e82 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -114,7 +114,6 @@ Kacheln horizontal scrollen Systemleisten ausblenden im Vollbild Teilen/Drehen im Vollbild-Menü vertauschen - Password protect hidden folders diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index cdbaa4f91..b5bc78a3a 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -114,7 +114,6 @@ Desplazar miniaturas horizontalmente Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa Reemplazar Compartir con Girar en el menú de pantalla completa - Password protect hidden folders diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 799a16f16..f2a24d45b 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index ff22affba..8921e7214 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9fed60a2a..2019637f7 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -114,7 +114,6 @@ Scorri miniature orizzontalmente Nascondi UI di sistema con media a schermo intero Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index cf5bcd268..a1f649c3a 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index b1a6616e1..bb949d94c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -114,7 +114,6 @@ Przewijaj miniatury poziomo Ukrywaj interfejs przy pełnoekranowym podglądzie Zamień funkcję udostępniania na obracanie w menu pełnoekranowym - Zabezpiecz ukryte foldery diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 47d8492cf..ab1b9691c 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -105,7 +105,6 @@ Imagens e vídeos Reproduzir vídeos em ciclo Animação de GIFs nas miniaturas -     Brilho máximo ao visualizar mídia Recortar miniaturas em quadrados Critério para rotação de tela @@ -116,7 +115,6 @@ Rolar miniaturas horizontalmente Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 1a24729c8..1f70f2690 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -114,7 +114,6 @@ Deslocação horizontal de miniaturas Ocultar interface do sistema se em ecrã completo Substituir a opção Partilhar pela opção Rodar se em ecrã completo - Password protect hidden folders diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index b7d315abb..700fc831e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 2472a8814..b9b0ea85c 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -114,7 +114,6 @@ Prehliadať miniatúry vodorovne Automaticky skrývať systémové lišty pri celoobrazovkových médiách Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu - Uzamknúť zobrazovanie skrytých priečinkov heslom diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 3c18193c3..68558ac8c 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -114,7 +114,6 @@ Rulla horisontellt genom miniatyrer Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 0d9c60a05..087a7d896 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index a9101a53f..3b51081a4 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -114,7 +114,6 @@ 水平滚动缩略图 Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 3a8698391..6409cbbfc 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ec64ebeae..496fb5445 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -114,7 +114,6 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu - Password protect hidden folders From 2ebcaf12aaaa0a1a94b7012f2e556f357910f4d3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 22:57:41 +0200 Subject: [PATCH 154/174] make the video thumbnail video circle a bit smaller --- .../res/drawable-hdpi/img_play_outline.png | Bin 2732 -> 3532 bytes .../res/drawable-xhdpi/img_play_outline.png | Bin 3028 -> 4470 bytes .../res/drawable-xxhdpi/img_play_outline.png | Bin 5865 -> 8414 bytes .../res/drawable-xxxhdpi/img_play_outline.png | Bin 3878 -> 9618 bytes app/src/main/res/layout/photo_video_item.xml | 7 +++---- app/src/main/res/values-sw600dp/dimens.xml | 3 ++- app/src/main/res/values/dimens.xml | 1 - 7 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/drawable-hdpi/img_play_outline.png b/app/src/main/res/drawable-hdpi/img_play_outline.png index c5cf4f1311cafd65307eeca4ba2696f8cfbb223a..0aeace0799dbc1e61353629d4d2b9d004ea14ae1 100644 GIT binary patch delta 3523 zcmV;!4LtI!70eruD}N2w000fw0YWI7cmMzmen~_@RCt`#Tx(ENSGNB4>BfFB@@O>p zLOW4sZiBZ*MC@p(QLF?r!Kle#5{Zx0y-7vm1Vt)V1*r<^H8DkUlPeRQ#Du9K8J!V^ zL`DK5=tQS5kkKl^$4sO6NVF5_LDcRBn$zq4IE_K<-F><_-G4Y=m1S|x+Iy}2^?t6s z)?pX|5K#<(aR5ep|BVFj698JTNEd)x0Db^)6~K1@zGaMcM%q>uZUscd02l$J0+NJB)wAfn$B(N!YykaF;N z>-@b}$FQMpuYYV1(P$znAfk&3lj4u8i(Z|hhr0b-5K$r#Z6%^>5hBJHQP;dSBn~wn zcR)mHB3ea6mxhR#f#~Z|D~U)w)a00n=n&l>#0-Roi2g!E=E1Zvq*aWFQ~;I%_+J1C zA=E>nD0X#scRRbfy6m@a-|oD5^QNn(r$;0rXfztt@PFaMb}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l)PK$!#wrp06ZR#=R#v+<9~%6 zJ9b3WDr#zK?o?D%ED5jSJ_~j4+yN=(a~Ii_63z7Wj{?{Wu`a3{g8W?BuJo^{{qDYPQ7ZeN4)?5002ov JPDHLkV1l{Uhx-5k diff --git a/app/src/main/res/drawable-xxhdpi/img_play_outline.png b/app/src/main/res/drawable-xxhdpi/img_play_outline.png index 5a39e380d1ca0cd99aad094bd616a74df65498bb..a3ffa45fb3e5bd7bb3b317cadd6c7aced5a2bfa5 100644 GIT binary patch literal 8414 zcmWlf1ymGW7=~xbrIAhnrCX4$W$6VG5SNAp{RK&BmRt#?q)X{k1Z1TsVOmSJ}|b7t=S?)N_LdpAN)SA&e0i5LI?GA&J21MnDk`+^dHzt_|k>%ariD@_x3 z@chK>3j*g&_W=NQKucBG&?jRj6K$R}cHO09OUIy&iW{=lSD}F#nsX43nh(1b&y=_c zG`%;d-O6fh5SrB#Q)`^#Y)V*mqo0{=5VHHv(p~u*tBx{0zG{+MX#9T!Z*2SbVvkVv zj_xl|FEFQD5+YX7M;U9q?uthWYyJbL{uIhQVFvv83s4wG3k&4uk5p2Osy_sy?>`nL zf(u-+mYc%E2eVFUX~U}p2JeR3=tK7L7D(DiU=#-~5`fe}A>INWH!mYlY#a)3vnT+p z7$$&rv4j+M2g3|}!Tm{lGwwy8?`aItM>InAarY@PqCf!T7;lgjBcAr-CH7&{!0Sb+ z9z&8GDjmZ@;1FQJk0W4Dr!?q8Q=}KEK*J6A2`hO6Af&kaPz>}yL2JaQhD2R-%LA`X z5%}2t{i!;%xYDLsFxY}5+~6}#r7#5m#jli9KsC-s1xN7FwrPoycqUQiRoj>KwjtR( zD)kV4xIQdxG(bpu1GmOO>&_oJeXMXf4U7Pz0JLz0(wJ5wStdI=2mn2V0)U6>L)=yg zm|JU{xIl}~@*(175Wp6Kj%hS0x!VUzKUXsQEP$^^wmM}A zgZ_HCM_jelL795D2;##G%l2wf!bj2I>kc#WMs(G5QlXS4GsNj zZ*SM)Pv*D&jUyy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Z$d_@5T6i^t9^j}a2h*?BJ7lZ_a1cV3)2nh%g5)cv)A|xOrAVf$& oNI-~?fRKO?Aps!)A)Lp50H*~y`?-)Ko&W#<07*qoM6N<$f*VpY^Z)<= diff --git a/app/src/main/res/layout/photo_video_item.xml b/app/src/main/res/layout/photo_video_item.xml index 911cd1a72..a8fdf5d21 100644 --- a/app/src/main/res/layout/photo_video_item.xml +++ b/app/src/main/res/layout/photo_video_item.xml @@ -25,12 +25,12 @@ @@ -44,7 +44,6 @@ android:background="@drawable/gradient_background" android:gravity="bottom" android:maxLines="3" - android:minHeight="@dimen/play_outline_size" android:paddingBottom="@dimen/small_margin" android:paddingLeft="@dimen/small_margin" android:paddingRight="@dimen/small_margin" diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index d044f6c47..33b8c8ac0 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -1,10 +1,11 @@ + 150dp 120dp 30dp 38dp - 60dp 230dp 32dp 60dp + 250dp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index fc2c0ffd6..b167a38ef 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,7 +4,6 @@ 100dp 20dp 26dp - 40dp 150dp 24dp 50dp From 4992bec80bdb450f070cf93bbb3e22ba951525ed Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 23:04:52 +0200 Subject: [PATCH 155/174] make the Pin icon the same size too --- app/src/main/res/layout/directory_item.xml | 9 +++++---- app/src/main/res/values-sw600dp/dimens.xml | 2 +- app/src/main/res/values/dimens.xml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/layout/directory_item.xml b/app/src/main/res/layout/directory_item.xml index 98e94a3e2..8ae161578 100644 --- a/app/src/main/res/layout/directory_item.xml +++ b/app/src/main/res/layout/directory_item.xml @@ -25,12 +25,13 @@ 150dp 120dp - 30dp + 30dp 38dp 230dp 32dp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index b167a38ef..a67c01562 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -2,7 +2,7 @@ 150dp 100dp - 20dp + 20dp 26dp 150dp 24dp From 68a090a522018bef28c021554198888ff6a817f5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 23:37:06 +0200 Subject: [PATCH 156/174] add a black background to the pin icons --- app/src/main/res/drawable/circle_black_background.xml | 9 +++++++++ app/src/main/res/layout/directory_item.xml | 3 ++- app/src/main/res/values/colors.xml | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/circle_black_background.xml diff --git a/app/src/main/res/drawable/circle_black_background.xml b/app/src/main/res/drawable/circle_black_background.xml new file mode 100644 index 000000000..2afe7d524 --- /dev/null +++ b/app/src/main/res/drawable/circle_black_background.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/app/src/main/res/layout/directory_item.xml b/app/src/main/res/layout/directory_item.xml index 8ae161578..f6d296e07 100644 --- a/app/src/main/res/layout/directory_item.xml +++ b/app/src/main/res/layout/directory_item.xml @@ -31,7 +31,8 @@ android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_margin="@dimen/small_margin" - android:padding="@dimen/tiny_margin" + android:background="@drawable/circle_black_background" + android:padding="@dimen/small_margin" android:src="@drawable/ic_pin"/> #454545 #BB000000 + #66000000 @color/default_dark_theme_text_color From 48251a04c081e76606b4a5e6eaf69ec4756711df Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 23:41:32 +0200 Subject: [PATCH 157/174] add volume and brightness change in release notes --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 5e6f94ec4..6952c945e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -493,6 +493,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { add(Release(118, R.string.release_118)) add(Release(119, R.string.release_119)) add(Release(122, R.string.release_122)) + add(Release(123, R.string.release_123)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 10834335c..4f173fa1f 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -2,6 +2,7 @@ + Allow changing the screen brightness and volume at videos by vertically dragging the screen sides Added slideshow at the fullscreen view Added pattern/pin protection for showing hidden items Added a toggle for replacing Share with Rotate at fullscreen media From 7ab1081a19a9430901ca22e744ecf34d19dfba96 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 23:41:40 +0200 Subject: [PATCH 158/174] update version to 2.13.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6ad120cc7..66343c7b0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 122 - versionName "2.12.6" + versionCode 123 + versionName "2.13.0" } signingConfigs { From dd0133b3b9aab5f0f23ec3008a2fd3811ccb6d12 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Aug 2017 23:41:55 +0200 Subject: [PATCH 159/174] updating changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21d7dc7f9..5314e9911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========== +Version 2.13.0 *(2017-08-07)* +---------------------------- + + * Allow changing the screen brightness and volume at videos by vertically dragging the screen sides + * Fixed sorting of numbers in filenames + * Fixed a glitch with hidden files sometimes temporarily visible + * Unified thumbnail corner icon sizes and style + Version 2.12.6 *(2017-08-05)* ---------------------------- From e297b759a75526c94e276505751f69f478e7871a Mon Sep 17 00:00:00 2001 From: fricyo <30796677+fricyo@users.noreply.github.com> Date: Thu, 10 Aug 2017 23:48:23 +0800 Subject: [PATCH 160/174] Translation update --- app/src/main/res/values-zh-rTW/strings.xml | 184 ++++++++++----------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 6409cbbfc..2a4b6242e 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1,51 +1,51 @@ - 簡易藝廊 - 藝廊 + 簡易相簿 + 簡易相簿 編輯 開啟相機 - 以其他應用軟體開啟 - 沒有可用的應用軟體 - (隱藏) - 鎖定資料夾 - 解除鎖定資料夾 - 顯示所有資料夾的內容 - 所有資料夾 - 切換到資料夾檢視 + 以其他應用程式開啟 + 找不到應用程式 + (隱藏) + 釘選資料夾 + 取消釘選資料夾 + 資料夾內容全部顯示 + 全部資料夾 + 切換成資料夾檢視 其他資料夾 - Show on map - Unknown location - No application with maps has been found - No Camera app has been found - Increase column count - Reduce column count - Change cover image - Select photo - Use default - Set as - Volume - Brightness + 在地圖上顯示 + 未知的位置 + 找不到地圖程式 + 找不到相機程式 + 增加欄數 + 減少欄數 + 更換封面圖片 + 選擇相片 + 使用預設 + 設為 + 音量 + 亮度 - 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? - Exclude - Excluded folders - Manage excluded folders - This will exclude the selection together with its subfolders from Simple Gallery only. You can manage excluded folders in Settings. - Exclude a parent instead? - 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. - Remove all - Remove all folders from the list of excluded? This will not delete the folders. + 這功能藉由添加一個\'.nomedia\'檔案,來隱藏資料夾和所有子資料夾。您可以透過設定中的⌈顯示隱藏的資料夾⌋選項來查看。\n是否繼續? + 排除 + 排除資料夾 + 管理排除資料夾 + 此資料夾與子資料夾將只會都從簡易相簿中排除。您可以在設定中進行管理。 + 是否排除上層資料夾? + ⌈排除資料夾⌋只會將選擇的資料夾與子資料夾一起從簡易相簿中隱藏,他們仍會出現在其他應用程式中。\n\n如果您要在其他應用程式中也隱藏,請使用⌈隱藏⌋功能。 + 移除全部 + 是否將排除列表中的所有資料夾都移除?這不會刪除資料夾。 - Included folders - Manage included folders - Add folder - If you have some folders which contain media, but were not recognized by the app, you can add them manually here. + 包含資料夾 + 管理包含資料夾 + 增加資料夾 + 如果有些資料夾含有媒體檔案,卻沒被辨識到,您可以在此手動加入。 縮放 - 縮放選區並儲存 + 縮放所選區域並儲存 寬度 高度 保持長寬比 @@ -56,76 +56,76 @@ 儲存 旋轉 路徑 - 圖檔路徑錯誤 - 圖檔編輯失敗 - 編輯用: - 沒有可用的圖檔編輯器 - 未知檔案路徑 - 不能覆蓋源檔案 - Rotate left - Rotate right - Rotate by 180º - Flip - Flip horizontally - Flip vertically - Edit with + 無效的圖片路徑 + 圖片編輯失敗 + 編輯圖片: + 找不到圖片編輯器 + 未知的檔案位置 + 無法誤蓋原始檔案 + 向左轉 + 向右轉 + 旋轉180º + 翻轉 + 水平翻轉 + 垂直翻轉 + 用其他程式編輯 簡易桌布 - 設定為桌布 - 桌布設定失敗 - 用其他應用軟體設定桌布…… - 沒有可用的應用軟體 - 正在應用軟體桌布… - 成功應用軟體桌布 - Portrait aspect ratio - Landscape aspect ratio + 設為桌布 + 設為桌布失敗 + 用其他程式設為桌布: + 找不到可用的應用程式 + 桌布設定中… + 成功設為桌布 + 直向長寬比 + 橫向長寬比 - Slideshow - Interval (seconds): - Include photos and GIFs - Include videos - Random order - Use fade animations - Move backwards - The slideshow ended - No media for the slideshow have been found + 投影片 + 間隔 (秒): + 包含照片和GIF + 包含影片 + 隨機順序 + 使用淡入淡出動畫 + 反向播放 + 投影片結束 + 找不到投影片的媒體檔案 - 秀出隱藏資料夾 + 顯示隱藏的媒體檔案 自動播放影片 顯示檔案名稱 - 秀出多媒體檔案 - 僅圖片 - 僅影片 - GIFs only - Images, videos, GIFs + 顯示媒體檔案 + 只有圖片 + 只有影片 + 只有GIF + 圖片、影片、GIF 圖片和影片 - 迴圈播放影片 - Animate GIFs at thumbnails - Max brightness when viewing media - Crop thumbnails into squares - Rotate fullscreen media by - System setting - Device rotation - Aspect ratio - Dark background at fullscreen media - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media - Replace Share with Rotate at fullscreen menu + 影片循環播放 + 縮圖顯示GIF動畫 + 瀏覽時最大亮度 + 縮圖裁剪成正方形 + 全螢幕時旋轉方向 + 系統設定方向 + 裝置實際方向 + 圖片長寬比 + 全螢幕時黑背景 + 橫向滑動縮圖 + 全螢幕時自動隱藏系統介面 + 將全螢幕選單的分享取代為旋轉 - 一個沒有廣告,用來觀看照片及影片的藝廊。 + 一個用來瀏覽相片和影片,且沒有廣告的相簿。 - 一個觀看照片跟影片的簡單實用工具。項目可以根據日期、大小、名稱來進行遞增及遞減排序,照片可以縮放。媒體檔案們根據螢幕的大小呈列在多個方格中,您可以使用捏放手勢來調整一列中的方格數量。媒體檔案可以被重新命名、分享、刪除、複製以及移動。照片亦可被裁切、旋轉或是直接在應用軟體中設定為桌布。 - - 藝廊亦提供讓第三方軟體能夠用來預覽圖片/影片、添加附件於電子郵件客戶端軟體中等功能。非常適合日常使用。 - - 應用軟體不包含廣告與非必要的權限。它是完全開放原始碼的,並內建自訂顔色之使用者介面主題。 - - 這個應用軟體只是一系列應用軟體中的一小部份。您可以在 http://www.simplemobiletools.com 找到剩下的軟體。 + 一個適合用來瀏覽相片和影片的簡單工具。可以根據日期、大小、名稱來遞增或遞減排序項目,相片能被縮放。媒體檔案會依畫面大小呈現在數個欄位內,你可以使用縮放手勢來改變欄數。媒體檔案可以重新命名、分享、刪除、複製、移動;圖片還能縮放、旋轉、翻轉,或者直接設為桌布。 + + 這相簿也支援第三方應用,像是預覽圖片/影片、添加電子信箱附件...等功能,日常使用上相當適合。 + + 優點包含沒廣告,也沒非必要的權限,而且完全開放原始碼,並提供自訂顏色。 + + 這只是一個大系列應用程式的其中一項程式,你可以在這發現更多 http://www.simplemobiletools.com 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 ? @@ -67,8 +67,8 @@ Pivoter à 180º Retourner Retourner horizontalement - Retourner verticallement - Edit with + Retourner verticalement + Éditer avec Simple fond d\'écran @@ -76,57 +76,49 @@ Échec de la définition en tant que fond d\'écran. Définir comme fond d\'écran avec : Aucune application trouvée pour continuer cette action - Paramètre de fond d\'écran… - Fond d\'écran défini avec succès. + Paramètres de fond d\'écran… + Fond d\'écran défini avec succès Ratio aspect Portrait Ratio aspect Paysage - Slideshow - Interval (seconds): - Include photos and GIFs - Include videos - Random order - Use fade animations + Diaporama + Intervalle​ (secondes): + Inclure photos et GIFs + Inclure vidéos + Ordre aléatoire + Utiliser un fondu Move backwards - The slideshow ended + Diaporama terminé No media for the slideshow have been found Afficher les dossiers cachés Lecture automatique des vidéos - Permutter la visibilité des noms de fichier + Permuter la visibilité des noms de fichier Afficher les médias Seulement les images Vidéos uniquement - GIFs only - Images, videos, GIFs + GIFs seulement + Images, vidéos, GIFs Images et vidéos Tourner en boucle les vidéos GIFs animés sur les miniatures Luminosité maximale lors de l\'affichage de media Rogner les miniatures en carrés - Pivoter les medias plen écran selon + Pivoter les medias plein écran selon Paramètres système Rotation de l\'appareil Ratio d\'aspect Dark background at fullscreen media - Scroll thumbnails horizontally + Défilement des mignatures horizontalement Automatically hide system UI at fullscreen media Replace Share with Rotate at fullscreen menu Un album pour visionner photos et vidéos sans publicité. - - Un simple outil pour visionner les photos et les vidéos. Elles peuvent être triées par dates, tailles, noms dans les deux sens (alphabétique comme désalphabétique), il est possible de zoomer sur les photos. Les fichiers sont affichés sur de 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 - + 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 - 這功能藉由添加一個\'.nomedia\'檔案,來隱藏資料夾和所有子資料夾。您可以透過設定中的⌈顯示隱藏的資料夾⌋選項來查看。\n是否繼續? + 這功能藉由添加一個\'.nomedia\'檔案,來隱藏資料夾和所有子資料夾。您可以透過設定中的「顯示隱藏的資料夾」選項來查看。\n是否繼續? 排除 排除資料夾 管理排除資料夾 此資料夾與子資料夾將只會都從簡易相簿中排除。您可以在設定中進行管理。 是否排除上層資料夾? - ⌈排除資料夾⌋只會將選擇的資料夾與子資料夾一起從簡易相簿中隱藏,他們仍會出現在其他應用程式中。\n\n如果您要在其他應用程式中也隱藏,請使用⌈隱藏⌋功能。 + 「排除資料夾」只會將選擇的資料夾與子資料夾一起從簡易相簿中隱藏,他們仍會出現在其他應用程式中。\n\n如果您要在其他應用程式中也隱藏,請使用「隱藏」功能。 移除全部 是否將排除列表中的所有資料夾都移除?這不會刪除資料夾。 From 1c39d178dd1b5f08f794ffee2fa8bae3c7ba4a24 Mon Sep 17 00:00:00 2001 From: gregory678 Date: Fri, 11 Aug 2017 11:17:30 +0200 Subject: [PATCH 163/174] Translated new strings --- app/src/main/res/values-pl/strings.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index bb949d94c..bacfa1dd0 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -23,8 +23,8 @@ Wybierz obraz Użyj domyślnej Ustaw jako - Volume - Brightness + Głośność + Jasność 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ć? @@ -46,7 +46,7 @@ Zmień rozmiar Zmień i zapisz - Długość + Szerokość Wysokość Zachowaj proporcje Wpisz poprawną rozdzielczość @@ -82,15 +82,15 @@ Proporcje ekranu w trybie poziomym - Slideshow - Interval (seconds): - Include photos and GIFs - Include videos - Random order - Use fade animations - Move backwards - The slideshow ended - No media for the slideshow have been found + Pokaz slajdów + Przedział (sekundy): + Dołączaj zdjęcia i GIFy + Dołączaj filmy + Losowa kolejność + Używaj płynnych przejść + Cofnij + Pokaz slajdów zakończony + Nie znalazłem multimediów do pokazu slajdów Pokazuj ukryte foldery From 9398c9be769c0f2c03d2c0471d49f5997215fd9f Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 11 Aug 2017 11:48:22 +0200 Subject: [PATCH 164/174] fix up folder Inclusion, check if its not empty --- .../kotlin/com/simplemobiletools/gallery/extensions/context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index 2d990287a..f13a021d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -144,7 +144,7 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP } } - config.includedFolders.filter { it.isEmpty() || it == curPath }.mapNotNull { File(it).listFiles() }.forEach { + config.includedFolders.filter { it.isNotEmpty() || it == curPath }.mapNotNull { File(it).listFiles() }.forEach { for (file in it) { val size = file.length() if (size <= 0L) { From 0810aa180e1a6ffe6ac9bdf6061af334dd6893cf Mon Sep 17 00:00:00 2001 From: gregory678 Date: Fri, 11 Aug 2017 12:45:27 +0200 Subject: [PATCH 165/174] Fixed context in one string --- app/src/main/res/values-pl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index bacfa1dd0..81cbaaae6 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -88,7 +88,7 @@ Dołączaj filmy Losowa kolejność Używaj płynnych przejść - Cofnij +    Odwrotna kolejność Pokaz slajdów zakończony Nie znalazłem multimediów do pokazu slajdów From bd03e4a17647004e5873adb16aa90d710e585eba Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 11 Aug 2017 13:25:56 +0200 Subject: [PATCH 166/174] fix #319, show a folder if its both excluded and included --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 14 +++++++++----- .../gallery/extensions/context.kt | 10 ++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index db9845f72..ebc8182f0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -27,8 +27,11 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val media = context.getFilesFrom("", isPickImage, isPickVideo) val excludedPaths = config.excludedFolders + val includedPaths = config.includedFolders val directories = groupDirectories(media) - val dirs = ArrayList(directories.values.filter { File(it.path).exists() }).filter { shouldFolderBeVisible(it.path, excludedPaths) } as ArrayList + val dirs = ArrayList(directories.values + .filter { File(it.path).exists() }) + .filter { shouldFolderBeVisible(it.path, excludedPaths, includedPaths) } as ArrayList Directory.sorting = config.directorySorting dirs.sort() return movePinnedToFront(dirs) @@ -77,11 +80,11 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va return directories } - private fun shouldFolderBeVisible(path: String, excludedPaths: MutableSet): Boolean { + private fun shouldFolderBeVisible(path: String, excludedPaths: MutableSet, includedPaths: MutableSet): Boolean { val file = File(path) - return if (isThisOrParentExcluded(path, excludedPaths)) + return if (isThisOrParentExcluded(path, excludedPaths, includedPaths)) { false - else if (!config.shouldShowHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) { + } else if (!config.shouldShowHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) { var containsNoMediaOrDot = file.containsNoMedia() || path.contains("/.") if (!containsNoMediaOrDot) { containsNoMediaOrDot = checkParentHasNoMedia(file.parentFile) @@ -105,7 +108,8 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va return false } - private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet) = excludedPaths.any { path.startsWith(it) } + private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet, includedPaths: MutableSet) = + includedPaths.none { path.startsWith(it) } && excludedPaths.any { path.startsWith(it) } private fun movePinnedToFront(dirs: ArrayList): ArrayList { val foundFolders = ArrayList() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index f13a021d3..1f57f026c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -75,6 +75,7 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP val config = context.config val showMedia = config.showMedia val showHidden = config.shouldShowHidden + val includedFolders = config.includedFolders val excludedFolders = config.excludedFolders val noMediaFolders = context.getNoMediaFolders() @@ -113,14 +114,19 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP var isExcluded = false excludedFolders.forEach { - if (path.startsWith(it)) { + if (path.startsWith("$it/")) { isExcluded = true + includedFolders.forEach { + if (path.startsWith("$it/")) { + isExcluded = false + } + } } } if (!isExcluded && !showHidden) { noMediaFolders.forEach { - if (path.startsWith(it)) { + if (path.startsWith("$it/")) { isExcluded = true } } From 32b6a87440e0c8012f744e6f93f750a6eac3f233 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 11 Aug 2017 13:39:35 +0200 Subject: [PATCH 167/174] show included folders content only when appropriate --- .../kotlin/com/simplemobiletools/gallery/extensions/context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index 1f57f026c..2fd607c32 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -150,7 +150,7 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP } } - config.includedFolders.filter { it.isNotEmpty() || it == curPath }.mapNotNull { File(it).listFiles() }.forEach { + config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.mapNotNull { File(it).listFiles() }.forEach { for (file in it) { val size = file.length() if (size <= 0L) { From 0467ba670335799e170ae3144ab33fe417673835 Mon Sep 17 00:00:00 2001 From: anthologist Date: Sat, 12 Aug 2017 11:06:18 +0200 Subject: [PATCH 168/174] update italian --- app/src/main/res/values-it/strings.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2019637f7..b70a13b6c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -24,7 +24,7 @@ Usa predefinita Imposta come Volume - Brightness + Luminosità 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? @@ -82,15 +82,15 @@ Proporzioni panorama - Slideshow - Interval (seconds): - Include photos and GIFs - Include videos - Random order - Use fade animations - Move backwards - The slideshow ended - No media for the slideshow have been found + Presentazione + Intervallo (secondi): + Includi foto e GIF + Includi video + Ordine sparso + Usa animazioni a dissolvenza + Scorri al contrario + La presentazione è terminata + Nessun media trovato per la presentazione Mostra cartelle nascoste @@ -113,7 +113,7 @@ Sfondo scuro a schermo intero Scorri miniature orizzontalmente Nascondi UI di sistema con media a schermo intero - Replace Share with Rotate at fullscreen menu + Sostituisci Condividi con Ruota a schermo intero From 7df9d1c2838a554baaf07369289a71dcb13be816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Marques?= Date: Tue, 15 Aug 2017 01:33:51 +0100 Subject: [PATCH 169/174] Update strings.xml --- app/src/main/res/values-pt/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 1f70f2690..300f156b1 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -24,7 +24,7 @@ Predefinição Definir como Volume - Brightness + Brilho 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? @@ -82,15 +82,15 @@ Proporção na horizontal - Slideshow - Interval (seconds): - Include photos and GIFs - Include videos - Random order - Use fade animations - Move backwards - The slideshow ended - No media for the slideshow have been found + Apresentação + Intervalo (segundos): + Incluir fotos e GIFs + Incluir vídeos + Ordem aleatória + Usar animações + Mover para trás + Apresentação terminada + Não foram encontrados ficheiros para a apresentação Mostrar pastas ocultas From f69c7368d4374482f92e0868d6fb3393e49e6b2b Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 16 Aug 2017 21:05:03 +0200 Subject: [PATCH 170/174] update kotlin version to 1.1.4 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 66343c7b0..9964f88f6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ dependencies { } buildscript { - ext.kotlin_version = '1.1.3-2' + ext.kotlin_version = '1.1.4' repositories { mavenCentral() } From 2f624d1ef48d968d8266191768093f00ed46a735 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 16 Aug 2017 21:05:49 +0200 Subject: [PATCH 171/174] update commons to 2.25.4 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 9964f88f6..a67a34dc3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.25.3' + compile 'com.simplemobiletools:commons:2.25.4' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' From b2354ebd59c8d7fb681aae9d97b16b5fa13ee324 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 16 Aug 2017 21:07:29 +0200 Subject: [PATCH 172/174] update version to 2.13.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a67a34dc3..dbac87ee7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 23 - versionCode 123 - versionName "2.13.0" + versionCode 124 + versionName "2.13.1" } signingConfigs { From 49c9eca8ca555bc9419834109300283ecfae77d2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 17 Aug 2017 13:38:36 +0200 Subject: [PATCH 173/174] updating some german strings --- app/src/main/res/values-de/strings.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 560702e82..ba4a39d71 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -23,8 +23,8 @@ Auswählen Standard Festlegen als - Volume - Brightness + Lautstärke + Helligkeit 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? @@ -82,15 +82,15 @@ Querformat - Slideshow - Interval (seconds): - Include photos and GIFs - Include videos - Random order - Use fade animations - Move backwards - The slideshow ended - No media for the slideshow have been found + Diashow + Intervall (Sekunden): + Bilder/GIFs verwenden + Videos verwenden + Zufällige Reihenfolge + Übergänge animieren + Rückwärts abspielen + Diashow beendet + Keine Medien für Diashow gefunden Versteckte Ordner zeigen @@ -103,7 +103,7 @@ Bilder, Videos und GIFs Bilder und Videos Videos in Endlosschleife spielen - Kacheln bei GIFs animieren + Kacheln von GIFs animieren Helligkeit beim Betrachten maximieren Kacheln quadratisch zuschneiden Im Vollbild ausrichten nach From 8b0b2ef22b1eb86677a8bb5781587eafeaddbb3e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 19 Aug 2017 09:42:04 +0200 Subject: [PATCH 174/174] update kotlin to 1.1.4-2 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index dbac87ee7..6282b5d27 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ dependencies { } buildscript { - ext.kotlin_version = '1.1.4' + ext.kotlin_version = '1.1.4-2' repositories { mavenCentral() }