Android复制WIN8点击下沉倾斜系统瓷砖效果

※效果


Android复制WIN8点击下沉倾斜系统瓷砖效果

※使用说明


Java代码

import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast; public class TestRolateAnimActivity extends Activity {
/** Called when the activity is first created. */
MyImageView joke;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); joke=(MyImageView) findViewById(R.id.c_joke);
joke.setOnClickIntent(new MyImageView.OnViewClick() { @Override
public void onClick() {
// TODO Auto-generated method stub
Toast.makeText(TestRolateAnimActivity.this, "事件触发", 1000).show();
System.out.println("1");
}
});
}
}

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:gravity="center"
android:orientation="vertical" android:background="@drawable/bkg_img_default"> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<com.ljp.ani.MyImageView
android:id="@+id/c_joke"
android:layout_width="wrap_content" android:scaleType="matrix"
android:layout_height="wrap_content" android:layout_margin="2dp"
android:src="@drawable/left_top" />
<com.ljp.ani.MyImageView
android:id="@+id/c_idea"
android:layout_width="wrap_content" android:scaleType="matrix"
android:layout_height="wrap_content" android:layout_margin="2dp"
android:src="@drawable/left_bottom" />
</LinearLayout>
<com.ljp.ani.MyImageView
android:id="@+id/c_constellation"
android:layout_width="wrap_content" android:scaleType="matrix"
android:layout_height="wrap_content" android:layout_margin="2dp"
android:src="@drawable/right" />
</LinearLayout>
<com.ljp.ani.MyImageView
android:id="@+id/c_recommend"
android:layout_width="wrap_content" android:scaleType="matrix"
android:layout_height="wrap_content" android:layout_margin="2dp"
android:src="@drawable/bottom" />
</LinearLayout> </LinearLayout>

Demo下载

上一篇:Poj 1125 Stockbroker Grapevine(Floyd算法求结点对的最短路径问题)


下一篇:JAVA:类,对象,成员属性,成员方法,构造方法,类变量,类方法<2>