From: Damyan Ivanov Date: Mon, 18 Mar 2019 09:22:07 +0000 (+0200) Subject: refresh profile list when the backend data changes X-Git-Tag: v0.8.1~27 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=5245f5d7e7f2530dccc5f910eb18d5ea32b0371e;p=mobile-ledger.git refresh profile list when the backend data changes --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index bccdb972..300e742d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -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,