Codota Logo
ViewPager.getWidth
Code IndexAdd Codota to your IDE (free)

How to use
getWidth
method
in
androidx.viewpager.widget.ViewPager

Best Java code snippets using androidx.viewpager.widget.ViewPager.getWidth (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: alexvasilkov/GestureViews

private int computeInitialViewPagerScroll(MotionEvent downEvent) {
  // ViewPager can be in intermediate position, we should compute correct initial scroll
  int scroll = viewPager.getScrollX();
  int pageWidth = viewPager.getWidth() + viewPager.getPageMargin();
  // After state restore ViewPager can return negative scroll, let's fix it
  while (scroll < 0) {
    scroll += pageWidth;
  }
  int touchedItem = (int) ((scroll + downEvent.getX()) / pageWidth);
  return pageWidth * touchedItem - scroll;
}
origin: morogoku/MTweaks-KernelAdiutorMOD

  @Override
  public void run() {
    Activity activity = fragment.getActivity();
    if (fragment.isAdded() && activity != null) {
      fragment.mRecyclerView.startAnimation(AnimationUtils.loadAnimation(
          activity, R.anim.slide_in_bottom));
      int cx = fragment.mViewPager.getWidth();
      SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
          fragment.mViewPager, cx / 2, 0, 0, cx);
      animator.addListener(new SupportAnimator.SimpleAnimatorListener() {
        @Override
        public void onAnimationStart() {
          super.onAnimationStart();
          fragment.mViewPager.setVisibility(View.VISIBLE);
        }
        @Override
        public void onAnimationEnd() {
          super.onAnimationEnd();
          fragment.mViewPagerShadow.setVisibility(View.VISIBLE);
        }
      });
      animator.setDuration(400);
      animator.start();
    }
  }
});
androidx.viewpager.widgetViewPagergetWidth

Popular methods of ViewPager

  • setAdapter
  • addOnPageChangeListener
  • setCurrentItem
  • getCurrentItem
  • getAdapter
  • setOffscreenPageLimit
  • onInterceptTouchEvent
  • onTouchEvent
  • removeOnPageChangeListener
  • setVisibility
  • dispatchTouchEvent
  • setOnPageChangeListener
  • dispatchTouchEvent,
  • setOnPageChangeListener,
  • setPageMargin,
  • addOnAdapterChangeListener,
  • beginFakeDrag,
  • endFakeDrag,
  • getLayoutParams,
  • getResources,
  • isFakeDragging

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • JFrame (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
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