Reputation: 890
How do I make this kind of popup activity that I can scroll to enlarge/kill? I know how to make the layout of a normal activity but I would like to add this feature if I can.
Upvotes: 0
Views: 58
Reputation: 1926
Check out BottomSheetBehavior
.
You can put your layouts in the main activity or use a fragment:
<android.support.design.widget.CoordinatorLayout ...>
<android.support.design.widget.AppBarLayout...>
<android.support.design.widget.CollapsingToolbarLayout...">
<android.support.v7.widget.Toolbar... />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_layout" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:fitsSystemWindows="true"
app:behavior_hideable="false"
app:behavior_peekHeight="0dp"
app:layout_behavior="@string/bottom_sheet_behavior">
(desired view here)
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
Read more:
Upvotes: 1