From 89ec71cd583169dd0258b3553aa5e361373607e1 Mon Sep 17 00:00:00 2001 From: Rafael da Veiga Cabral Date: Wed, 10 Jun 2020 14:42:09 -0300 Subject: [PATCH] [NY-10594]: [AN]: Allow scroll down the contact history just when it has content to show --- .../mvp/presenters/UserProfilePresenter.kt | 1 - .../ui/fragments/profile/UserProfileFragment.java | 10 ++++++++++ app/src/main/res/layout/fragment_user_profile.xml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/UserProfilePresenter.kt b/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/UserProfilePresenter.kt index 519cc97715..d3b7fc96f5 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/UserProfilePresenter.kt +++ b/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/UserProfilePresenter.kt @@ -308,7 +308,6 @@ class UserProfilePresenter : BasePresenter() { } models.add(VHModel(VHModel.PROFILE_CONTACT_ITEM, mAccount)) } - models.add(VHModel(VHModel.EMPTY, null)) return models } diff --git a/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/profile/UserProfileFragment.java b/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/profile/UserProfileFragment.java index b8276ad6a8..33d7891c34 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/profile/UserProfileFragment.java +++ b/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/profile/UserProfileFragment.java @@ -136,6 +136,16 @@ public class UserProfileFragment extends BaseFragment implements UserProfileView float percentage = (float) Math.abs(offset) / (float) maxScroll; handleToolbarTitleVisibility(percentage); }); + + view.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { + int height = bottom - top; + int old_height = oldBottom - oldTop; + if (height != old_height) { + mAppBarLayout.setExpanded(true, true); + mNynjaHeaderView.setBackgroundAndDividerAlpha(0f); + } + }); + mNynjaHeaderView.setBackgroundAndDividerAlpha(0f); } diff --git a/app/src/main/res/layout/fragment_user_profile.xml b/app/src/main/res/layout/fragment_user_profile.xml index 73b96e3c31..759a3b4a28 100644 --- a/app/src/main/res/layout/fragment_user_profile.xml +++ b/app/src/main/res/layout/fragment_user_profile.xml @@ -44,7 +44,7 @@