我想为列表视图的项目设置动画.目前,无论何时添加新项目,我都会在列表项上应用过渡动画.但这不是我想要实现的动画.我希望当列表视图中添加新项目时,整个列表视图会向下移动一个位置以便为新添加的项目腾出空间.
目前我使用的代码是:
set = new AnimationSet(true);
animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(50);
set.addAnimation(animation);
animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, -1.0f,Animation.RELATIVE_TO_SELF, 0.0f
);
animation.setDuration(150);
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(set, 1.0f);
l.setLayoutAnimation(controller);
l.setAdapter(listAdaptor);
Run Code Online (Sandbox Code Playgroud)
然后通过按钮onClick添加项目
l.startLayoutAnimation();
Run Code Online (Sandbox Code Playgroud)
任何其他建议来实现这样的动画.
我正在向CallLog.Calls内容提供商查询呼叫详细信息。我做这样的事情
Cursor managedCursor = cr.query(CallLog.Calls.CONTENT_URI, null,
null, null, null);
Run Code Online (Sandbox Code Playgroud)
通过这种方式,我得到了所有的通话记录。但现在我想按当前日期查询,以便我只得到当前日期的通话记录。应该如何处理这个问题?