From fa28098500fc879a3aa8bab70c1ac05ef8fc2477 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 8 Jan 2018 21:50:24 +0100 Subject: [PATCH] do not set a default value used at redrawing media --- .../gallery/activities/MediaActivity.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 55d068a87..e4aaa8ad2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -262,8 +262,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } private fun setupAdapter() { - if (isDirEmpty()) + if (isDirEmpty()) { return + } val currAdapter = media_grid.adapter if (currAdapter == null) { @@ -408,8 +409,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } private fun getMedia() { - if (mIsGettingMedia) + if (mIsGettingMedia) { return + } mIsGettingMedia = true val media = getCachedMedia(mPath) @@ -599,11 +601,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { media_horizontal_fastscroller.beVisibleIf(media_grid.isVisible() && allowHorizontalScroll) checkLastMediaChanged() - if (mLastDrawnHashCode == 0) - mLastDrawnHashCode = media.hashCode() - if (media.hashCode() == mMedia.hashCode() && media.hashCode() == mLastDrawnHashCode) + if (media.hashCode() == mMedia.hashCode() && media.hashCode() == mLastDrawnHashCode) { return + } mLastDrawnHashCode = media.hashCode() mMedia = media