登录
首页 » Java » indicator android tab切换例子源码(支持Fragment)

indicator android tab切换例子源码(支持Fragment)

于 2015-04-22 发布
0 123
下载积分: 1 下载次数: 0

代码说明:

indicator android tab切换例子源码(支持Fragment)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • android activity 切换效果例子
    android activity 切换效果例子
    2015-06-17下载
    积分:1
  • android 串口编程 实例源码下载
    android 串口编程 实例源码下载
    2013-11-28下载
    积分:1
  • UCI数据集
    UCI数据集
    2020-12-02下载
    积分:1
  • android 解锁例子源码
    package com.codeshogun.android.swipesample;import android.app.Activity;import android.os.Bundle;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.View;import android.view.GestureDetector.SimpleOnGestureListener;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.ViewFlipper;public class Main extends Activity { private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; private static final int SWIPE_THRESHOLD_VELOCITY = 200; private GestureDetector gestureDetector; View.OnTouchListener gestureListener; private Animation slideLeftIn; private Animation slideLeftOut; private Animation slideRightIn; private Animation slideRightOut; private ViewFlipper viewFlipper; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); viewFlipper = (ViewFlipper)findViewById(R.id.flipper); slideLeftIn = AnimationUtils.loadAnimation(this, R.anim.slide_left_in); slideLeftOut = AnimationUtils.loadAnimation(this, R.anim.slide_left_out); slideRightIn = AnimationUtils.loadAnimation(this, R.anim.slide_right_in); slideRightOut = AnimationUtils.loadAnimation(this, R.anim.slide_right_out); gestureDetector = new GestureDetector(new MyGestureDetector()); gestureListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (gestureDetector.onTouchEvent(event)) { return true; } return false; } }; } class MyGestureDetector extends SimpleOnGestureListener { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { try { if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) return false; // right to left swipe if(e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { viewFlipper.setInAnimation(slideLeftIn); viewFlipper.setOutAnimation(slideLeftOut); viewFlipper.showNext(); } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { viewFlipper.setInAnimation(slideRightIn); viewFlipper.setOutAnimation(slideRightOut); viewFlipper.showPrevious(); } } catch (Exception e) { // nothing } return false; } } @Override public boolean onTouchEvent(MotionEvent event) { if (gestureDetector.onTouchEvent(event)) return true; else return false; }}
    2014-04-16下载
    积分:1
  • android 高仿网易新闻客户端主界面UI效果 示例源码(侧滑SlidingMenu+ViewPager+Fragment)
    android 高仿网易新闻客户端主界面UI效果 示例源码(侧滑SlidingMenu+ViewPager+Fragment)
    2013-10-23下载
    积分:1
  • Android中 日期控件 DatePicker和TimePicker入门例子 附完整源码以及截图
    实现了:当更改DatePicker和TimePicker的时候 自动更改EditText的值
    2013-03-20下载
    积分:1
  • android视频录制(支持闪光灯以及前置后置摄像头拍摄) 实例源码下载
    支持闪光灯、前置、后置摄像头拍摄,有预览功能,非常不错
    2015-03-06下载
    积分:1
  • Android Launcher 源码修改可编译 例子源码
    Android Launcher 源码修改可编译 例子源码
    2014-10-10下载
    积分:1
  • android 仿qq侧滑菜单 实例源码下载
    仿照qq 5.0 侧滑效果,很棒
    2015-01-28下载
    积分:1
  • android notification 通知示例源码下载
    android notification 通知示例源码下载
    2014-02-16下载
    积分:1
  • 696518资源总数
  • 104269会员总数
  • 42今日下载