feat: 优化代码

pull/103/head
kunfei 5 years ago
parent c91f348378
commit a34f0df2d4
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt
  2. 7
      app/src/main/java/io/legado/app/ui/importbook/ImportBookAdapter.kt

@ -90,8 +90,8 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi
super.setTouchPoint(x, y, invalidate) super.setTouchPoint(x, y, invalidate)
//触摸y中间位置吧y变成屏幕高度 //触摸y中间位置吧y变成屏幕高度
//触摸y中间位置吧y变成屏幕高度 //触摸y中间位置吧y变成屏幕高度
if (startY > pageView.height / 3.0 if ((startY > pageView.height / 3.0
&& startY < pageView.height * 2 / 3.0 && startY < pageView.height * 2 / 3.0)
|| direction == Direction.PREV || direction == Direction.PREV
) { ) {
touchY = pageView.height.toFloat() touchY = pageView.height.toFloat()

@ -94,10 +94,6 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) :
} else { } else {
cb_select.isChecked = selectedUris.contains(item.uri.toString()) cb_select.isChecked = selectedUris.contains(item.uri.toString())
} }
onClick {
}
} }
} }
@ -112,11 +108,10 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) :
} else { } else {
selectedUris.remove(it.uri.toString()) selectedUris.remove(it.uri.toString())
} }
notifyItemChanged(holder.layoutPosition, true)
callBack.upCountView() callBack.upCountView()
} }
} }
notifyItemChanged(holder.layoutPosition, true)
callBack.upCountView()
} }
} }

Loading…
Cancel
Save