do not set a default value used at redrawing media

This commit is contained in:
tibbi 2018-01-08 21:50:24 +01:00
parent 19a81d2566
commit fa28098500
1 changed files with 6 additions and 5 deletions

View File

@ -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