Android 5.0属性
//水波纹效果
//v 指定控件 x屏幕的 x轴 y轴 endRadio 起始位置 水波半径
Animator circularReveal = ViewAnimationUtils.createCircularReveal(v, x, y, endRadius,Math.max(width, height));
circularReveal.setDuration(2000); //动画时长
circularReveal.start();//开启动画
//实例化 5.0toolbar 在xml中声明
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
//获取ActionBar
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
//ActionBar 与DrawerLayout有一个连接的工具类,可以做出一个炫酷的效果
ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, mDraw, mToolbar, R.string.opend_drawer, R.string.close_drawer);
//同步状态 (效果比较帅)
drawerToggle.syncState();
//与DrawLayout联动监听
mDraw.addDrawerListener(drawerToggle); //pupupWindow (类似与Dialog,可以自定义样式做出更帅气的样式)
pop = LayoutInflater.from(this).inflate(R.layout.popul, null); //导入popupWindow布局
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); //得到屏幕的宽高
int widthPixels = displayMetrics.widthPixels;
int heightPixels = displayMetrics.heightPixels; mPopupWindow.setWidth(widthPixels * 2 / 3);
mPopupWindow.setHeight(heightPixels / 3);
mPopupWindow.setAnimationStyle(R.style.pop_animation); //导入动画 style 这里添加了进入和退出的动画
//点击popupWindow以外的地方 popupWindow会消失
mPopupWindow.setFocusable(true);
mPopupWindow.setOutsideTouchable(true);
mPopupWindow.setBackgroundDrawable(new BitmapDrawable()); //
得到控件的高度
int height = mOpen.getMeasuredHeight();//
//共享元素 需要在新页面和当前页面View设置一样的 transitionName值; 在页面跳转的时候我们会感觉前一页的控件是移动到新的页面的
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(this, v, string); //指定共享动画的控件
Pair sharedElements = new Pair(v, string); //是可变参数
Pair pair = new Pair(mBtn, string1);//string1 transitionName的属性
ActivityOptionsCompat.makeSceneTransitionAnimation(this, sharedElements, pair);
//
startActivity(intent, optionsCompat.toBundle()); //动画只在5.0之上之上
DrawLayout android5.0推出的侧滑菜单
DrawerLayout包含两个或3个直接的Chiled默认是在中间 如果想让child显示在左边,作为左侧菜单用layout_gravity=left 或start
反之右边
Android 5.0属性的更多相关文章
- Android 5.0 如何正确启用isLoggable(一)__使用详解
转自:http://blog.csdn.net/yihongyuelan/article/details/46409389 isLoggable是什么 在Android源码中,我们经常可以看到如下代码 ...
- Android控件属性大全(转)
http://blog.csdn.net/pku_android/article/details/7365685 LinearLayout 线性布局 子元素任意: Tab ...
- Android开发EditText属性
Android开发EditText属性 EditText继承关系:View-->TextView-->EditText EditText的属性很多,这里介绍几个:android:hint= ...
- Android之shape属性详解
有时候 ,为了满足一些需求,我们要用到 shape 去定义 一些背景,shape 的用法 跟图片一样 ,可以给View设置 Android:background="@drawable/sha ...
- Android 4.0 事件输入(Event Input)系统
参考:http://blog.csdn.net/myarrow/article/details/7091061 1. TouchScreen功能在Android4.0下不工作 原来在Android2. ...
- [转]Android 5.0——Material Design详解(动画篇)
Material Design:Google推出的一个全新的设计语言,它的特点就是拟物扁平化. Material Design包含了很多内容,今天跟大家分享一下Material新增的动画: 在Andr ...
- Android(java)学习笔记263:Android下的属性动画(Property Animation)
1. 属性动画(Property Animation)引入: 在手机上去实现一些动画效果算是件比较炫酷的事情,因此Android系统在一开始的时候就给我们提供了两种实现动画效果的方式,逐帧动画(fra ...
- Android Animation 动画属性
在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现: 一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...
- Android中shape属性详解
一.简单使用 刚开始,就先不讲一堆标签的意义及用法,先简单看看shape标签怎么用. 1.新建shape文件 首先在res/drawable文件夹下,新建一个文件,命名为:shape_radius.x ...
随机推荐
- 线程安全及Python中的GIL
线程安全及Python中的GIL 本博客所有内容采用 Creative Commons Licenses 许可使用. 引用本内容时,请保留 朱涛, 出处 ,并且 非商业 . 点击 订阅 来订阅本博客. ...
- java 线程安全 synchronized
一.线程安全问题: 并发编程的原则:设计并发编程的目的是为了使程序获得更高的执行效率,但绝不能出现数据一致性(数据准确)问题,如果并发程序连最基本的执行结果准确性都无法保证,那并发编程就没有任何意义. ...
- 转 MySQL 数据备份与还原
MySQL 数据备份与还原 原贴:http://www.cnblogs.com/kissdodog/p/4174421.html 一.数据备份 1.使用mysqldump命令备份 mysqldum ...
- 利用百度云免费备份SQL数据库
我们开发了一个会员管理系统,随着使用的人越来越多,异地备份数据库就显得十分重要,万一硬盘出问题了怎么办呢.所以就着手做这个工作. 首先呢,找到了几个专门用来提供备份数据库的网站,一年好几百,好贵.放弃 ...
- 解决Shiro注解无效的问题
当Shiro集成到Spring mvc中,却发现shiro的权限注解不起作用,官方的配置是要支持注解,只需要将以下代码加到spring 配置文件中即可: <bean class="or ...
- linux中service *** start与直接运行/usr/bin/***的区别
在linux想要运行启动一个服务有两种方法: 1,运行/etc/init.d/目录下的shell脚本,还可以有快捷方式,service *** start/ stop/restart /status, ...
- Nuke
- Debugging python code IN nuke with Eclipse - Documents: http://www.thefoundry.co.uk/products/nuke- ...
- 关于Failed to install helloworld.apk on device 'emulator-5554!的一个解决办法
好不容易架好了android环境,把该安得都安好了,结果发现在安装过程中创建一个虚拟设备映象就占用了c盘34g的空间,我的系统盘差点瘫了,看来以后就只能先用这一个虚拟设备调试了, 接着说上边这个问题, ...
- PHP常用函数(1)
1. create_linkstring 说明: 把数组拼接成字符串 if (!function_exists('create_linkstring')) { /** * 把数组所有元素,按照“参数= ...
- jquery 中post 、get的同步问题
jquery 中post .get的同步问题 解决方法1: 在全局设置: $.ajaxSetup({ async : false }); 然后再使用post或get方法 $.get("reg ...