Fix z-order and remove V.dp from more custom views

This commit is contained in:
Grishka
2023-03-22 16:55:09 +03:00
parent e5d60050a2
commit 477a691c9e
6 changed files with 63 additions and 15 deletions

View File

@@ -69,6 +69,7 @@ import org.joinmastodon.android.ui.text.CustomEmojiSpan;
import org.joinmastodon.android.ui.text.HtmlParser;
import org.joinmastodon.android.ui.utils.UiUtils;
import org.joinmastodon.android.ui.views.CoverImageView;
import org.joinmastodon.android.ui.views.CustomDrawingOrderLinearLayout;
import org.joinmastodon.android.ui.views.NestedRecyclerScrollView;
import org.joinmastodon.android.ui.views.ProgressBarButton;
import org.joinmastodon.android.utils.ElevationOnScrollListener;
@@ -125,6 +126,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
private View nameEditWrap, bioEditWrap;
private View tabsDivider;
private View actionButtonWrap;
private CustomDrawingOrderLinearLayout scrollableContent;
private Account account;
private String accountID;
@@ -204,6 +206,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
countersLayout=content.findViewById(R.id.profile_counters);
tabsDivider=content.findViewById(R.id.tabs_divider);
actionButtonWrap=content.findViewById(R.id.profile_action_btn_wrap);
scrollableContent=content.findViewById(R.id.scrollable_content);
avatar.setOutlineProvider(OutlineProviders.roundedRect(24));
avatar.setClipToOutline(true);
@@ -288,6 +291,14 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
return true;
});
scrollableContent.setDrawingOrderCallback((count, pos)->{
// The header is the first child, draw it last to overlap everything for the photo viewer transition to look nice
if(pos==count-1)
return 0;
// Offset the order of other child views to compensate
return pos+1;
});
return sizeWrapper;
}