当前位置: 首页>>代码示例>>Java>>正文


Java NestedScrollingChildHelper类代码示例

本文整理汇总了Java中android.support.v4.view.NestedScrollingChildHelper的典型用法代码示例。如果您正苦于以下问题:Java NestedScrollingChildHelper类的具体用法?Java NestedScrollingChildHelper怎么用?Java NestedScrollingChildHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NestedScrollingChildHelper类属于android.support.v4.view包,在下文中一共展示了NestedScrollingChildHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NestedScrollView

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public NestedScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    this.mTempRect = new Rect();
    this.mIsLayoutDirty = true;
    this.mIsLaidOut = false;
    this.mChildToScrollTo = null;
    this.mIsBeingDragged = false;
    this.mSmoothScrollingEnabled = true;
    this.mActivePointerId = -1;
    this.mScrollOffset = new int[2];
    this.mScrollConsumed = new int[2];
    initScrollView();
    TypedArray a = context.obtainStyledAttributes(attrs, SCROLLVIEW_STYLEABLE, defStyleAttr, 0);
    setFillViewport(a.getBoolean(0, false));
    a.recycle();
    this.mParentHelper = new NestedScrollingParentHelper(this);
    this.mChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
    ViewCompat.setAccessibilityDelegate(this, ACCESSIBILITY_DELEGATE);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:NestedScrollView.java

示例2: PullToRefreshView

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public PullToRefreshView(Context context, AttributeSet attrs) {
    super(context, attrs);
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RefreshView);
    final int type = a.getInteger(R.styleable.RefreshView_type, STYLE_SUN);
    a.recycle();

    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    mTotalDragDistance = Utils.convertDpToPixel(context, DRAG_MAX_DISTANCE);

    mRefreshView = new ImageView(context);

    setRefreshStyle(type);

    addView(mRefreshView);

    setWillNotDraw(false);
    ViewCompat.setChildrenDrawingOrderEnabled(this, true);

    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);

    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
}
 
开发者ID:dmytroKarataiev,项目名称:YalantisInternship,代码行数:25,代码来源:PullToRefreshView.java

示例3: init

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
private void init() {
    mPullHandler = new ProxyPullHeader(HEADER_FACTORY.made(getContext()));
    mIsPinContent = HEADER_FACTORY.isPinContent();
    if (mIsPinContent) {
        scrollerHelper = new PinContentScroller();
    } else {
        scrollerHelper = new AllScroller();
    }
    setWillNotDraw(false);
    addHeadView();
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();

    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);

    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
}
 
开发者ID:LuckyJayce,项目名称:CoolRefreshView,代码行数:19,代码来源:CoolRefreshView.java

示例4: StickyNavigationLayout

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public StickyNavigationLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
    //setOrientation(LinearLayout.VERTICAL);
    mGroupStickyDelegate = new GroupStickyDelegate();
    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);
    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);

    mScroller = new OverScroller(context);
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();//触摸阙值
    mMaximumVelocity = ViewConfiguration.get(context).getScaledMaximumFlingVelocity();
    mMinimumVelocity = ViewConfiguration.get(context).getScaledMinimumFlingVelocity();

    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.StickyNavigationLayout);
    // mCodeSet will set stick view from onFinishInflate.

    mTopViewId = a.getResourceId(R.styleable.StickyNavigationLayout_stickyLayout_top_id, 0);
    mIndicatorId = a.getResourceId(R.styleable.StickyNavigationLayout_stickyLayout_indicator_id, 0);
    mContentId = a.getResourceId(R.styleable.StickyNavigationLayout_stickyLayout_content_id, 0);

    mAutoFitScroll = a.getBoolean(R.styleable.StickyNavigationLayout_stickyLayout_auto_fit_scroll, false);
    a.recycle();

    //getWindowVisibleDisplayFrame(mExpectTopRect);
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:25,代码来源:StickyNavigationLayout_medlinker.java

示例5: StickyNavigationLayout_backup

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public StickyNavigationLayout_backup(Context context, AttributeSet attrs) {
    super(context, attrs);
    //setOrientation(LinearLayout.VERTICAL);
    mGroupStickyDelegate = new GroupStickyDelegate();
    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);
    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);

    mScroller = new OverScroller(context);
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();//触摸阙值
    mMaximumVelocity = ViewConfiguration.get(context).getScaledMaximumFlingVelocity();
    mMinimumVelocity = ViewConfiguration.get(context).getScaledMinimumFlingVelocity();

    final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.StickyNavigationLayout);
    // mCodeSet will set stick view from onFinishInflate.

    if(!mCodeSet) {
        mTopViewId = a.getResourceId(R.styleable.StickyNavigationLayout_stickyLayout_top_id, 0);
        mIndicatorId = a.getResourceId(R.styleable.StickyNavigationLayout_stickyLayout_indicator_id, 0);
        mContentId = a.getResourceId(R.styleable.StickyNavigationLayout_stickyLayout_content_id, 0);
    }
    mAutoFitScroll = a.getBoolean(R.styleable.StickyNavigationLayout_stickyLayout_auto_fit_scroll, false);
    mAutoFitPercent = a.getFloat(R.styleable.StickyNavigationLayout_stickyLayout_threshold_percent, 0.5f);
    a.recycle();

    //getWindowVisibleDisplayFrame(mExpectTopRect);
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:27,代码来源:StickyNavigationLayout_backup.java

