]> git.ktnx.net Git - mobile-ledger.git/commitdiff
refresh profile list when the backend data changes
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 18 Mar 2019 09:22:07 +0000 (11:22 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 25 Mar 2019 06:17:36 +0000 (06:17 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index bccdb972fe1e5d5f23fc43e6a435e286e5c3b99f..300e742d425ea42fd4ceda30139815998046cab7 100644 (file)
@@ -166,6 +166,12 @@ public class MainActivity extends ProfileThemedActivity {
                 }
             });
         });
+        Data.profiles.addObserver((o, arg) -> {
+            findViewById(R.id.nav_profile_list).setMinimumHeight(
+                    (int) (getResources().getDimension(R.dimen.thumb_row_height) *
+                           Data.profiles.size()));
+            mProfileListAdapter.notifyDataSetChanged();
+        });
 
         ActionBarDrawerToggle toggle =
                 new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open,