Codota Logo
YViewPager.getCurrentItem
Code IndexAdd Codota to your IDE (free)

How to use
getCurrentItem
method
in
cn.youngkaaa.yviewpager.YViewPager

Best Java code snippets using cn.youngkaaa.yviewpager.YViewPager.getCurrentItem (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: open-android/ViewPager

@Override
public void onPageSelected(int position) {
  setIndicator(position%mImageViews.size());
  Log.d(TAG,"POSITION=====>"+mYViewPager.getCurrentItem());
}
origin: open-android/ViewPager

private void recomputeScrollPositionHorizontal(int width, int oldWidth, int margin, int oldMargin) {
  if (oldWidth > 0 && !mItems.isEmpty()) {
    if (!mScroller.isFinished()) {
      mScroller.setFinalX(getCurrentItem() * getClientWidth());
    } else {
      final int widthWithMargin = width - getPaddingLeft() - getPaddingRight() + margin;
      final int oldWidthWithMargin = oldWidth - getPaddingLeft() - getPaddingRight()
          + oldMargin;
      final int xpos = getScrollX();
      final float pageOffset = (float) xpos / oldWidthWithMargin;
      final int newOffsetPixels = (int) (pageOffset * widthWithMargin);
      scrollTo(newOffsetPixels, getScrollY());
    }
  } else {
    final YViewPager.ItemInfo ii = infoForPosition(mCurItem);
    final float scrollOffset = ii != null ? Math.min(ii.offset, mLastOffset) : 0;
    final int scrollPos =
        (int) (scrollOffset * (width - getPaddingLeft() - getPaddingRight()));
    if (scrollPos != getScrollX()) {
      completeScrollHorizontal(false);
      scrollTo(scrollPos, getScrollY());
    }
  }
}
origin: open-android/ViewPager

private void recomputeScrollPositionVertical(int height, int oldHeight, int margin, int oldMargin) {
  if (oldHeight > 0 && !mItems.isEmpty()) {
    if (!mScroller.isFinished()) {
      mScroller.setFinalY(getCurrentItem() * getClientHeight());
    } else {
      final int heightWithMargin = height - getPaddingTop() - getPaddingBottom() + margin;
      final int oldHeightWithMargin = oldHeight - getPaddingTop() - getPaddingBottom()
          + oldMargin;
      final int ypos = getScrollY();
      final float pageOffset = (float) ypos / oldHeightWithMargin;
      final int newOffsetPixels = (int) (pageOffset * heightWithMargin);
      scrollTo(getScrollX(), newOffsetPixels);
    }
  } else {
    final ItemInfo ii = infoForPosition(mCurItem);
    final float scrollOffset = ii != null ? Math.min(ii.offset, mLastOffset) : 0;
    final int scrollPos =
        (int) (scrollOffset * (height - getPaddingTop() - getPaddingBottom()));
    if (scrollPos != getScrollY()) {
      completeScrollVertical(false);
      scrollTo(getScrollX(), scrollPos);
    }
  }
}
cn.youngkaaa.yviewpagerYViewPagergetCurrentItem

Popular methods of YViewPager

  • setCurrentItem
    Set the currently selected page.
  • addNewItem
  • addOnPageChangeListener
  • addViewInLayout
  • arrowScroll
    Handle scrolling in response to a left or right arrow click.
  • calculatePageOffsetsHorizontal
  • calculatePageOffsetsVertical
  • canScrollHorizontal
    Tests scrollability within child views of v given a delta of dx.
  • canScrollHorizontally
    Check if this ViewPager can be scrolled horizontally in a certain direction.
  • canScrollVertical
    Tests scrollability within child views of v given a delta of dx.
  • checkLayoutParams
  • completeScrollHorizontal
  • checkLayoutParams,
  • completeScrollHorizontal,
  • completeScrollVertical,
  • dataSetChanged,
  • determineTargetPageHorizontal,
  • determineTargetPageVertical,
  • dispatchOnPageScrolled,
  • dispatchOnPageSelected,
  • dispatchOnScrollStateChanged

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • notifyDataSetChanged (ArrayAdapter)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now