示例6: NestedScrollView

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public NestedScrollView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
  super(paramContext, paramAttributeSet, paramInt);
  setFocusable(true);
  setDescendantFocusability(262144);
  setWillNotDraw(false);
  ViewConfiguration localViewConfiguration = ViewConfiguration.get(getContext());
  this.mTouchSlop = localViewConfiguration.getScaledTouchSlop();
  this.mMinimumVelocity = localViewConfiguration.getScaledMinimumFlingVelocity();
  this.mMaximumVelocity = localViewConfiguration.getScaledMaximumFlingVelocity();
  TypedArray localTypedArray = paramContext.obtainStyledAttributes(paramAttributeSet, SCROLLVIEW_STYLEABLE, paramInt, 0);
  setFillViewport(localTypedArray.getBoolean(0, false));
  localTypedArray.recycle();
  this.mParentHelper = new NestedScrollingParentHelper(this);
  this.mChildHelper = new NestedScrollingChildHelper(this);
  setNestedScrollingEnabled(true);
  ViewCompat.setAccessibilityDelegate(this, ACCESSIBILITY_DELEGATE);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:19,代码来源:NestedScrollView.java

示例7: SwipeRefreshLayout

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public SwipeRefreshLayout(Context paramContext, AttributeSet paramAttributeSet)
{
  super(paramContext, paramAttributeSet);
  this.mTouchSlop = ViewConfiguration.get(paramContext).getScaledTouchSlop();
  this.mMediumAnimationDuration = getResources().getInteger(17694721);
  setWillNotDraw(false);
  this.mDecelerateInterpolator = new DecelerateInterpolator(2.0F);
  TypedArray localTypedArray = paramContext.obtainStyledAttributes(paramAttributeSet, LAYOUT_ATTRS);
  setEnabled(localTypedArray.getBoolean(0, true));
  localTypedArray.recycle();
  DisplayMetrics localDisplayMetrics = getResources().getDisplayMetrics();
  this.mCircleWidth = ((int)(40.0F * localDisplayMetrics.density));
  this.mCircleHeight = ((int)(40.0F * localDisplayMetrics.density));
  this.mCircleView = new CircleImageView(getContext());
  this.mProgress = new MaterialProgressDrawable(getContext(), this);
  this.mProgress.setBackgroundColor(-328966);
  this.mCircleView.setImageDrawable(this.mProgress);
  this.mCircleView.setVisibility(8);
  addView(this.mCircleView);
  ViewCompat.setChildrenDrawingOrderEnabled$4d3af60(this);
  this.mSpinnerFinalOffset = (64.0F * localDisplayMetrics.density);
  this.mTotalDragDistance = this.mSpinnerFinalOffset;
  this.mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);
  this.mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
  setNestedScrollingEnabled(true);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:27,代码来源:SwipeRefreshLayout.java

示例8: AbsRefreshLayout

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
/**
 */
@SuppressWarnings("deprecation")
public AbsRefreshLayout(View listView) {
    this(listView.getContext());
    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);

    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
    mTargetView = listView;
    ViewGroup group = (ViewGroup) mTargetView.getParent();
    if (group != null) {
        LayoutParams params = mTargetView.getLayoutParams();
        int index = group.indexOfChild(listView);
        group.removeView(listView);
        group.addView(this, index, params);
    }
    mTargetView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.MATCH_PARENT));
    super.addView(mTargetView);
}
 
开发者ID:anzewei,项目名称:NestRefreshLayout,代码行数:22,代码来源:AbsRefreshLayout.java

示例9: init

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
/**
 * @param context
 * @param attrs
 * @param defStyleAttr
 */
private void init(Context context, AttributeSet attrs, int defStyleAttr) {
    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);

    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
    mScroller = new Scroller(context, new DecelerateInterpolator());
    TypedArray a = context.obtainStyledAttributes(attrs,
            R.styleable.AbsRefreshLayout, defStyleAttr, 0);
    final int N = a.getIndexCount();
    int resFooter = R.layout.layout_loadmore;
    for (int i = 0; i < N; i++) {
        int attr = a.getIndex(i);
        if (attr == R.styleable.AbsRefreshLayout_footerNestLayout) {
            resFooter = a.getResourceId(attr, resFooter);
            break;
        }
    }
    a.recycle();
    /**
     * Convert values in dp to values in px;
     */
    setFooterView(inflate(context, resFooter, null));
}
 
开发者ID:anzewei,项目名称:NestRefreshLayout,代码行数:29,代码来源:AbsRefreshLayout.java

