726学习

手工设置文本与图片相对位置时,常用到如下方法:
setCompoundDrawables(left, top, right, bottom);
setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom)
意思是设置Drawable显示在text的左、上、右、下位置。
(Textview、Button都可以)
但是两者有些区别:

setCompoundDrawables 画的drawable的宽高是按drawable.setBound()设置的宽高,所以才有The Drawables must already have had setBounds(Rect) called.意思是说使用之前必须使用Drawable.setBounds设置Drawable的长宽。
而setCompoundDrawablesWithIntrinsicBounds是画的drawable的宽高是按drawable固定的宽高,即通过getIntrinsicWidth()与getIntrinsicHeight()获得,所以才有The Drawables' bounds will be set to their intrinsic bounds.这句话之说!

 

final PackageManager manager = getPackageManager();

 final ActivityManager tasksManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);

 final List<ActivityManager.RecentTaskInfo> recentTasks = tasksManager .getRecentTasks(MAX_RECENT_TASKS, 0);

获取近期的任务


final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(pickWallpaper,getString(R.string.menu_wallpaper)));

选择背景图


PackageManager manager = getPackageManager();
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);
Collections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));

获取全部应用程序


checkbox.toggle()


LayoutAnimationController mShowLayoutAnimation = AnimationUtils.loadLayoutAnimation(this,R.anim.show_applications)

LayoutAnimationController
      LayoutAnimationController用于为一个Layout里面的控件或者是Viewgroup的控件设置动画效果。。
LayoutAnimationController 用来为一个layout 或是viewgroup 包含的子view添加动画效果, Layout中的每个元素
都会采用同一个动画效果,但开始时间不同。 子View动画的缺省开始时间为子View在Layout中的序号index 乘以 一个固定的时间间隔。 
LayoutAnimationController 的子类可以重载getDelayForView(android.view.View)为子View定义动画开始时间,
如GridLayoutAnimationController 根据子View的行和列来计算子View动画的开始时间。
顺序::
ORDER_NORMAL
ORDER_REVERSE
ORDER_RANDOM
====================
AnimationSet
Represents a group of Animations that should be played together.
 * The transformation of each individual animation are composed 
 * together into a single transform. 
 在Android 中用于制作混合型动画
 AnimationSet 可以包含多个Animation,但都是在同一个时间执行的,是并行,不是串行执行的。
如果AnimationSet中有一些设定,如duration,fillBefore等,它包含的子动作也设定了的,
 

====================
 
  Interpolator
定义了动画变化的速率或规律,其具体的实现可以使用以下子类:
 interpolator 被用来修饰动画效果,定义动画的变化率,
  可以使存在的动画效果可以 accelerated(加速),decelerated(减速),repeated(重复),bounced(弹跳)等
 
 
 =========================
 
android:layoutAnimation 属性定义在ViewGroup中,因此所有ViewGroup的子类都可以定义android:layoutAnimation。 ViewGroup可以嵌套定义,从而layout animation 也可以嵌套


Animation使用方法 http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece76310508d315909dc743ca0804b22818448e4635810013bf4bb50734d5bcec57d6d00a5495bf7f43176330822a3de95c81cd2e5c13f2ef86c69375ad51d498c4ae9901b79d621e00bb4f35fa7e7ae6cc4ee&p=882a9642d7d252f511be9b7d0b088029&user=baidu&fm=sc&query=LayoutAnimationController&qid=84c4c6c21b74ee07&p1=12


android:duplicateParentState

如果设置此属性,将直接从父容器中获取绘图状态(光标,按下等)。 注意仅仅是获取绘图状态,而没有获取事件,也就是你点一下LinearLayout时Button有被点击的效果,但是不执行点击事件。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值