From 63dedaa9b788c9b659eb0865cd5305fdd2a85eba Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Jan 2023 16:18:14 +0100 Subject: [PATCH] show a loading progress bar at first app load --- .../smsmessenger/activities/MainActivity.kt | 5 +++++ app/src/main/res/layout/activity_main.xml | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/MainActivity.kt index 604f443d..1c5647fb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/MainActivity.kt @@ -114,6 +114,8 @@ class MainActivity : SimpleActivity() { no_conversations_placeholder_2.setTextColor(properPrimaryColor) no_conversations_placeholder_2.underlineText() conversations_fastscroller.updateColors(properPrimaryColor) + conversations_progress_bar.setIndicatorColor(properPrimaryColor) + conversations_progress_bar.trackColor = properPrimaryColor.adjustAlpha(LOWER_ALPHA) checkShortcut() (conversations_fab?.layoutParams as? CoordinatorLayout.LayoutParams)?.bottomMargin = navigationBarHeight + resources.getDimension(R.dimen.activity_margin).toInt() @@ -361,6 +363,9 @@ class MainActivity : SimpleActivity() { if (!hasConversations && config.appRunCount == 1) { no_conversations_placeholder.text = getString(R.string.loading_messages) no_conversations_placeholder_2.beGone() + conversations_progress_bar.beVisible() + } else { + conversations_progress_bar.beGone() } try { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 23ad6b6b..221108ee 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,6 +1,7 @@ @@ -28,6 +29,18 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + +