欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

仿微信的開門效果

系統 1643 0
有人已經發過了,我掐頭去尾精簡了一下

仿微信的開門效果

仿微信的開門效果
這種效果跟圖和布局有很大關系,并不難。
先看布局:
    
<?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:id="@+id/layout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:background="@drawable/whatsnew_bg"
        android:gravity="center_horizontal|bottom"
        android:visibility="visible"
        >
        <Button
              android:id="@+id/btn_start"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="開始我的性生活"
              android:textSize="18sp"
              android:textColor="#FFFFFFFF"
              android:background="@drawable/button_bg"
			  android:layout_marginBottom="20dip"
              />
    </LinearLayout>
    <LinearLayout 
        android:id="@+id/animLayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        >
        <LinearLayout
            android:id="@+id/leftLayout" 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            >
	        <ImageView 
	            android:layout_width="fill_parent"
	            android:layout_height="wrap_content"
	            android:src="@drawable/whatsnew_left"
	            android:layout_weight="1"
	            />
	        <ImageView 
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"
	            android:src="@drawable/whatsnew_left_m"
	            />
        </LinearLayout>
        <LinearLayout 
            android:id="@+id/rightLayout" 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            >
	        <ImageView 
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"
	            android:src="@drawable/whatsnew_right_m"
	            />
	        <ImageView 
	            android:layout_width="fill_parent"
	            android:layout_height="wrap_content"
	            android:src="@drawable/whatsnew_right"
	            android:layout_weight="1"
	            />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

  


在看代碼:
    
package com.dl.app;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.widget.Button;
import android.widget.LinearLayout;

public class TestOpenDoorActivity extends Activity {
	private Context context;
	private Button btn_start;
	
	private LinearLayout layout;
	private LinearLayout animLayout;
	private LinearLayout leftLayout;
	private LinearLayout rightLayout;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        this.context=this;
        initViews();
        
    }
    
    private void initViews(){
    	btn_start=(Button)findViewById(R.id.btn_start);
    	btn_start.setOnClickListener(onClickListener);
    	
    	layout = (LinearLayout) findViewById(R.id.layout);
    	animLayout = (LinearLayout) findViewById(R.id.animLayout);
		leftLayout  = (LinearLayout) findViewById(R.id.leftLayout);
		rightLayout  = (LinearLayout) findViewById(R.id.rightLayout);
		
    }
    
    View.OnClickListener onClickListener=new View.OnClickListener(){

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.btn_start:
				doOpenDoor();
				break;

			default:
				break;
			}
		}
    	
    };
    
    private void doOpenDoor(){
    	
    	layout.setVisibility(View.GONE);
    	animLayout.setVisibility(View.VISIBLE);
    	Animation leftOutAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate_left);
		Animation rightOutAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate_right);
		
		leftLayout.setAnimation(leftOutAnimation);
		rightLayout.setAnimation(rightOutAnimation);
		leftOutAnimation.setAnimationListener(new AnimationListener() {
			@Override
			public void onAnimationStart(Animation animation) {
			}
			@Override
			public void onAnimationRepeat(Animation animation) {
			}
			@Override
			public void onAnimationEnd(Animation animation) {
				leftLayout.setVisibility(View.GONE);
				rightLayout.setVisibility(View.GONE);
				Intent intent = new Intent(context,OtherActivity.class);
				startActivity(intent);
				finish();
				overridePendingTransition(R.anim.zoom_out_enter, R.anim.zoom_out_exit);
			}
		});
		
    }
}

  


其他見附件:

仿微信的開門效果


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。?!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美成人激情视频 | 奇米影视第七色 | 日韩中文在线观看 | 国产一卡2卡三卡4卡免费网站 | 国产精品久久久久无码av | 久久精品23 | 99久久精品日本一区二区免费 | 日本娇小videos高潮 | 先锋资源久久 | 亚洲视频在线视频 | 日韩午夜三级 | 国产精品色综合 | 99色这里只有精品 | 日韩h片在线观看 | 久久亚洲精品中文字幕 | 精品国产三级在线观看 | 欧美成人精品一区二区三区 | 犬夜叉在线观看 | 日日摸夜夜添夜夜添aa | 国产亚洲精品久久久久久无码网站 | 欧美日韩精品一区 | 欧美一级二级三级视频 | 久久久精 | 久爱www成人网免费视频 | 亚洲美女亚洲精品久久久久 | a久久| 亚洲精品欧美一区二区三区 | 欧美成人一级片 | 午夜免费视频 | 亚洲成年人免费网站 | 欧美国产精品一区 | 99热这里只有精品久久免费 | 人妻熟女久久久久久久 | 欧美精品在线观看 | 91久久 | 日韩久久一级毛片 | 一区二区三区日韩视频在线观看 | 欧美日韩亚洲一区二区三区在线观看 | 噜噜噜噜精品视频在线观看 | 精品久久久久久 | 日本精品在线 |