|
@@ -22,13 +22,13 @@ import android.widget.LinearLayout
|
|
|
import android.widget.TextView
|
|
|
import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
|
|
|
import com.kdanmobile.reader.Utils.applyConstraintSet
|
|
|
-import com.kdanmobile.reader.screen.view.BookmarkView
|
|
|
-import com.kdanmobile.reader.screen.view.OutlineView
|
|
|
-import com.kdanmobile.reader.screen.view.SearchView
|
|
|
-import com.kdanmobile.reader.screen.view.ThumbnailView
|
|
|
import com.kdanmobile.reader.utils.AnimationUtil
|
|
|
import com.kdanmobile.reader.utils.DensityUtil
|
|
|
import com.kdanmobile.reader.screen.ViewerSettingActivity
|
|
|
+import com.kdanmobile.reader.screen.view.*
|
|
|
+import com.kdanmobile.reader.screen.view.edit.ShapeTabView
|
|
|
+import com.kdanmobile.reader.screen.view.edit.StampTabView
|
|
|
+import com.kdanmobile.reader.screen.view.edit.TextBoxTabView
|
|
|
import kotlinx.android.synthetic.main.activity_reader.*
|
|
|
import kotlin.Exception
|
|
|
|
|
@@ -82,6 +82,7 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
setupLeftToolbar()
|
|
|
setupRightSideToolbar()
|
|
|
setupBottomToolbar()
|
|
|
+ setupViewerEditView()
|
|
|
|
|
|
val factory = ReaderViewModelFactory()
|
|
|
viewModel = ViewModelProviders.of(this, factory).get(ReaderViewModel::class.java)
|
|
@@ -161,9 +162,9 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
isHideToolbar = !isHideToolbar
|
|
|
}
|
|
|
|
|
|
- override fun onMoveToChild(p0: Int) {
|
|
|
- super.onMoveToChild(p0)
|
|
|
- viewModel.setPageIndex(p0)
|
|
|
+ override fun onMoveToChild(pageIndex: Int) {
|
|
|
+ super.onMoveToChild(pageIndex)
|
|
|
+ viewModel.setPageIndex(pageIndex)
|
|
|
updateThumbnailViewSelectedPage()
|
|
|
}
|
|
|
|
|
@@ -223,6 +224,7 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
AnimationUtil.hideViewFromTopToBottom(viewGroup_readerActivity_bottomToolbar, UI_ANIMATION_DURATION)
|
|
|
AnimationUtil.hideViewFromRightToLeft(viewGroup_readerActivity_leftToolbar, UI_ANIMATION_DURATION)
|
|
|
AnimationUtil.hideViewFromLeftToRight(viewGroup_readerActivity_rightToolbar, UI_ANIMATION_DURATION)
|
|
|
+ viewerEditView.visibility = View.GONE
|
|
|
hideSearchViewSoftKeyboard()
|
|
|
} else {
|
|
|
constrainLayout_readerActivity_root.applyConstraintSet(this, R.layout.activity_reader_hide_all, UI_ANIMATION_DURATION)
|
|
@@ -361,6 +363,32 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
Utils.setTintDrawableList(context, ib_readerActivity_bottomToolbarKdanCloud, R.drawable.ic_kdan_cloud, normalColor, pressColor)
|
|
|
}
|
|
|
|
|
|
+ private fun setupViewerEditView() {
|
|
|
+
|
|
|
+ ib_readerActivity_bottomToolbarKdanCloud.setOnClickListener {
|
|
|
+ viewerEditView.visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+
|
|
|
+ viewerEditView.apply {
|
|
|
+ onViewerEditTabAddButtonClickListener = object : ViewerEditView.OnViewerEditTabAddButtonClickListener {
|
|
|
+ override fun onTabTextBoxAddButtonClick(textBoxTabView: TextBoxTabView) {
|
|
|
+ hideAllToolbars()
|
|
|
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onTabStampAddButtonClick(stampTabView: StampTabView) {
|
|
|
+ hideAllToolbars()
|
|
|
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onTabShapeAddButtonClick(shapeTabView: ShapeTabView) {
|
|
|
+ hideAllToolbars()
|
|
|
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private fun setLeftToolbarWidth(width: Int) {
|
|
|
var params = viewGroup_readerActivity_leftToolbar.layoutParams as ConstraintLayout.LayoutParams
|
|
|
params.width = width + w_left
|
|
@@ -461,8 +489,7 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
leftToolbarType = type
|
|
|
}
|
|
|
|
|
|
- fun onClick(view: View)
|
|
|
- {
|
|
|
+ fun onClick(view: View) {
|
|
|
when (view.id) {
|
|
|
R.id.iv_readerActivity_thumbnail -> {
|
|
|
onThumbnailClick()
|