项目:Bridge
文件:ResolverDrawerLayout.java
public ResolverDrawerLayout(Context context,AttributeSet attrs,int defStyleAttr) {
super(context,attrs,defStyleAttr);
final TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.ResolverDrawerLayout,defStyleAttr,0);
mMaxWidth = a.getDimensionPixelSize(R.styleable.ResolverDrawerLayout_android_maxWidth,-1);
mMaxCollapsedHeight = a.getDimensionPixelSize(
R.styleable.ResolverDrawerLayout_maxCollapsedHeight,0);
mMaxCollapsedHeightSmall = a.getDimensionPixelSize(
R.styleable.ResolverDrawerLayout_maxCollapsedHeightSmall,mMaxCollapsedHeight);
a.recycle();
mScrollIndicatorDrawable = context.getDrawable(R.drawable.scroll_indicator_material);
mScroller = new OverScroller(context,AnimationUtils.loadInterpolator(context,android.R.interpolator.decelerate_quint));
mVeLocityTracker = VeLocityTracker.obtain();
final ViewConfiguration vc = ViewConfiguration.get(context);
mTouchSlop = vc.getScaledTouchSlop();
mMinFlingVeLocity = vc.getScaledMinimumFlingVeLocity();
setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
项目:PageScrollView
文件:PageScrollView.java
@Override
public void computeScroll() {
boolean scrollerWorkNow = SCROLL_STATE_SETTLING == mScrollState;
OverScroller scroller = scrollerWorkNow ? getScroller() : null;
if (scroller != null && scroller.computeScrollOffset()) {
int oldX = getScrollX();
int oldY = getScrollY();
int x = scroller.getCurrX();
int y = scroller.getCurrY();
if (oldX != x || oldY != y) {
scrollTo(x,y);
}
ViewCompat.postInvalidateOnAnimation(this);
} else {
if (scrollerWorkNow) {
markAsWillIdle();
}
}
}
项目:Hitalk
文件:SpringView.java
public SpringView(Context context,AttributeSet attrs) {
super(context,attrs);
this.context = context;
inflater = LayoutInflater.from(context);
mScroller = new OverScroller(context);
//获取自定义属性
TypedArray ta = context.obtainStyledAttributes(attrs,R.styleable.SpringView);
if (ta.hasValue(R.styleable.SpringView_type)){
int type_int = ta.getInt(R.styleable.SpringView_type,0);
type = Type.values()[type_int];
}
if (ta.hasValue(R.styleable.SpringView_give)){
int give_int = ta.getInt(R.styleable.SpringView_give,0);
give = Give.values()[give_int];
}
if (ta.hasValue(R.styleable.SpringView_header)){
headerResoureId = ta.getResourceId(R.styleable.SpringView_header,0);
}
if (ta.hasValue(R.styleable.SpringView_footer)){
footerResoureId = ta.getResourceId(R.styleable.SpringView_footer,0);
}
ta.recycle();
}
项目:Hitalk
文件:OverScrollLayout.java
private void init() {
configuration = ViewConfiguration.get(getContext());
mScroller = new Scroller(getContext(),new OvershootInterpolator(0.75f));
flingRunnable = new FlingRunnable();
overScrollRunnable = new OverScrollRunnable();
flingScroller = new OverScroller(getContext());
detector = new GestureDetector(getContext(),new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onFling(MotionEvent e1,MotionEvent e2,float veLocityX,float veLocityY) {
if (isOverScrollTop || isOverScrollBottom || isOverScrollLeft || isOverScrollRight) {
return false;
}
//
flingRunnable.start(veLocityX,veLocityY);
return false;
}
});
}
项目:WLLayout
文件:WLLayout.java
private void reflectAbsListView() {
try {
Class<?> absListViewCls = Class.forName("android.widget.AbsListView");
Field mFlingRunnableField = absListViewCls.getDeclaredField("mFlingRunnable");
mFlingRunnableField.setAccessible(true);
Object mFlingRunnable = mFlingRunnableField.get(mListView);
Class<?> flingRunnableCls = Class.forName("android.widget.AbsListView$FlingRunnable");
Field mScrollerFeild = flingRunnableCls.getDeclaredField("mScroller");
mScrollerFeild.setAccessible(true);
mScrollerReflectd = (OverScroller) mScrollerFeild.get(mFlingRunnable);
} catch (Exception e) {
mScrollerReflectd = null;
Log.d(TAG,"###Exception Stack###",new Throwable(e));
}
}
项目:RLibrary
文件:RRecyclerView.java
/**
* 滚动结束后时的速率
*/
public float getLastVeLocity() {
Object mViewFlinger = Reflect.getMember(RecyclerView.class,this,"mViewFlinger");
Object mScroller = Reflect.getMember(mViewFlinger,"mScroller");
float currVeLocity = 0f;
if (mScroller instanceof OverScroller) {
currVeLocity = ((OverScroller) mScroller).getCurrVeLocity();
} else if (mScroller instanceof ScrollerCompat) {
currVeLocity = ((ScrollerCompat) mScroller).getCurrVeLocity();
} else {
throw new IllegalArgumentException("未兼容的mScroller类型:" + mScroller.getClass().getSimpleName());
}
if (Float.isNaN(currVeLocity)) {
currVeLocity = mLastVeLocity;
} else {
mLastVeLocity = currVeLocity;
}
return currVeLocity;
}
项目:UiLib
文件:SwipeMenuLayout.java
public SwipeMenuLayout(Context context,int defStyle) {
super(context,defStyle);
TypedArray typedArray = context.obtainStyledAttributes(attrs,R.styleable.SwipeMenuLayout);
mLeftViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_leftViewId,mLeftViewId);
mContentViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_contentViewId,mContentViewId);
mRightViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_rightViewId,mRightViewId);
typedArray.recycle();
ViewConfiguration configuration = ViewConfiguration.get(getContext());
mScaledTouchSlop = configuration.getScaledTouchSlop();
mScaledMinimumFlingVeLocity = configuration.getScaledMinimumFlingVeLocity();
mScaledMaximumFlingVeLocity = configuration.getScaledMaximumFlingVeLocity();
mScroller = new OverScroller(getContext());
}
项目:OpenWithX
文件:ResolverDrawerLayout.java
public ResolverDrawerLayout(Context context,android.R.interpolator.decelerate_quint));
mVeLocityTracker = VeLocityTracker.obtain();
final ViewConfiguration vc = ViewConfiguration.get(context);
mTouchSlop = vc.getScaledTouchSlop();
mMinFlingVeLocity = vc.getScaledMinimumFlingVeLocity();
setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
项目:RLibrary
文件:StickLayout2.java
private void initLayout() {
mOverScroller = new OverScroller(getContext());
mGestureDetectorCompat = new GestureDetectorCompat(getContext(),new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onFling(MotionEvent e1,final float veLocityY) {
if (Math.abs(veLocityX) > Math.abs(veLocityY)) {
return false;
}
if (isFloat() /*&& veLocityY < 0*/) {
return false;
}
fling(veLocityY);
return true;
}
});
}
项目:GitHub
文件:BGAStickyNavLayout.java
private void init(Context context) {
setorientation(VERTICAL);
mOverScroller = new OverScroller(context);
final ViewConfiguration configuration = ViewConfiguration.get(context);
mTouchSlop = configuration.getScaledTouchSlop();
mMaximumVeLocity = configuration.getScaledMaximumFlingVeLocity();
mMinimumVeLocity = configuration.getScaledMinimumFlingVeLocity();
}
项目:Bailan
文件:PullToRefreshView.java
public PullToRefreshView(Context context,attrs);
mInflater = LayoutInflater.from(context);
mScroller = new OverScroller(context);
//获取自定义属性
TypedArray ta = context.obtainStyledAttributes(attrs,R.styleable.PullToRefresh);
if (ta.hasValue(R.styleable.PullToRefresh_header_indicator)) {
mHeaderIndicatorClassName = ta.getString(R.styleable.PullToRefresh_header_indicator);
}
if (ta.hasValue(R.styleable.PullToRefresh_footer_indicator)) {
mFooterIndicatorClassName = ta.getString(R.styleable.PullToRefresh_footer_indicator);
}
ta.recycle();
}
项目:yphoto
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:TestChat
文件:SwipeMenuLayout.java
public SwipeMenuLayout(Context context,int defStyle) {
super(context,defStyle);
TypedArray typedArray = context.obtainStyledAttributes(attrs,R.styleable.SwipeMenuLayout);
mLeftViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_leftViewId,mLeftViewId);
mContentViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_contentViewId,mContentViewId);
mRightViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_rightViewId,mRightViewId);
typedArray.recycle();
ViewConfiguration mViewConfig = ViewConfiguration.get(getContext());
mScaledTouchSlop = mViewConfig.getScaledTouchSlop();
mScroller = new OverScroller(getContext());
mScaledMinimumFlingVeLocity = mViewConfig.getScaledMinimumFlingVeLocity();
mScaledMaximumFlingVeLocity = mViewConfig.getScaledMaximumFlingVeLocity();
}
项目:Hitalk
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:AndroidbackendlessChat
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:xRecycleView
文件:XRefreshLayout.java
public XRefreshLayout(Context context,defStyle);
MIN_LOADING_LAYOUG_HEIGHT = DensityUtil.dip2px(context,MIN_LOADING_LAYOUG_HEIGHT);
OVERSCROLL_RANGE = DensityUtil.dip2px(context,OVERSCROLL_RANGE);
scroller = new OverScroller(getContext());
loadingLayout = new DefaultLoadingLayout();
}
项目:RLibrary
文件:RefreshLayout.java
protected void initRefreshView() {
mScroller = new OverScroller(getContext(),new DecelerateInterpolator());
if (isInEditMode()) {
return;
}
if (mTopView == null) {
mTopView = new BasePointRefreshView(getContext());
mTopView.setTag(TOP_VIEW);
}
if (mBottomView == null) {
mBottomView = new BasePointRefreshView(getContext());
mBottomView.setTag(TOP_VIEW);
}
if (mTipView == null) {
RTextView textView = new RTextView(getContext());
textView.setGravity(Gravity.CENTER);
textView.setTextColor(Color.WHITE);
textView.setRBackgroundColor(SkinHelper.getSkin().getThemeSubColor());
textView.setBackgroundResource(R.drawable.base_bg_selector);
textView.setText("测试专用...");
textView.setTag(TIP_VIEW);
int left = getResources().getDimensionPixelOffset(R.dimen.base_xhdpi);
int top = getResources().getDimensionPixelOffset(R.dimen.base_ldpi);
textView.setPadding(left,top,left,top);
mTipView = textView;
mTipView.setonClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
T_.show("Test");
}
});
}
}
项目:ImageMagnifier
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < 9) {
this.isPreGingerbread = true;
this.scroller = new Scroller(context);
return;
}
this.isPreGingerbread = false;
this.overScroller = new OverScroller(context);
}
项目:chat-sdk-android-push-firebase
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:event-me
文件:TouchImageView.java
public CompatScroller(Context context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:Monolith
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:Android_ImagePicker
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:social-app-android
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:CXJPadProject
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
}
else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:LueansRead
文件:TouchImageView.java
public CompatScroller(Context context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:BlogBookApp
文件:ZoomImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:PhotoPicker-master
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:JZAndroidChart
文件:OverScrollerCompat.java
/**
* @see android.view.ScaleGestureDetector#getCurrentSpanY()
*/
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static float getCurrVeLocity(OverScroller overScroller) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return overScroller.getCurrVeLocity();
} else {
return 0;
}
}
项目:Jiuchi
文件:JiuChi.java
private void init() {
mPaint = new Paint();
mPaint.setStyle(Paint.Style.FILL);
mScroller = new OverScroller(getContext());
mVeLocityTracker = VeLocityTracker.obtain();
maximumFlingVeLocity = ViewConfiguration.get(getContext()).getScaledMaximumFlingVeLocity();
minimumFlingVeLocity = ViewConfiguration.get(getContext()).getScaledMinimumFlingVeLocity();
}
项目:BooheeRuler
文件:InnerRuler.java
public void init(Context context){
mContext = context;
mMaxLength = mParent.getMaxScale() - mParent.getMinScale();
mCurrentScale = mParent.getCurrentScale();
mCount = mParent.getCount();
mDrawOffset = mCount * mParent.getInterval() / 2;
initPaints();
mOverScroller = new OverScroller(mContext);
// mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
//配置速度
mVeLocityTracker = VeLocityTracker.obtain();
mMaximumVeLocity = ViewConfiguration.get(context)
.getScaledMaximumFlingVeLocity();
mMinimumVeLocity = ViewConfiguration.get(context)
.getScaledMinimumFlingVeLocity();
initEdgeEffects();
//第一次进入,跳转到设定刻度
getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
getViewTreeObserver().removeOnGlobalLayoutListener(this);
goToScale(mCurrentScale);
}
});
checkAPILevel();
}
项目:spinify_android
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:Expert-Android-Programming
文件:TouchImageView.java
public CompatScroller(Context context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
public BooheeRulerView(Context context,defStyleAttr);
this.df = new DecimalFormat("#.##");
this.isActionUp = false;
this.isCancel = false;
this.f = true;
this.scroller = new OverScroller(context);
init(attrs);
}
public CompatScroller(Context context) {
if (VERSION.SDK_INT < 9) {
this.isPreGingerbread = true;
this.scroller = new Scroller(context);
return;
}
this.isPreGingerbread = false;
this.overScroller = new OverScroller(context);
}
项目:Programmers
文件:TouchImageView.java
public CompatScroller(Context context) {
if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
isPreGingerbread = true;
scroller = new Scroller(context);
} else {
isPreGingerbread = false;
overScroller = new OverScroller(context);
}
}
项目:ClouldReader
文件:GingerScroller.java
public GingerScroller(Context context) {
mScroller = new OverScroller(context);
}
项目:AndroidOpen
文件:DropDownLinearLayout.java
protected void initView(Context context) {
fScroller = new OverScroller(context);
this.setoverScrollMode(OVER_SCROLL_ALWAYS);
}
项目:GitHub
文件:FreeFlowContainer.java
@Override
protected void init(Context context) {
viewpool = new ViewPool();
frames = new LinkedHashMap<Object,FreeFlowItem>();
ViewConfiguration configuration = ViewConfiguration.get(context);
maxFlingVeLocity = configuration.getScaledMaximumFlingVeLocity();
minFlingVeLocity = configuration.getScaledMinimumFlingVeLocity();
overflingdistance = configuration.getScaledOverflingdistance();
/*overscrolldistance = configuration.getScaledOverscrolldistance();*/
touchSlop = configuration.getScaledTouchSlop();
scroller = new OverScroller(context);
setEdgeEffectsEnabled(true);
}
项目:GitHub
文件:ScrollerProxy.java
public GingerScroller(Context context) {
mScroller = new OverScroller(context);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。