mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 12:38:00 +01:00
Show loading indicator when loading many items
This commit is contained in:
parent
ff836d8c24
commit
45db8c19aa
2 changed files with 16 additions and 0 deletions
|
@ -164,6 +164,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
timeFormat = getTimeFormat()
|
timeFormat = getTimeFormat()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.loadingIndicator.setIndicatorColor(getProperPrimaryColor())
|
||||||
binding.mediaEmptyTextPlaceholder.setTextColor(getProperTextColor())
|
binding.mediaEmptyTextPlaceholder.setTextColor(getProperTextColor())
|
||||||
binding.mediaEmptyTextPlaceholder2.setTextColor(getProperPrimaryColor())
|
binding.mediaEmptyTextPlaceholder2.setTextColor(getProperPrimaryColor())
|
||||||
binding.mediaEmptyTextPlaceholder2.bringToFront()
|
binding.mediaEmptyTextPlaceholder2.bringToFront()
|
||||||
|
@ -394,6 +395,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.loadingIndicator.show()
|
||||||
getMedia()
|
getMedia()
|
||||||
setupLayoutManager()
|
setupLayoutManager()
|
||||||
}
|
}
|
||||||
|
@ -858,6 +860,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
mMedia = media
|
mMedia = media
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
binding.loadingIndicator.hide()
|
||||||
binding.mediaRefreshLayout.isRefreshing = false
|
binding.mediaRefreshLayout.isRefreshing = false
|
||||||
binding.mediaEmptyTextPlaceholder.beVisibleIf(media.isEmpty() && !isFromCache)
|
binding.mediaEmptyTextPlaceholder.beVisibleIf(media.isEmpty() && !isFromCache)
|
||||||
binding.mediaEmptyTextPlaceholder2.beVisibleIf(media.isEmpty() && !isFromCache)
|
binding.mediaEmptyTextPlaceholder2.beVisibleIf(media.isEmpty() && !isFromCache)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/media_coordinator"
|
android:id="@+id/media_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
@ -10,6 +11,18 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
|
android:id="@+id/loading_indicator"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:hideAnimationBehavior="inward"
|
||||||
|
app:showAnimationBehavior="outward"
|
||||||
|
app:showDelay="500"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/media_holder"
|
android:id="@+id/media_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in a new issue