|
|
@ -19,7 +19,7 @@ class RootView : LinearLayout { |
|
|
|
constructor(context: Context) : super(context) |
|
|
|
constructor(context: Context) : super(context) |
|
|
|
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) |
|
|
|
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) |
|
|
|
|
|
|
|
|
|
|
|
private var touchSlop = 0 |
|
|
|
private val touchSlop = ViewConfiguration.get(context).scaledTouchSlop |
|
|
|
private var initialX = 0f |
|
|
|
private var initialX = 0f |
|
|
|
private var initialY = 0f |
|
|
|
private var initialY = 0f |
|
|
|
|
|
|
|
|
|
|
@ -28,10 +28,6 @@ class RootView : LinearLayout { |
|
|
|
private val childViewPager: View? |
|
|
|
private val childViewPager: View? |
|
|
|
get() = findViewById(R.id.view_pager_bookshelf) |
|
|
|
get() = findViewById(R.id.view_pager_bookshelf) |
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
|
|
|
touchSlop = ViewConfiguration.get(context).scaledTouchSlop |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun canChildScroll(orientation: Int, delta: Float): Boolean { |
|
|
|
private fun canChildScroll(orientation: Int, delta: Float): Boolean { |
|
|
|
val direction = -delta.sign.toInt() |
|
|
|
val direction = -delta.sign.toInt() |
|
|
|
return when (orientation) { |
|
|
|
return when (orientation) { |
|
|
|