优化
This commit is contained in:
@@ -138,8 +138,7 @@
|
|||||||
<!-- 阅读漫画界面 -->
|
<!-- 阅读漫画界面 -->
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.book.manga.ReadMangaActivity"
|
android:name=".ui.book.manga.ReadMangaActivity"
|
||||||
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
|
android:exported="false"
|
||||||
android:exported="true"
|
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
|
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class WebtoonRecyclerView @JvmOverloads constructor(
|
|||||||
halfHeight = MeasureSpec.getSize(heightSpec) / 2
|
halfHeight = MeasureSpec.getSize(heightSpec) / 2
|
||||||
if (!heightSet) {
|
if (!heightSet) {
|
||||||
originalHeight = MeasureSpec.getSize(heightSpec)
|
originalHeight = MeasureSpec.getSize(heightSpec)
|
||||||
|
val width = MeasureSpec.getSize(widthSpec)
|
||||||
|
setClickArea(width, originalHeight)
|
||||||
heightSet = true
|
heightSet = true
|
||||||
}
|
}
|
||||||
super.onMeasure(widthSpec, heightSpec)
|
super.onMeasure(widthSpec, heightSpec)
|
||||||
@@ -103,8 +105,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(
|
|||||||
return super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow, type)
|
return super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow, type)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
private fun setClickArea(width: Int, height: Int) {
|
||||||
super.onSizeChanged(w, h, oldw, oldh)
|
|
||||||
mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.66f)
|
mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.66f)
|
||||||
blRect.set(0f, height * 0.66f, width * 0.33f, height.toFloat())
|
blRect.set(0f, height * 0.66f, width * 0.33f, height.toFloat())
|
||||||
brRect.set(width * 0.66f, height * 0.66f, width.toFloat(), height.toFloat())
|
brRect.set(width * 0.66f, height * 0.66f, width.toFloat(), height.toFloat())
|
||||||
|
|||||||
Reference in New Issue
Block a user