]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
remove 'Loading' layout from the main activity
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index cad021770fa25866bb17b1705a527606c0d30504..091a58fe097cd2f44d6e2ee14ddd70a2af2eb990 100644 (file)
@@ -69,6 +69,7 @@ import net.ktnx.mobileledger.ui.transaction_list.TransactionListViewModel;
 import net.ktnx.mobileledger.utils.Colors;
 import net.ktnx.mobileledger.utils.GetOptCallback;
 import net.ktnx.mobileledger.utils.LockHolder;
+import net.ktnx.mobileledger.utils.Logger;
 import net.ktnx.mobileledger.utils.MLDB;
 
 import org.jetbrains.annotations.NotNull;
@@ -109,6 +110,8 @@ public class MainActivity extends ProfileThemedActivity {
     protected void onStart() {
         super.onStart();
 
+        Logger.debug("MainActivity", "onStart()");
+
         mViewPager.setCurrentItem(mCurrentPage, false);
     }
     @Override
@@ -152,8 +155,9 @@ public class MainActivity extends ProfileThemedActivity {
     }
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        debug("MainActivity", "onCreate()/entry");
         super.onCreate(savedInstanceState);
-        debug("flow", "MainActivity.onCreate()");
+        debug("MainActivity", "onCreate()/after super");
         setContentView(R.layout.activity_main);
 
         fab = findViewById(R.id.btn_add_transaction);
@@ -368,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()));