From 5245f5d7e7f2530dccc5f910eb18d5ea32b0371e Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 18 Mar 2019 11:22:07 +0200 Subject: [PATCH] refresh profile list when the backend data changes --- .../net/ktnx/mobileledger/ui/activity/MainActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) 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, -- 2.39.5