show a loading progress bar at first app load
This commit is contained in:
parent
37f1f807f6
commit
63dedaa9b7
|
@ -114,6 +114,8 @@ class MainActivity : SimpleActivity() {
|
||||||
no_conversations_placeholder_2.setTextColor(properPrimaryColor)
|
no_conversations_placeholder_2.setTextColor(properPrimaryColor)
|
||||||
no_conversations_placeholder_2.underlineText()
|
no_conversations_placeholder_2.underlineText()
|
||||||
conversations_fastscroller.updateColors(properPrimaryColor)
|
conversations_fastscroller.updateColors(properPrimaryColor)
|
||||||
|
conversations_progress_bar.setIndicatorColor(properPrimaryColor)
|
||||||
|
conversations_progress_bar.trackColor = properPrimaryColor.adjustAlpha(LOWER_ALPHA)
|
||||||
checkShortcut()
|
checkShortcut()
|
||||||
(conversations_fab?.layoutParams as? CoordinatorLayout.LayoutParams)?.bottomMargin =
|
(conversations_fab?.layoutParams as? CoordinatorLayout.LayoutParams)?.bottomMargin =
|
||||||
navigationBarHeight + resources.getDimension(R.dimen.activity_margin).toInt()
|
navigationBarHeight + resources.getDimension(R.dimen.activity_margin).toInt()
|
||||||
|
@ -361,6 +363,9 @@ class MainActivity : SimpleActivity() {
|
||||||
if (!hasConversations && config.appRunCount == 1) {
|
if (!hasConversations && config.appRunCount == 1) {
|
||||||
no_conversations_placeholder.text = getString(R.string.loading_messages)
|
no_conversations_placeholder.text = getString(R.string.loading_messages)
|
||||||
no_conversations_placeholder_2.beGone()
|
no_conversations_placeholder_2.beGone()
|
||||||
|
conversations_progress_bar.beVisible()
|
||||||
|
} else {
|
||||||
|
conversations_progress_bar.beGone()
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -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/main_coordinator"
|
android:id="@+id/main_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
@ -28,6 +29,18 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/conversations_progress_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:hideAnimationBehavior="outward"
|
||||||
|
app:showAnimationBehavior="inward"
|
||||||
|
app:showDelay="250"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/no_conversations_placeholder"
|
android:id="@+id/no_conversations_placeholder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue