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下载

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
[转]JSONObject与JSONArray的使用 .
原文链接:http://coolxing.iteye.com/blog/1211403原文地址 什么是JSON: JSON即JavaScript Object Natation, 它是一种轻量级的数据交换格式, 与XML一样, 是广泛被采用的客户端和服务端交互的解决方案. JSON对象: JSON中对象(Object)以"{"开始, 以"}"结束. 对象中的每一个item都是一个key-value对, 表现为"key:value"的形式, key-value对之间使用逗号分隔. 如:{"name":"coolxing", "age"=24, "male":true, "address":{"street":"huiLongGuan", "city":"beijing", "country":"china"}}. JSON对象的key只能是string类型的, 而value可以是string, number, false, true, null, Object对象甚至是array数组, 也就是说可以存在嵌套的情况. JSON数组: JSON数组(array)以"["开始, 以"]"结束,...
- 下一篇
Android Studio使用心得 - 简单介绍与环境配置
FBI Warning:欢迎转载,但请标明出处:http://blog.csdn.net/codezjx/article/details/38544823,未经本人允许请勿用于商业用途。感谢支持! 关于Android Studio 在2013 Google IO大会上公布的全新IDE Android Studio相信各位猿们并不陌生,截止2014的Google IO大会。尽管依旧木有公布正式版。可是依据我这几周的使用情况来说,BUG已经非常少了,全然不影响正常使用。 并且Android Studio是基于IntelliJ的,不管从执行速度上还是编程的快捷性上,都比Eclipse的体验要好,开发效率妥妥的提高了。 Android Studio vs Eclipse ADT 眼下Android Studio最大的缺点是还不支持NDK工具,假设项目里面有使用NDK的。预计要等正式版后才干用了。(或者通过第三方的编译环境,如Cygwin等,来编译本地代码) 关于版本号: 截至2014/08/13。眼下最新版是CanaryChannel的0.8.6 (补充说明一下这里的版本号:总共分为4个Cha...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Red5直播服务器,属于Java语言的直播服务器
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS7,8上快速安装Gitea,搭建Git服务器
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- Docker快速安装Oracle11G,搭建oracle11g学习环境