示例10: NestedScrollView

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public NestedScrollView(Context context, AttributeSet attributeset, int i)
{
    super(context, attributeset, i);
    mTempRect = new Rect();
    mIsLayoutDirty = true;
    mIsLaidOut = false;
    mChildToScrollTo = null;
    mIsBeingDragged = false;
    mSmoothScrollingEnabled = true;
    mActivePointerId = -1;
    mScrollOffset = new int[2];
    mScrollConsumed = new int[2];
    initScrollView();
    context = context.obtainStyledAttributes(attributeset, SCROLLVIEW_STYLEABLE, i, 0);
    setFillViewport(context.getBoolean(0, false));
    context.recycle();
    mParentHelper = new NestedScrollingParentHelper(this);
    mChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
    ViewCompat.setAccessibilityDelegate(this, ACCESSIBILITY_DELEGATE);
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:22,代码来源:NestedScrollView.java

示例11: TwinklingRefreshLayout

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public TwinklingRefreshLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TwinklingRefreshLayout, defStyleAttr, 0);
    try {
        mMaxHeadHeight = a.getDimensionPixelSize(R.styleable.TwinklingRefreshLayout_tr_max_head_height, (int) DensityUtil.dp2px(context, 120));
        mHeadHeight = a.getDimensionPixelSize(R.styleable.TwinklingRefreshLayout_tr_head_height, (int) DensityUtil.dp2px(context, 80));
        mMaxBottomHeight = a.getDimensionPixelSize(R.styleable.TwinklingRefreshLayout_tr_max_bottom_height, (int) DensityUtil.dp2px(context, 120));
        mBottomHeight = a.getDimensionPixelSize(R.styleable.TwinklingRefreshLayout_tr_bottom_height, (int) DensityUtil.dp2px(context, 60));
        mOverScrollHeight = a.getDimensionPixelSize(R.styleable.TwinklingRefreshLayout_tr_overscroll_height, (int) mHeadHeight);
        enableRefresh = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_enable_refresh, true);
        enableLoadmore = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_enable_loadmore, true);
        isPureScrollModeOn = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_pureScrollMode_on, false);
        isOverScrollTopShow = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_overscroll_top_show, true);
        isOverScrollBottomShow = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_overscroll_bottom_show, true);
        enableOverScroll = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_enable_overscroll, true);
        floatRefresh = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_floatRefresh, false);
        autoLoadMore = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_autoLoadMore, false);
        enableKeepIView = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_enable_keepIView, true);
        showRefreshingWhenOverScroll = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_showRefreshingWhenOverScroll, true);
        showLoadingWhenOverScroll = a.getBoolean(R.styleable.TwinklingRefreshLayout_tr_showLoadingWhenOverScroll, true);
    } finally {
        a.recycle();
    }

    cp = new CoContext();

    addHeader();
    addFooter();

    setFloatRefresh(floatRefresh);
    setAutoLoadMore(autoLoadMore);
    setEnableRefresh(enableRefresh);
    setEnableLoadmore(enableLoadmore);

    mChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:39,代码来源:TwinklingRefreshLayout.java

示例12: init

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
private void init() {
  setWillNotDraw(false);
  startScrollerTask();
  setOverScrollMode(View.OVER_SCROLL_NEVER);
  childHelper = new NestedScrollingChildHelper(this);
  childHelper.setNestedScrollingEnabled(true);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:WXScrollView.java

示例13: ISwipeRefreshLayout

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
/**
 * Constructor that is called when inflating ISwipeRefreshLayout from XML.
 *
 * @param context
 * @param attrs
 */
public ISwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(
            android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);

    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mRefreshViewHeight = (int) (DEFAULT_HEADER_HEIGHT * metrics.density);
    HEADER_VIEW_MIN_HEIGHT = mRefreshViewHeight;
    ViewCompat.setChildrenDrawingOrderEnabled(this, true);
    mTotalDragDistance = (int) (DEFAULT_HEADER_TARGET * metrics.density);
    mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);

    mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();

    //add default refreshview
    setRefreshHeaderView(new ClassicIRefreshHeaderView(getContext()));
}
 
开发者ID:yangjiantao,项目名称:AndroidUiKit,代码行数:35,代码来源:ISwipeRefreshLayout.java

示例14: NestedWebView

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
public NestedWebView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    setOverScrollMode(WebView.OVER_SCROLL_NEVER);
    initScrollView();
    mChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:8,代码来源:NestedWebView.java

示例15: i

import android.support.v4.view.NestedScrollingChildHelper; //导入依赖的package包/类
private void i() {
    helper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);
    // Add a dummy view that will receive inner touch events.
    View dummyView = new View(getContext());
    dummyBehavior = new DummyBehavior();
    // I *think* this is needed for dummyView to be identified as "topmost" and receive events
    // before any other view.
    ViewCompat.setElevation(dummyView, ViewCompat.getElevation(this));
    // Make sure it does not fit windows, or it will consume insets before the AppBarLayout.
    ViewCompat.setFitsSystemWindows(dummyView, false);
    LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    params.setBehavior(dummyBehavior);
    addView(dummyView, params);
}
 
开发者ID:natario1,项目名称:NestedScrollCoordinatorLayout,代码行数:16,代码来源:NestedScrollCoordinatorLayout.java


注:本文中的android.support.v4.view.NestedScrollingChildHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。