Android仿Win8风格布局_安卓仿Windows Phone磁贴Demo
2014-12-08 15:44:28 By: shinyuu
今天在找Android仿Win8控件的时候、发现了这样了极好的控件、效果看起来非常不错、整个应用Demo是利用自定义ImageView并且加上View点击事件以及非常好看的动画实现的效果、虽然这个Demo不是我本人写的、但是个人感觉非常不错、在这里分享给大家、希望对大家有帮助
先来看看程序运行效果吧
整个效果的实现已经被封装好了、我们只需要简单的调用即可、调用方法也非常简单
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:background="@drawable/bkg_img_default" android:gravity="center" android:orientation="vertical" > <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:layout_height="wrap_content" android:layout_margin="2dp" android:scaleType="matrix" android:src="@drawable/left_top" /> <com.ljp.ani.MyImageView android:id="@ id/c_idea" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="2dp" android:scaleType="matrix" android:src="@drawable/left_bottom" /> </LinearLayout> <com.ljp.ani.MyImageView android:id="@ id/c_constellation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="2dp" android:scaleType="matrix" android:src="@drawable/right" /> </LinearLayout> <com.ljp.ani.MyImageView android:id="@ id/c_recommend" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="2dp" android:scaleType="matrix" android:src="@drawable/bottom" /> </LinearLayout> </LinearLayout>
Java代码
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, "事件触发", TOAST_TIME).show(); } });
最后把已经添加注释的源代码分享给大家、因为我下载下来的时候源代码是没有注释的
源代码下载链接: http://dwtedx.com/download.html?bdkey=s/1pJlxtsZ 密码: bhgx
若资源对你有帮助、浏览后有很大收获、不妨小额打赏我一下、你的鼓励是维持我不断写博客最大动力
想获取DD博客最新代码、你可以扫描下方的二维码、关注DD博客微信公众号(ddblogs)
或者你也可以关注我的新浪微博、了解DD博客的最新动态:DD博客官方微博(dwtedx的微博)
如对资源有任何疑问或觉得仍然有很大的改善空间、可以对该博文进行评论、希望不吝赐教
为保证及时回复、可以使用博客留言板给我留言: DD博客留言板(dwtedx的留言板)
感谢你的访问、祝你生活愉快、工作顺心、欢迎常来逛逛