]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
more information in the main activity start debug
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index 5a8e198f778400ef00ef9aac6cbe1fd8336056dd..d7447f070c86262fa885eaba61ae40e105ad995a 100644 (file)
@@ -108,7 +108,9 @@ public class MainActivity extends ProfileThemedActivity {
     protected void onStart() {
         super.onStart();
 
-        debug("flow", "MainActivity.onStart()");
+        debug("flow", String.format(Locale.ENGLISH,
+                "MainActivity.onStart(), currentPage is %d, accountFilter is %s", mCurrentPage,
+                (mAccountFilter == null) ? "<NULL>" : mAccountFilter));
         mViewPager.setCurrentItem(mCurrentPage, false);
         if (mAccountFilter != null) showTransactionsFragment(mAccountFilter);
         else Data.accountFilter.setValue(null);
@@ -249,37 +251,36 @@ public class MainActivity extends ProfileThemedActivity {
         if (mProfileListAdapter == null) mProfileListAdapter = new ProfilesRecyclerViewAdapter();
         root.setAdapter(mProfileListAdapter);
 
-        mProfileListAdapter.editingProfiles
-                .observe(this, newValue -> {
-                    if (newValue) {
-                        profileListHeadMore.setVisibility(View.GONE);
-                        profileListHeadCancel.setVisibility(View.VISIBLE);
-                        profileListHeadAddProfile.setVisibility(View.VISIBLE);
-                        if (drawer.isDrawerOpen(GravityCompat.START)) {
-                            profileListHeadMore.startAnimation(AnimationUtils
-                                    .loadAnimation(MainActivity.this, R.anim.fade_out));
-                            profileListHeadCancel.startAnimation(AnimationUtils
-                                    .loadAnimation(MainActivity.this, R.anim.fade_in));
-                            profileListHeadAddProfile.startAnimation(AnimationUtils
-                                    .loadAnimation(MainActivity.this, R.anim.fade_in));
-                        }
-                    }
-                    else {
-                        profileListHeadCancel.setVisibility(View.GONE);
-                        profileListHeadMore.setVisibility(View.VISIBLE);
-                        profileListHeadAddProfile.setVisibility(View.GONE);
-                        if (drawer.isDrawerOpen(GravityCompat.START)) {
-                            profileListHeadCancel.startAnimation(AnimationUtils
-                                    .loadAnimation(MainActivity.this, R.anim.fade_out));
-                            profileListHeadMore.startAnimation(AnimationUtils
-                                    .loadAnimation(MainActivity.this, R.anim.fade_in));
-                            profileListHeadAddProfile.startAnimation(AnimationUtils
-                                    .loadAnimation(MainActivity.this, R.anim.fade_out));
-                        }
-                    }
+        mProfileListAdapter.editingProfiles.observe(this, newValue -> {
+            if (newValue) {
+                profileListHeadMore.setVisibility(View.GONE);
+                profileListHeadCancel.setVisibility(View.VISIBLE);
+                profileListHeadAddProfile.setVisibility(View.VISIBLE);
+                if (drawer.isDrawerOpen(GravityCompat.START)) {
+                    profileListHeadMore.startAnimation(
+                            AnimationUtils.loadAnimation(MainActivity.this, R.anim.fade_out));
+                    profileListHeadCancel.startAnimation(
+                            AnimationUtils.loadAnimation(MainActivity.this, R.anim.fade_in));
+                    profileListHeadAddProfile.startAnimation(
+                            AnimationUtils.loadAnimation(MainActivity.this, R.anim.fade_in));
+                }
+            }
+            else {
+                profileListHeadCancel.setVisibility(View.GONE);
+                profileListHeadMore.setVisibility(View.VISIBLE);
+                profileListHeadAddProfile.setVisibility(View.GONE);
+                if (drawer.isDrawerOpen(GravityCompat.START)) {
+                    profileListHeadCancel.startAnimation(
+                            AnimationUtils.loadAnimation(MainActivity.this, R.anim.fade_out));
+                    profileListHeadMore.startAnimation(
+                            AnimationUtils.loadAnimation(MainActivity.this, R.anim.fade_in));
+                    profileListHeadAddProfile.startAnimation(
+                            AnimationUtils.loadAnimation(MainActivity.this, R.anim.fade_out));
+                }
+            }
 
-                    mProfileListAdapter.notifyDataSetChanged();
-                });
+            mProfileListAdapter.notifyDataSetChanged();
+        });
 
         LinearLayoutManager llm = new LinearLayoutManager(this);