do not set a default value used at redrawing media
This commit is contained in:
parent
19a81d2566
commit
fa28098500
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue