WEB开发网
开发学院手机开发Android 开发 Android 抽屉式Activity 阅读

Android 抽屉式Activity

 2012-07-17 14:06:29 来源:WEB开发网   
核心提示: @Override public void onAnimationEnd( Animation animation) {finish();overridePendingTransition(0, 0); }}); } public void open() {mCover.startAnimation(mStartAn
   @Override
   public void onAnimationEnd(
    Animation animation) {
   finish();
   overridePendingTransition(
    0, 0);
   }
  });
 }
 public void open() {
 mCover.startAnimation(mStartAnimation);
 }
 public void close() {
 mCover.startAnimation(mStopAnimation);
 }
 @Override
 public boolean onKeyDown(
  int keyCode, KeyEvent event) {
 // 摁返回键时也要触发动画
 if (keyCode == KeyEvent.KEYCODE_BACK) {
  close();
  return true;
 }
 return super.onKeyDown(keyCode,
  event);
 }
}
-----------------------项目.AVTIVITY
package slidre.co.cc;
import cn.mapplayer.engine.MiidiCredit;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
public class SliderActivity extends
 Activity {
 @Override
 protected void onCreate(
  Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 
 setContentView(R.layout.sample);
 findViewById(R.id.sample_button)
  .setOnClickListener(
   new OnClickListener() {
    @Override
    public void onClick(
     View v) {
    SettingActivity
     .prepare(
      SliderActivity.this,
      R.id.inner_content);
    startActivity(new Intent(
     SliderActivity.this,
     SettingActivity.class));
    overridePendingTransition(
     0,
     0);
    }
   });
 }
}

上一页  2 3 4 5 6 7 

Tags:Android 抽屉式 Activity

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接