|
|
@ -13,6 +13,7 @@ import io.legado.app.help.ReadBookConfig |
|
|
|
import io.legado.app.lib.theme.accentColor |
|
|
|
import io.legado.app.lib.theme.accentColor |
|
|
|
import io.legado.app.ui.book.read.page.entities.SelectPoint |
|
|
|
import io.legado.app.ui.book.read.page.entities.SelectPoint |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPage |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPage |
|
|
|
|
|
|
|
import io.legado.app.utils.activity |
|
|
|
import io.legado.app.utils.getCompatColor |
|
|
|
import io.legado.app.utils.getCompatColor |
|
|
|
import io.legado.app.utils.getPrefBoolean |
|
|
|
import io.legado.app.utils.getPrefBoolean |
|
|
|
|
|
|
|
|
|
|
@ -24,6 +25,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
style = Paint.Style.FILL |
|
|
|
style = Paint.Style.FILL |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private var activityCallBack: CallBack? = null |
|
|
|
var selectAble = context.getPrefBoolean(PreferKey.textSelectAble) |
|
|
|
var selectAble = context.getPrefBoolean(PreferKey.textSelectAble) |
|
|
|
var selectStartLine = 0 |
|
|
|
var selectStartLine = 0 |
|
|
|
var selectStartChar = 0 |
|
|
|
var selectStartChar = 0 |
|
|
@ -31,6 +33,10 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
var selectEndChar = 0 |
|
|
|
var selectEndChar = 0 |
|
|
|
private var textPage: TextPage? = null |
|
|
|
private var textPage: TextPage? = null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
|
|
|
activityCallBack = activity as? CallBack |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setContent(textPage: TextPage?) { |
|
|
|
fun setContent(textPage: TextPage?) { |
|
|
|
this.textPage = textPage |
|
|
|
this.textPage = textPage |
|
|
|
invalidate() |
|
|
|
invalidate() |
|
|
@ -175,7 +181,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
} |
|
|
|
} |
|
|
|
invalidate() |
|
|
|
invalidate() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
activityCallBack?.onCancelSelect() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface CallBack { |
|
|
|
interface CallBack { |
|
|
|