摘要: 当工程充当其他工程的jar,每次调试后都需要拷贝到相应目录下,而且还得改android.library=true。 麻烦故写了个用ant编译成jar并拷贝到某目录.ant: 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 <project basedir="." default="jarfiles" name="jarHelper"> 3 <target name=" 阅读全文
posted @ 2013-04-15 17:48 wFeng 阅读(303) 评论(0) 推荐(0)
摘要: 功能列表:横向显示子视图的宽度设置有效match_parent : 与HorizontalListView的宽度相同wrap_content : 宽度为自己所需宽度固定数值 : 宽度为固定值支持setSelection(int) setSelectionFromLeft(int, int)支持scrollTo(int)支持RequestFreeze通常用于刷新数据,固定当前子视图的位置。支持OnScrollListener请从github上下载源码。本文后面贴的代码不同步更新了。HorzitontalListView Source codeDemo1Demo2 for lionlionsGit 阅读全文
posted @ 2013-04-15 16:16 wFeng 阅读(3544) 评论(5) 推荐(0)
摘要: 当2月。通过1 final int max = time.getActualMaximum(Calendar.DAY_OF_MONTH);获取最大天数时。自动会调至3月。解决方法:在之前设置1 time.set(Calendar.DATE, 1);原因。。有时间看看源码再说吧。 阅读全文
posted @ 2013-03-30 17:38 wFeng 阅读(114) 评论(0) 推荐(0)
摘要: 最近在读代码重构的书。其中这点受益匪浅。记录一下。取出魔法数,将其声明为final (static) 变量,非常经典的作法。但不仅仅止步于此。其最致命的缺点就是:他只是一个整数。那就意味着没有类型检查。尤其如类型,flag。 public static final int FLAG_ACTION_MOOD = FLAG_ACTION_DEFAULT; public static final int FLAG_ACTION_MOOD_WRONGED = FLAG_ACTION_DEFAULT; public static final int FLAG_ACTION_MOOD_C... 阅读全文
posted @ 2013-03-15 18:31 wFeng 阅读(309) 评论(0) 推荐(0)
摘要: 先说结果:setMeasureAllChildren(false).可以让子View适应自己的高度。查看源码可以发现。ViewFlipper的父类ViewAnimator是继承与FrameLayout.1.能控制View的宽高的话,先去onMeasure看看。 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int count = getChildCount(); final boolean measureMatchParentChildren = ... 阅读全文
posted @ 2013-03-14 12:51 wFeng 阅读(538) 评论(0) 推荐(0)
摘要: View缩放。根据两指连线的中点为缩放中心进行缩放。SacleGesture.java 1 2 3 import android.view.ScaleGestureDetector; 4 import android.view.View; 5 import android.view.ScaleGestureDetector.OnScaleGestureListener; 6 import android.view.animation.Animation; 7 import android.view.animation.ScaleAnimation; 8 9 /**10 * scale ... 阅读全文
posted @ 2013-03-13 11:01 wFeng 阅读(3288) 评论(0) 推荐(0)