]> git.ktnx.net Git - mobile-ledger.git/commitdiff
remove 'Loading' layout from the main activity
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 5 Jul 2020 20:15:37 +0000 (20:15 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 5 Jul 2020 20:27:29 +0000 (20:27 +0000)
replaced by the splash activity

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/loading.xml [deleted file]

index 3cf5aa24edb93ee228e61ed0897c30936fb4c6d8..091a58fe097cd2f44d6e2ee14ddd70a2af2eb990 100644 (file)
@@ -372,24 +372,14 @@ public class MainActivity extends ProfileThemedActivity {
         sm.setDynamicShortcuts(shortcuts);
     }
     private void onProfileListChanged(List<MobileLedgerProfile> newList) {
-        if (newList == null) {
-            // profiles not yet loaded from DB
-            findViewById(R.id.loading_layout).setVisibility(View.VISIBLE);
-            findViewById(R.id.no_profiles_layout).setVisibility(View.GONE);
-            findViewById(R.id.main_app_layout).setVisibility(View.GONE);
-            return;
-        }
-
-        if (newList.isEmpty()) {
+        if ((newList == null) || newList.isEmpty()) {
             findViewById(R.id.no_profiles_layout).setVisibility(View.VISIBLE);
             findViewById(R.id.main_app_layout).setVisibility(View.GONE);
-            findViewById(R.id.loading_layout).setVisibility(View.GONE);
             return;
         }
 
         findViewById(R.id.main_app_layout).setVisibility(View.VISIBLE);
         findViewById(R.id.no_profiles_layout).setVisibility(View.GONE);
-        findViewById(R.id.loading_layout).setVisibility(View.GONE);
 
         findViewById(R.id.nav_profile_list).setMinimumHeight(
                 (int) (getResources().getDimension(R.dimen.thumb_row_height) * newList.size()));
index 9c4bcb908043ecc0a6727c7214617c87bd6786d4..1a64fbcb4076bde291dd8c48727c1c99ccbb4226 100644 (file)
@@ -18,8 +18,6 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <include layout="@layout/loading" />
-
     <include
         layout="@layout/no_profiles"
         android:visibility="gone" />
diff --git a/app/src/main/res/layout/loading.xml b/app/src/main/res/layout/loading.xml
deleted file mode 100644 (file)
index fe56eca..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-  ~ Copyright © 2019 Damyan Ivanov.
-  ~ This file is part of MoLe.
-  ~ MoLe is free software: you can distribute it and/or modify it
-  ~ under the term of the GNU General Public License as published by
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ (at your opinion), any later version.
-  ~
-  ~ MoLe is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  ~ GNU General Public License terms for details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
-  -->
-
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:id="@+id/loading_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:padding="@dimen/activity_horizontal_margin">
-
-    <TextView
-        android:id="@+id/textView"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="48dp"
-        android:text="@string/text_loading"
-        android:textColor="?colorPrimary"
-        android:textSize="48sp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file