|
@@ -15,7 +15,13 @@ import com.kdanmobile.reader.Utils.applyConstraintSet
|
|
|
import kotlinx.android.synthetic.main.activity_reader.*
|
|
|
import kotlin.Exception
|
|
|
|
|
|
-open class ReaderActivity : AppCompatActivity() {
|
|
|
+abstract class ReaderActivity : AppCompatActivity() {
|
|
|
+
|
|
|
+ abstract fun onClickShare()
|
|
|
+ abstract fun onClickTextReflow()
|
|
|
+ abstract fun onClickFileInfo()
|
|
|
+ abstract fun onClickPrint()
|
|
|
+ abstract fun onClickUserGuide()
|
|
|
|
|
|
companion object {
|
|
|
const val KEY_FILE_ABSOLUTE = "file_absolutepath"
|
|
@@ -33,6 +39,7 @@ open class ReaderActivity : AppCompatActivity() {
|
|
|
setSupportActionBar(toolbar_readerActivity)
|
|
|
|
|
|
cloneOriginConstraintSet()
|
|
|
+ setupToolbar()
|
|
|
setupBottomToolbar()
|
|
|
|
|
|
val factory = ReaderViewModelFactory()
|
|
@@ -130,6 +137,19 @@ open class ReaderActivity : AppCompatActivity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private fun setupToolbar() {
|
|
|
+ toolbar_readerActivity.setOnMenuItemClickListener {
|
|
|
+ when (it.itemId) {
|
|
|
+ R.id.item_reader_more_share -> onClickShare()
|
|
|
+ R.id.item_reader_more_text_reflow -> onClickTextReflow()
|
|
|
+ R.id.item_reader_more_file_info -> onClickFileInfo()
|
|
|
+ R.id.item_reader_more_print -> onClickPrint()
|
|
|
+ R.id.item_reader_more_user_guide -> onClickUserGuide()
|
|
|
+ }
|
|
|
+ return@setOnMenuItemClickListener true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private fun setupBottomToolbar() {
|
|
|
val context = this
|
|
|
/** Set buttons color **/
|