Guest User

Untitled

a guest
Jun 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. package com.google.androidstudio.motionlayoutexample.utils
  2.  
  3. import android.content.Context
  4. import android.support.constraint.motion.MotionLayout
  5. import android.support.v4.view.ViewPager
  6. import android.util.AttributeSet
  7.  
  8. class ViewpagerHeader @JvmOverloads constructor(
  9. context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
  10. ) : MotionLayout(context, attrs, defStyleAttr), ViewPager.OnPageChangeListener {
  11.  
  12. override fun onPageScrollStateChanged(state: Int) {
  13. }
  14.  
  15. override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
  16. progress = position / 2.0f + positionOffset * (1 / 2f)
  17. }
  18.  
  19. override fun onPageSelected(position: Int) {
  20. }
  21. }
Add Comment
Please, Sign In to add comment