实现widget时钟翻页效果,类似墨迹天气:
比较简单的方法是 帧动画方式实现,但需要很多的图片资源,每次切换都需要三张图,放弃此种方法。
墨迹天气的实现方法:
通过基本的图片每次在时间切换时动态生成图片:
[DEMO widget生成图] 每次切换时 从上往下翻。
主要使用的xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="@integer/pageturning_layout_weight_top"
android:orientation="vertical" >
&l