android app增加沉浸式状态栏和导航栏。
- 加入支持文件到工程
把这个文件SystemBarTintManager.java复制到工程内;
出处:http://stackoverflow.com/questions/26455027/android-api-21-toolbar-padding
How do I get rid of the extra padding in the new Toolbar with Android SDK API version 21 (the support library)?
Swift语言指南 By @SwiftLanguage(转自:http://dev.swiftguide.cn/)
目录
grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。
3.0以前,android支持两种动画模式,tween animation,frame animation,在android3.0中又引入了一个新的动画系统:property animation,这三种动画模式在SDK中被称为property animation,view animation,drawable animation。 可通过NineOldAndroids项目在3.0之前的系统中使用Property Animation
现在很多软件都有这种滑动列表的时候自动隐藏页面头部和底部元素的功能,比如Google+。在刚刚进入Activity的时候,页面是一个列表,底部有一个view,头部一个view,当列表向上滑动的时候,隐藏头尾元素,以显示更多内容,当列表向下滑动的时候,再将头尾元素拉出来。比如Google+。
当给ListView加了一个HeaderView后(代码如下),我们发现,onItemClick方法里的position参数的值不是我们所期望的,比如点击ListView的第一行,我们期望的position是0,可是实际上却是1,也就是说,它是从Header而不是从第一行开始计数的。
新建一个固有的width/height的Drawable资源:
<!--用于horizonal-->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<size android:width="1dp"/>
<solid android:color="@color/white"/>
</shape>
<!-- used for verital -->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<size android:height="1dp"/>
<solid android:color="@color/white"/>
</shape>
转自:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/1022/1824.html
1 | protected void onPostCreate (Bundle savedInstanceState) |
Since: API Level 1
Called when activity start-up is complete (after onStart() and onRestoreInstanceState(Bundle) have been called). Applications will generally not implement this method; it is intended for system classes to do final initialization after application code has run.
转自:http://www.jcodecraeer.com/a/anzhuokaifa/Android_Studio/2015/0227/2502.html
这篇文章介绍通过Gradle把开源项目发布到公共仓库JCenter中,方便你我他的事情,我们都是很懒的嘛。JCenter现在是Android Studio中repositories的默认节点了,之前是Maven的,不过JCenter是兼容Maven的,所以放心使用。步骤基本是按Publishing Gradle Android Library to jCenter Repository这里来的,英文能看的直接看这篇也行。下面我的步骤正式开始,发布到JCenter仓库的是我的项目:BounceProgressBar。