Divyank Vijayvergiya
Divyank Vijayvergiya

Reputation: 164

How to make Top Dialog or sheet in Android?

How should I make sheet like this at the top of screen just bottom to the toolbar. Sheet should be open and close after clicking on calendar icon only.

enter image description here

Upvotes: 1

Views: 944

Answers (1)

Praveen Kumar
Praveen Kumar

Reputation: 277

  1. Use a RelativeLayout in which define toolbar after that use android:below_layout to set your button bottom to the toolbar.
  2. Now define four button as you already defined and set their four fragment or single activity.
  3. If you are using activity then just hide or show according to your button click.
  4. If you are using fragment then use fragment transaction to move from one fragment or another.
  5. Now come to your point . Open default view that is Streak after that define these four button state in this class and pass the particular value. if the value is valid then open other view otherwise not or show Error toast.

Upvotes: 1

Related Questions