最近做了一个项目,大量的用到了Dialog,但是考虑到Dialog的弹窗比较单一,所以准备了一些基本动画,这里做一下记录! 闲话不多说,请开始我们的表演!这里先上图看一下大概有哪些东西,GIF就不用想了,忘记录屏了嘎嘎嘎….. 好了进入正文! 首先生成对象(稍后我会在下面给出BaseDialog) 一、Dialog顶部弹出退出效果 二、Dialog底部弹出退出效果 三、Dialog左弹出退出效果 四、Dialog右弹出退出效果 另附上xml代码 BaseDialog点击这里下载!
 
BaseDialog dialog = new BaseDialog(this); 
dialog.contentView(R.layout.dialog_photo_top_bottom)                 .layoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))                 .dimAmount(0.5f)                 .gravity(Gravity.TOP)                 .offset(0, DpToPxUtils.dpInt2px(this, 48))                 .animType(BaseDialog.AnimInType.TOP)                 .canceledOnTouchOutside(true).show();   
dialog.contentView(R.layout.dialog_photo_top_bottom)                 .gravity(Gravity.BOTTOM)                 .animType(BaseDialog.AnimInType.BOTTOM)                 .canceledOnTouchOutside(true).show(); //为啥这么少呢?看看是不是你想要的,比如底部弹出相册,相机之类的 
dialog.contentView(R.layout.dialog_photo_top_bottom)                 .layoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))                 .dimAmount(0.5f)                 .gravity(Gravity.LEFT | Gravity.CENTER)                 .animType(BaseDialog.AnimInType.LEFT)                 .canceledOnTouchOutside(true).show(); 
dialog.contentView(R.layout.dialog_photo_top_bottom)                 .layoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))                 .gravity(Gravity.RIGHT | Gravity.CENTER)                 .animType(BaseDialog.AnimInType.RIGHT)                 .offset(20, 0)                 .canceledOnTouchOutside(true).show(); 
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="https://schemas.android.com/apk/res/android"              android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="vertical"     android:background="@color/white"     >     <LinearLayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="vertical">          <TextView             android:id="@+id/tv_photo"             android:layout_width="match_parent"             android:layout_height="56dp"             android:gravity="center"             android:text="拍照"             android:textSize="16sp" />         <View             android:layout_width="match_parent"             android:layout_height="0.1dp"             android:background="#e6e6e6" />         <TextView             android:id="@+id/tv_album"             android:layout_width="match_parent"             android:layout_height="56dp"             android:gravity="center"             android:text="从相册选择"             android:textSize="16sp" />     </LinearLayout>     <View         android:layout_width="match_parent"         android:layout_height="10dp"         android:background="#eaebed"/>     <TextView         android:id="@+id/tv_photo_cancel"         android:layout_width="match_parent"         android:layout_height="56dp"         android:gravity="center"         android:text="取消"         android:textSize="16sp" /> </LinearLayout>
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算
官方软件产品操作指南 (170)