BottomDialog 是一个通过 DialogFragment 实现的底部弹窗布局,并且支持弹出动画,支持任意布局http://shaohui.me
2016-10-18 14:26
756 查看
BottomDialog
项目地址:shaohui10086/BottomDialog简介:BottomDialog 是一个通过 DialogFragment 实现的底部弹窗布局,并且支持弹出动画,支持任意布局http://shaohui.me
中文版
BottomDialogis a bottom dialog layout implemented
with
DialogFragment,And supports pop-up animation, support any layout
Preview
Import
Maven<dependency> <groupId>me.shaohui</groupId> <artifactId>bottomdialog</artifactId> <version>1.1.9</version> <type>pom</type> </dependency>
or Gradle
compile 'me.shaohui:bottomdialog:1.1.9'
Uasge
You can use BottomDialogin two different
ways :
1.Use directly BottomDialog
A simple three lines of code can be done:BottomDialog.create(getSupportFragmentManager()) .setLayoutRes(R.layout.dialog_layout) // dialog layout .show();
Of course, you can also make simple settings:
BottomDialog.create(getSupportFragmentManager()) .setViewListener(new BottomDialog.ViewListener() { @Override public void bindView(View v) { // // You can do any of the necessary the operation with the view } }) .setLayoutRes(R.layout.dialog_layout) .setDimAmount(0.1f) // Dialog window dim amount(can change window background color), range:0 to 1,default is : 0.2f .setCancelOutside(false) // click the external area whether is closed, default is : true .setTag("BottomDialog") // setting the DialogFragment tag .show();
So Easy!
2.or extends BaseBottomDialog
to use
First of all, according to your needs to define a class,extends BaseBottomDialog,For
example below
ShareBottomDialog
public class ShareBottomDialog extends BaseBottomDialog{ @Override public int getLayoutRes() { return R.layout.dialog_layout; } @Override public void bindView(View v) { // do any thing you want } }
So simple, only two abstract methods needed to achieve, the rest is to add your logic. Of course, you can also rewrite some of the necessary methods to meet your needs, You can manipulate this Dialog as you would
a Fragment
int getHeight() // return your bottomDialog height float getDimAmount() // set dialog dim amount(can change window background color), default is 0.2f boolean getCancelOutside() // click the external area whether is closed, default is : true String getFragmentTag() // set dialogFragment tag
The rest is use it:
ShareBottomDialog dialog = new ShareBottomDialog(); dialog.show(getFragmentManager());
That is all!
Issue
If you are in the process of using, encountered any problems, welcome to put forward issue
相关文章推荐
- Android安卓用Dialog对话框简单并且完美实现popupWindow底部弹出效果,有动画效果
- 使用 DialogFragment 和 BottomSheet 实现底部弹出框
- 【Android】底部弹出的DialogFragment,支持从右向左push二级页面,自带弹出时折叠动画
- 自定义分享DialogFragment,底部弹出动画
- 通过style实现从屏幕底下弹出dialog动画效果
- 利用线性布局和相对布局实现一个简单的页面并且使应用支持国际化语言
- dialog底部弹出自定义view并且伴随动画弹出和消失
- Android使用BottomSheetBehavior 和 BottomSheetDialog实现底部弹窗
- Fragment+ListView实现碎片化管理订单(另附自定义布局AlertDialog弹窗的设置)
- Android实现底部对话框BottomDialog弹出实例代码
- Dialog底部弹出自定义view并且伴随动画弹出和消失
- 自定义Dialog对话框并实现从底部弹出的动画效果
- 自定义 DialogFragment 实现底部弹出 dialog
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”
- 稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的支持: 通过 UdpAnySourceMulticastClient 实现 ASM(Any Source Multicast),即“任意源多播”