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


Java ViewPager.SCROLL_STATE_IDLE属性代码示例

本文整理汇总了Java中android.support.v4.view.ViewPager.SCROLL_STATE_IDLE属性的典型用法代码示例。如果您正苦于以下问题:Java ViewPager.SCROLL_STATE_IDLE属性的具体用法?Java ViewPager.SCROLL_STATE_IDLE怎么用?Java ViewPager.SCROLL_STATE_IDLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.v4.view.ViewPager的用法示例。


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

示例1: playAnimation

private void playAnimation() {
    if (mViewPagerState == ViewPager.SCROLL_STATE_IDLE) {
        Observable.timer(500, TimeUnit.MILLISECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Consumer<Long>() {
                    @Override
                    public void accept(Long aLong) throws Exception {
                        if (mViewPagerState == ViewPager.SCROLL_STATE_IDLE) {
                            if (((float) mAnimator.getAnimatedValue()) == END_VALUE) {

                                startEnd2StartAnimation();
                            }
                        }
                    }
                });
    }
}
 
开发者ID:piyell,项目名称:NeteaseCloudMusic,代码行数:17,代码来源:DiscPageChanger.java

示例2: onPageSelected

@Override
  public void onPageSelected(int position) {
      for (int i = 0; i < mTabViews.size(); i++) {
      	if(i == position){
      		((TextView)mTabViews.get(i)).setTextColor(mSelectedTabColor);
      	}else{
      		((TextView)mTabViews.get(i)).setTextColor(mTabViewDefaultColor);
      	}
}
      
      if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
          mCurrentPage = position;
          mPositionOffset = 0;
          invalidate();
          mFadeRunnable.run();
      }
      if (mListener != null) {
          mListener.onPageSelected(position);
      }
  }
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:20,代码来源:UnderlinePageIndicator.java

示例3: setCurrentItem

@Override
public void setCurrentItem(int item, boolean anim) {
    int count = fixedIndicatorView.getCount();
    if (count == 0) {
        return;
    }
    if (item < 0) {
        item = 0;
    } else if (item > count - 1) {
        item = count - 1;
    }
    unScrollPosition = -1;
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        if (anim) {
            animateToTab(item);
        } else {
            final View tabView = fixedIndicatorView.getChildAt(item);
            final int scrollPos = tabView.getLeft() - (getWidth() - tabView.getWidth()) / 2;
            scrollTo(scrollPos, 0);
            unScrollPosition = item;
        }
    } else {

    }
    fixedIndicatorView.setCurrentItem(item, anim);
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:26,代码来源:ScrollIndicatorView.java

示例4: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        int current = mViewPager.getCurrentItem();
        int lastReal = mViewPager.getAdapter().getCount() - 2;
        if (current == 0) {
            mViewPager.setCurrentItem(lastReal, false);
        } else if (current == lastReal + 1) {
            mViewPager.setCurrentItem(1, false);
        }
    }
}
 
开发者ID:Jay-Ping,项目名称:newIPlay,代码行数:12,代码来源:FlyBanner1.java

示例5: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
  if (state == ViewPager.SCROLL_STATE_IDLE) {
    scrollToChild(pager.getCurrentItem(), 0);
  }

  if (delegatePageListener != null) {
    delegatePageListener.onPageScrollStateChanged(state);
  }
}
 
开发者ID:nordfalk,项目名称:EsperantoRadio,代码行数:10,代码来源:PagerSlidingTabStrip.java

示例6: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
	if (state == ViewPager.SCROLL_STATE_IDLE) {
		scrollToChild(pager.getCurrentItem(), 0);
	}

	if (delegatePageListener != null) {
		delegatePageListener.onPageScrollStateChanged(state);
	}
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:10,代码来源:PagerSlidingTabStrip.java

示例7: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mCurrentPage = position;
        invalidate();
    }

    if (mListener != null) {
        mListener.onPageSelected(position);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:TitlePageIndicator.java

示例8: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        updateFolderHSVIndicator(folderStateManagers.get(pager.getCurrentItem()));
        updateSize();
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:7,代码来源:FolderPickerDialogHelper.java

示例9: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mTabStrip.onViewPagerPageChanged(position, 0f);
        scrollToTab(position, 0);
    }
    for (int i = 0; i < mTabStrip.getChildCount(); i++) {
        mTabStrip.getChildAt(i).setSelected(position == i);
    }
    if (mViewPagerPageChangeListener != null) {
        mViewPagerPageChangeListener.onPageSelected(position);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:SlidingTabLayout.java

示例10: callPageScrollStateChanged

public void callPageScrollStateChanged(int state, int viewPageItem) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        if (viewPageItem != mCurrentPosition) {
            mCurrentPosition = viewPageItem;
            mCurrentPositionOffset = 0;
        }
        scrollToChild(viewPageItem, 0, false);
    }
}
 
开发者ID:rexyren,项目名称:PageScrollView,代码行数:9,代码来源:PageScrollTab.java

示例11: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mCurrentPage = position;
        mPositionOffset = 0;
        invalidate();
        mFadeRunnable.run();
    }
    if (mListener != null) {
        mListener.onPageSelected(position);
    }
}
 
开发者ID:fikyair,项目名称:musicplayer,代码行数:12,代码来源:UnderlinePageIndicator.java

示例12: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(final int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {//固定状态
        mViewPagerState = state;
        playAnimation();
    } else {//正在滚动
        mViewPagerState = state;
        playAfterEndAnimation = false;
        if (((float) mAnimator.getAnimatedValue()) != END_VALUE) {
            startStart2EndAnimation();
        }
    }
}
 
开发者ID:piyell,项目名称:NeteaseCloudMusic,代码行数:13,代码来源:DiscPageChanger.java

示例13: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mSnap || mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mCurrentPage = position;
        mSnapPage = position;
        invalidate();
    }

    if (mListener != null) {
        mListener.onPageSelected(position);
    }
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:12,代码来源:CirclePageIndicator.java

示例14: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        isDragging = false;
    } else {
        isDragging = true;
    }
}
 
开发者ID:wzc25151,项目名称:lrs_android,代码行数:8,代码来源:AutoScrollViewPager.java

示例15: onPageSelected

@Override
public void onPageSelected(int position) {
  if (scrollState == ViewPager.SCROLL_STATE_IDLE) {
    tabStrip.onViewPagerPageChanged(position, 0f);
    scrollToTab(position, 0);
  }

  for (int i = 0, size = tabStrip.getChildCount(); i < size; i++) {
    tabStrip.getChildAt(i).setSelected(position == i);
  }

  if (viewPagerPageChangeListener != null) {
    viewPagerPageChangeListener.onPageSelected(position);
  }
}
 
开发者ID:huashengzzz,项目名称:SmartChart,代码行数:15,代码来源:SmartTabLayout.java


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