I want to implement Contact details screen like Android 5.0 aka Lollipop.
To describe more when we click on icon/image of any contact, one view slide up from bottom of screen. By default, this view fills half of screen and remaining top of screen is transparent with little alpha added.
Secondly, View changes its position upward with finger swipe in upward direction, also transparent part become more darker and at one position name of contact (TextView) start reducing its font size. This continues till it become part ActionBar.
I have some queries regarding how to implement this
Is Contact details View a separate activity with transparent half at the top or it is overlay for contact list screen only
What is best possible solution to show animation with gesture (changing position with finger swipe).
How to reduce size of keyboard with finger swipe and how to determine that now TextView should start reducing its font size
Last one is How to make TextView as part of actionbar with finger swipe changes
Use android.support.design.widget.BottomSheetDialog
For example:
BottomSheetDialog mBottomSheetDialog = new BottomSheetDialog(this);
View view = getLayoutInflater().inflate(R.layout.your_layout, null);
// do any view specific operations here like adding click listener etc..,
mBottomSheetDialog.setContentView(view);
mBottomSheetDialog.show();
And when you have any scrollable widgets(Nested Scrollview or RecyclerView) in your layout inflated, it will work very smooth.
The interesting part is you can set the initial content height
BottomSheetBehavior mBehavior = BottomSheetBehavior.from((View) view.getParent());
mBehavior.setPeekHeight(dialog height);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With