zoukankan      html  css  js  c++  java
  • 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下载

  • 相关阅读:
    【JS】修改字体
    【git】.gitignore文件常用设置
    【CSS】让textarea在div里水平垂直都居中的三种办法
    【JS】随着进度条进展,逐个显示li节点
    【MySQL】The server time zone value 'xxxxxx' is unrecognized or represents more than one time zone 解决方案
    浅谈Web前端开发中的Touch事件
    [转]PostgreSQL与MySQL比较
    RDLC:An error occurred during local report processing
    [转]让你的PHP更安全
    [转]Win7或Windows server 2008中IIS7支持ASP+Access解决方法
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/5083520.html
Copyright © 2011-2022 走看看