|
@@ -15,7 +15,13 @@ import com.kdanmobile.reader.Utils.applyConstraintSet
|
|
import kotlinx.android.synthetic.main.activity_reader.*
|
|
import kotlinx.android.synthetic.main.activity_reader.*
|
|
import kotlin.Exception
|
|
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 {
|
|
companion object {
|
|
const val KEY_FILE_ABSOLUTE = "file_absolutepath"
|
|
const val KEY_FILE_ABSOLUTE = "file_absolutepath"
|
|
@@ -33,6 +39,7 @@ open class ReaderActivity : AppCompatActivity() {
|
|
setSupportActionBar(toolbar_readerActivity)
|
|
setSupportActionBar(toolbar_readerActivity)
|
|
|
|
|
|
cloneOriginConstraintSet()
|
|
cloneOriginConstraintSet()
|
|
|
|
+ setupToolbar()
|
|
setupBottomToolbar()
|
|
setupBottomToolbar()
|
|
|
|
|
|
val factory = ReaderViewModelFactory()
|
|
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() {
|
|
private fun setupBottomToolbar() {
|
|
val context = this
|
|
val context = this
|
|
/** Set buttons color **/
|
|
/** Set buttons color **/
|