資源簡介
DayMatterByGenng
倒數日安卓項目

代碼片段和文件信息
package?cn.jian.daymatter.view;
import?android.content.Context;
import?android.graphics.Rect;
import?android.util.AttributeSet;
import?android.view.MotionEvent;
import?android.view.VelocityTracker;
import?android.view.View;
import?android.view.ViewConfiguration;
import?android.view.ViewGroup;
import?android.widget.Scroller;
public?class?LeftSliderLayout?extends?ViewGroup?{
????private?Scroller?mScroller;
????private?VelocityTracker?mVelocityTracker;
????/**
?????*?Constant?value?for?touch?state
?????*?TOUCH_STATE_REST?:?no?touch
?????*?TOUCH_STATE_SCROLLING?:?scrolling
?????*/
????private?static?final?int?TOUCH_STATE_REST?=?0;
????private?static?final?int?TOUCH_STATE_SCROLLING?=?1;
????private?int?mTouchState?=?TOUCH_STATE_REST;
????
????/**
?????*?Distance?in?pixels?a?touch?can?wander?before?we?think?the?user?is?scrolling
?????*/
????private?int?mTouchSlop;
????
????/**
?????*?Values?for?saving?axis?of?the?last?touch?event.
?????*/
????private?float?mLastMotionX;
????private?float?mLastMotionY;
????
????/**
?????*?Values?for?VelocityTracker?to?compute?current?velocity.
?????*?VELOCITY_UNITS?in?dp
?????*?mVelocityUnits?in?px
?????*/
????private?static?final?int?VELOCITY_UNITS?=?1000;
????private?int?mVelocityUnits;??
????
????/**
?????*?The?minimum?velocity?for?determining?the?direction.
?????*?MINOR_VELOCITY?in?dp
?????*?mMinorVelocity?in?px
?????*/
????private?static?final?float?MINOR_VELOCITY?=?150.0f;
????private?int?mMinorVelocity;
????
????/**
?????*?The?width?of?Sliding?distance?from?left.?
?????*?And?it?should?be?the?same?with?the?width?of?the?View?below?SliderLayout?in?a?frameLayout.
?????*?DOCK_WIDTH?in?dp
?????*?mDockWidth?in?px
?????*/
????private?static?final?float?SLIDING_WIDTH?=?240.0f;
????private?int?mSlidingWidth;
????
????/**
?????*?The?default?values?of?shadow.
?????*?VELOCITY_UNITS?in?dp
?????*?mVelocityUnits?in?px
?????*/
????private?static?final?float?DEF_SHADOW_WIDTH?=?10.0f;
????private?int?mDefShadowWidth;
????/**
?????*?Value?for?checking?a?touch?event?is?completed.
?????*/
????private?boolean?mIsTouchEventDone?=?false;
????
????/**
?????*?Value?for?checking?slider?is?open.
?????*/
????private?boolean?mIsOpen?=?false;
????
????/**
?????*?Value?for?saving?the?last?offset?of?scroller?’?x-axis.
?????*/
????private?int?mSaveScrollX?=?0;
????
????/**
?????*?Value?for?checking?slider?is?allowed?to?slide.
?????*/
????private?boolean?mEnableSlide?=?true;
????
????private?View?mMainChild?=?null;
????private?OnLeftSliderLayoutStateListener?mListener?=?null;
/**
?*?Instantiates?a?new?LeftSliderLayout.
?*
?*?@param?context?the?associated?Context
?*?@param?attrs?AttributeSet
?*/
????public?LeftSliderLayout(Context?context?AttributeSet?attrs)?{
???? this(context?attrs?0);
????}
/**
?*?Instantiates?a?new?LeftSliderLayout.
?*
?*?@param?context?the?associated?Context
?*?@param?attrs?AttributeSet
?*?@param?defstyle?style
?*/
????public?LeftSliderLayout(Context?con
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-08-12?01:50??DayMatterByGenng-master\
?????文件?????????231??2014-08-12?01:50??DayMatterByGenng-master\.gitignore
?????文件???????13247??2014-08-12?01:50??DayMatterByGenng-master\LeftSliderLayout.java
?????文件????????1397??2014-08-12?01:50??DayMatterByGenng-master\LeftSliderLayout說明.txt
?????文件??????????57??2014-08-12?01:50??DayMatterByGenng-master\README.md
- 上一篇:Java畫圖程序源碼.rar
- 下一篇:Android代碼-安卓記事本app
評論
共有 條評論