Procházet zdrojové kódy

Merge branch 'media-box-refactor'

Wayne před 5 roky
rodič
revize
0100b29bde
34 změnil soubory, kde provedl 174 přidání a 169 odebrání
  1. 1 1
      reader/src/main/AndroidManifest.xml
  2. 16 16
      reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt
  3. 9 9
      reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditTabView.kt
  4. 41 37
      reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt
  5. 10 10
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TitleButton.kt
  6. 16 16
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextSeekBar.kt
  7. 6 4
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/ShapeTabView.kt
  8. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureAddListener.kt
  9. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureClickListener.kt
  10. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureRemoveListener.kt
  11. 1 2
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureAdapter.kt
  12. 2 2
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureRecyclerViewItemDecoration.kt
  13. 6 6
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureTabView.kt
  14. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampAdapter.kt
  15. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampType.kt
  16. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnStampClickListener.kt
  17. 3 2
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StampTabView.kt
  18. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StandardStampAdapter.kt
  19. 1 1
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextAttrView.kt
  20. 3 2
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextBoxTabView.kt
  21. 6 7
      reader/src/main/java/com/kdanmobile/reader/screen/SignatureActivity.kt
  22. 4 5
      reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureDrawView.kt
  23. 1 1
      reader/src/main/res/layout/activity_reader.xml
  24. 2 2
      reader/src/main/res/layout/activity_view_signature_create.xml
  25. 9 9
      reader/src/main/res/layout/view_viewer_edit.xml
  26. 2 2
      reader/src/main/res/layout/view_viewer_edit_item_title_button.xml
  27. 9 9
      reader/src/main/res/layout/view_viewer_edit_item_seekbar.xml
  28. 9 9
      reader/src/main/res/layout/view_viewer_edit_tab.xml
  29. 2 2
      reader/src/main/res/layout/view_viewer_edit_item_shape_border.xml
  30. 1 1
      reader/src/main/res/layout/view_viewer_edit_item_shape_fill.xml
  31. 1 1
      reader/src/main/res/layout/view_viewer_edit_tab_shape.xml
  32. 1 1
      reader/src/main/res/layout/view_viewer_edit_tab_stamp.xml
  33. 3 3
      reader/src/main/res/layout/view_viewer_edit_tab_text_box.xml
  34. 2 2
      reader/src/main/res/values/attrs.xml

+ 1 - 1
reader/src/main/AndroidManifest.xml

@@ -10,7 +10,7 @@
             android:name=".screen.ViewerSettingActivity"
             android:theme="@style/ReaderActivityNoActionBarNoTitle" />
         <activity
-            android:name=".screen.SignatureActivity"
+            android:name=".screen.signature.SignatureActivity"
             android:screenOrientation="landscape"
             android:theme="@style/ReaderActivityNoActionBarNoTitle" />
     </application>

+ 16 - 16
reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt

@@ -9,11 +9,6 @@ import android.os.Build
 import android.os.Bundle
 import android.support.constraint.ConstraintLayout
 import android.support.constraint.ConstraintSet
-import android.widget.Toast
-import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
-import com.kdanmobile.reader.Utils.applyConstraintSet
-import com.kdanmobile.reader.view.AnnotationAttributeView
-import com.kdanmobile.reader.view.AnnotationAttributeWindow
 import android.support.v4.content.ContextCompat
 import android.support.v7.app.AlertDialog
 import android.support.v7.app.AppCompatActivity
@@ -25,21 +20,26 @@ import android.view.View
 import android.widget.EditText
 import android.widget.LinearLayout
 import android.widget.TextView
+import android.widget.Toast
+import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
+import com.kdanmobile.reader.Utils.applyConstraintSet
 import com.kdanmobile.reader.annotationattribute.AnnotationAttribute
 import com.kdanmobile.reader.annotationattribute.AnnotationColor
 import com.kdanmobile.reader.annotationattribute.InkAttribute
+import com.kdanmobile.reader.screen.ViewerSettingActivity
+import com.kdanmobile.reader.screen.reader.mediabox.MediaBoxView
+import com.kdanmobile.reader.screen.reader.mediabox.shape.ShapeTabView
+import com.kdanmobile.reader.screen.reader.mediabox.signature.SignatureTabView
+import com.kdanmobile.reader.screen.reader.mediabox.stamp.StampTabView
+import com.kdanmobile.reader.screen.reader.mediabox.textbox.TextBoxTabView
 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.screen.ViewerSettingActivity
-import com.kdanmobile.reader.screen.view.*
-import com.kdanmobile.reader.screen.view.edit.ShapeTabView
-import com.kdanmobile.reader.screen.view.edit.SignatureTabView
-import com.kdanmobile.reader.screen.view.edit.StampTabView
-import com.kdanmobile.reader.screen.view.edit.TextBoxTabView
 import com.kdanmobile.reader.utils.AnimationUtil
 import com.kdanmobile.reader.utils.DensityUtil
+import com.kdanmobile.reader.view.AnnotationAttributeView
+import com.kdanmobile.reader.view.AnnotationAttributeWindow
 import kotlinx.android.synthetic.main.activity_reader.*
 
 abstract class ReaderActivity : AppCompatActivity() {
@@ -470,23 +470,23 @@ abstract class ReaderActivity : AppCompatActivity() {
         viewerEditView.apply {
             onShowListener = Runnable { onMediaBoxShown() }
             onDismissListener = Runnable { onMediaBoxDismissed() }
-            onViewerEditTabAddButtonClickListener = object : ViewerEditView.OnViewerEditTabAddButtonClickListener {
-                override fun onTabTextBoxAddButtonClick(textBoxTabView: TextBoxTabView) {
+            onClickAddButtonListener = object : MediaBoxView.OnClickAddButtonListener {
+                override fun onClickTextBoxAddButton(textBoxTabView: TextBoxTabView) {
                     hideAllToolbars()
                     viewModel.setTextBoxAttribute(textBoxTabView.getTextBoxAttribute())
                 }
 
-                override fun onTabSignatureAddButtonClick(signatureTabView: SignatureTabView) {
+                override fun onClickSignatureAddButton(signatureTabView: SignatureTabView) {
                     hideAllToolbars()
                     viewModel.setSignatureAttribute(signatureTabView.getSignatureAttribute())
                 }
 
-                override fun onTabStampAddButtonClick(stampTabView: StampTabView) {
+                override fun onClickStampAddButton(stampTabView: StampTabView) {
                     hideAllToolbars()
                     viewModel.setStampAttribute(stampTabView.getStampAttribute())
                 }
 
-                override fun onTabShapeAddButtonClick(shapeTabView: ShapeTabView) {
+                override fun onClickShapeAddButton(shapeTabView: ShapeTabView) {
                     hideAllToolbars()
                     viewModel.setShapeAttribute(shapeTabView.getShapeAttribute())
                 }

+ 9 - 9
reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditTabView.kt

@@ -1,42 +1,42 @@
-package com.kdanmobile.reader.screen.view
+package com.kdanmobile.reader.screen.reader.mediabox
 
 import android.content.Context
 import android.support.constraint.ConstraintLayout
 import android.util.AttributeSet
 import android.view.LayoutInflater
 import com.kdanmobile.reader.R
-import kotlinx.android.synthetic.main.view_viewer_edit_tab.view.*
+import kotlinx.android.synthetic.main.view_media_box_tab.view.*
 
-class ViewerEditTabView : ConstraintLayout {
+class MediaBoxTabView : ConstraintLayout {
 
     var onClickListenerTabTextBox: OnClickListener? = null
         set(value) {
             field = value
-            viewerEdit_tab_textBox?.setOnClickListener(value)
+            ib_mediaBoxTab_textBox?.setOnClickListener(value)
         }
 
     var onClickListenerTabSignature: OnClickListener? = null
         set(value) {
             field = value
-            viewerEdit_tab_signature?.setOnClickListener(value)
+            ib_mediaBoxTab_signature?.setOnClickListener(value)
         }
 
     var onClickListenerTabStamp: OnClickListener? = null
         set(value) {
             field = value
-            viewerEdit_tab_stamp?.setOnClickListener(value)
+            ib_mediaBoxTab_stamp?.setOnClickListener(value)
         }
 
     var onClickListenerTabShape: OnClickListener? = null
         set(value) {
             field = value
-            viewerEdit_tab_shape?.setOnClickListener(value)
+            ib_mediaBoxTab_shape?.setOnClickListener(value)
         }
 
     var onClickListenerTabForm: OnClickListener? = null
         set(value) {
             field = value
-            viewerEdit_tab_form?.setOnClickListener(value)
+            ib_mediaBoxTab_form?.setOnClickListener(value)
         }
 
     constructor(context: Context) : super(context) {
@@ -52,6 +52,6 @@ class ViewerEditTabView : ConstraintLayout {
     }
 
     private fun initView() {
-        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab, this)
+        LayoutInflater.from(context).inflate(R.layout.view_media_box_tab, this)
     }
 }

+ 41 - 37
reader/src/main/java/com/kdanmobile/reader/screen/view/ViewerEditView.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view
+package com.kdanmobile.reader.screen.reader.mediabox
 
 import android.animation.*
 import android.content.Context
@@ -12,11 +12,15 @@ import android.view.View.OnClickListener
 import android.view.animation.AccelerateDecelerateInterpolator
 import android.widget.ImageButton
 import com.kdanmobile.reader.R
-import com.kdanmobile.reader.screen.view.edit.*
-import kotlinx.android.synthetic.main.view_viewer_edit.view.*
-import kotlinx.android.synthetic.main.view_viewer_edit_tab.view.*
+import com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
+import com.kdanmobile.reader.screen.reader.mediabox.shape.ShapeTabView
+import com.kdanmobile.reader.screen.reader.mediabox.signature.SignatureTabView
+import com.kdanmobile.reader.screen.reader.mediabox.stamp.StampTabView
+import com.kdanmobile.reader.screen.reader.mediabox.textbox.TextBoxTabView
+import kotlinx.android.synthetic.main.view_media_box.view.*
+import kotlinx.android.synthetic.main.view_media_box_tab.view.*
 
-class ViewerEditView @JvmOverloads constructor(
+class MediaBoxView @JvmOverloads constructor(
         context: Context,
         attrs: AttributeSet? = null,
         defStyleAttr: Int = 0
@@ -40,19 +44,19 @@ class ViewerEditView @JvmOverloads constructor(
     private var maskAnimator: ValueAnimator? = null
     private var tabType = ViewerEditTabType.NONE
     private var selected: ImageButton? = null
-    var onViewerEditTabAddButtonClickListener: OnViewerEditTabAddButtonClickListener? = null
+    var onClickAddButtonListener: OnClickAddButtonListener? = null
 
     init {
-        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit, this)
+        LayoutInflater.from(context).inflate(R.layout.view_media_box, this)
         visibility = View.INVISIBLE
         setupTabView()
 
         /** Set empty listener to prevent dismissing by clicking box **/
-        view_viewEdit_content.setOnClickListener {}
+        view_mediaBox_dialog.setOnClickListener {}
 
         /** Move media box view to bottom of parent(hide it) **/
         val size = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
-        val v = view_viewEdit_content
+        val v = view_mediaBox_dialog
         v.measure(size, size)
         v.y = v.top + v.measuredHeight.toFloat()
     }
@@ -104,7 +108,7 @@ class ViewerEditView @JvmOverloads constructor(
 
     private fun showMediaBoxWithAnimation() {
         mediaBoxAnimator?.cancel()
-        val v = view_viewEdit_content
+        val v = view_mediaBox_dialog
         v.visibility = View.VISIBLE
         val from = v.y
         val to = v.top.toFloat()
@@ -124,7 +128,7 @@ class ViewerEditView @JvmOverloads constructor(
 
     private fun hideMediaBoxWithAnimation() {
         mediaBoxAnimator?.cancel()
-        val v = view_viewEdit_content
+        val v = view_mediaBox_dialog
         val from = v.y
         val to = v.top.toFloat() + v.height
         val holder = PropertyValuesHolder.ofFloat("Y", from, to)
@@ -136,7 +140,7 @@ class ViewerEditView @JvmOverloads constructor(
                     super.onAnimationEnd(animation)
                     removeListener(this)
                     v.visibility = View.INVISIBLE
-                    this@ViewerEditView.visibility = View.GONE
+                    this@MediaBoxView.visibility = View.GONE
                 }
             })
             start()
@@ -144,13 +148,13 @@ class ViewerEditView @JvmOverloads constructor(
     }
 
     private fun setupTabView() {
-        viewerEdit_tab.onClickListenerTabTextBox = OnClickListener(this::setupTextBoxView)
-        viewerEdit_tab.onClickListenerTabSignature = OnClickListener(this::setupSignatureView)
-        viewerEdit_tab.onClickListenerTabStamp = OnClickListener(this::setupStampView)
-        viewerEdit_tab.onClickListenerTabShape = OnClickListener(this::setupShapeView)
-        viewerEdit_tab.onClickListenerTabForm = OnClickListener(this::setupFormView)
+        mediaBoxTabView_mediaBox_tab.onClickListenerTabTextBox = OnClickListener(this::setupTextBoxView)
+        mediaBoxTabView_mediaBox_tab.onClickListenerTabSignature = OnClickListener(this::setupSignatureView)
+        mediaBoxTabView_mediaBox_tab.onClickListenerTabStamp = OnClickListener(this::setupStampView)
+        mediaBoxTabView_mediaBox_tab.onClickListenerTabShape = OnClickListener(this::setupShapeView)
+        mediaBoxTabView_mediaBox_tab.onClickListenerTabForm = OnClickListener(this::setupFormView)
 
-        setupTextBoxView(viewerEdit_tab_textBox)
+        setupTextBoxView(ib_mediaBoxTab_textBox)
     }
 
     private fun getButtonDrawable(tabType: ViewerEditTabType, isSelected: Boolean): Int {
@@ -176,7 +180,7 @@ class ViewerEditView @JvmOverloads constructor(
             selected = button
             button.setImageDrawable(ContextCompat.getDrawable(context, getButtonDrawable(this.tabType, true)))
 
-            viewEdit_layout_tab_content.removeAllViews()
+            viewGroup_mediaBox_pageContainer.removeAllViews()
             changed = true
         }
         return changed
@@ -187,10 +191,10 @@ class ViewerEditView @JvmOverloads constructor(
         if (changed) {
             val textBoxTabView = TextBoxTabView(context)
             val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
-            viewEdit_layout_tab_content.addView(textBoxTabView, params)
-            textBoxTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+            viewGroup_mediaBox_pageContainer.addView(textBoxTabView, params)
+            textBoxTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
-                    onViewerEditTabAddButtonClickListener?.onTabTextBoxAddButtonClick(textBoxTabView)
+                    onClickAddButtonListener?.onClickTextBoxAddButton(textBoxTabView)
                 }
             }
         }
@@ -201,10 +205,10 @@ class ViewerEditView @JvmOverloads constructor(
         if (changed) {
             val signatureTabView = SignatureTabView(context)
             val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
-            viewEdit_layout_tab_content.addView(signatureTabView, params)
-            signatureTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+            viewGroup_mediaBox_pageContainer.addView(signatureTabView, params)
+            signatureTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
-                    onViewerEditTabAddButtonClickListener?.onTabSignatureAddButtonClick(signatureTabView)
+                    onClickAddButtonListener?.onClickSignatureAddButton(signatureTabView)
                 }
             }
         }
@@ -215,10 +219,10 @@ class ViewerEditView @JvmOverloads constructor(
         if (changed) {
             val stampTabView = StampTabView(context)
             val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
-            viewEdit_layout_tab_content.addView(stampTabView, params)
-            stampTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+            viewGroup_mediaBox_pageContainer.addView(stampTabView, params)
+            stampTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
-                    onViewerEditTabAddButtonClickListener?.onTabStampAddButtonClick(stampTabView)
+                    onClickAddButtonListener?.onClickStampAddButton(stampTabView)
                 }
             }
         }
@@ -229,10 +233,10 @@ class ViewerEditView @JvmOverloads constructor(
         if (changed) {
             val shapeTabView = ShapeTabView(context)
             val params = ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT)
-            viewEdit_layout_tab_content.addView(shapeTabView, params)
-            shapeTabView.onTitleButtonClickListener = object: TitleButton.OnTitleButtonClickListener {
+            viewGroup_mediaBox_pageContainer.addView(shapeTabView, params)
+            shapeTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
-                    onViewerEditTabAddButtonClickListener?.onTabShapeAddButtonClick(shapeTabView)
+                    onClickAddButtonListener?.onClickShapeAddButton(shapeTabView)
                 }
             }
         }
@@ -242,14 +246,14 @@ class ViewerEditView @JvmOverloads constructor(
         //TODO implements tab view and add to viewEdit_layout_tab_content
         val changed = setupContent(view as ImageButton, ViewerEditTabType.FORM)
         if (changed) {
-            LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_tab, viewEdit_layout_tab_content)
+            LayoutInflater.from(context).inflate(R.layout.view_media_box_tab, viewGroup_mediaBox_pageContainer)
         }
     }
 
-    interface OnViewerEditTabAddButtonClickListener {
-        fun onTabTextBoxAddButtonClick(textBoxTabView: TextBoxTabView)
-        fun onTabSignatureAddButtonClick(signatureTabView: SignatureTabView)
-        fun onTabStampAddButtonClick(stampTabView: StampTabView)
-        fun onTabShapeAddButtonClick(shapeTabView: ShapeTabView)
+    interface OnClickAddButtonListener {
+        fun onClickTextBoxAddButton(textBoxTabView: TextBoxTabView)
+        fun onClickSignatureAddButton(signatureTabView: SignatureTabView)
+        fun onClickStampAddButton(stampTabView: StampTabView)
+        fun onClickShapeAddButton(shapeTabView: ShapeTabView)
     }
 }

+ 10 - 10
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TitleButton.kt

@@ -1,13 +1,13 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.common
 
 import android.content.Context
 import android.support.constraint.ConstraintLayout
 import android.util.AttributeSet
 import android.view.LayoutInflater
 import com.kdanmobile.reader.R
-import kotlinx.android.synthetic.main.view_viewer_edit_item_title_button.view.*
+import kotlinx.android.synthetic.main.view_media_box_header.view.*
 
-class TitleButton : ConstraintLayout {
+class MediaBoxHeader : ConstraintLayout {
 
     private var title = ""
     private var buttonText = ""
@@ -15,7 +15,7 @@ class TitleButton : ConstraintLayout {
     var onTitleButtonClickListener: OnTitleButtonClickListener? = null
         set(value) {
             field = value
-            btn_add?.setOnClickListener{field?.onTitleButtonClick()}
+            btn_mediaBoxHeader_add?.setOnClickListener{field?.onTitleButtonClick()}
         }
 
     constructor(context: Context) : super(context) {
@@ -33,16 +33,16 @@ class TitleButton : ConstraintLayout {
     }
 
     private fun initAttr(attributeSet: AttributeSet) {
-        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.TitleButton, 0, 0)
-        title = typedArray.getString(R.styleable.TitleButton_title) ?: ""
-        buttonText = typedArray.getString(R.styleable.TitleButton_buttonText) ?: ""
+        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.MediaBoxHeader, 0, 0)
+        title = typedArray.getString(R.styleable.MediaBoxHeader_title) ?: ""
+        buttonText = typedArray.getString(R.styleable.MediaBoxHeader_buttonText) ?: ""
     }
 
     private fun initView() {
-        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_title_button, this)
+        LayoutInflater.from(context).inflate(R.layout.view_media_box_header, this)
 
-        tv_title.text = title
-        btn_add.text = buttonText
+        tv_mediaBoxHeader_title.text = title
+        btn_mediaBoxHeader_add.text = buttonText
     }
 
     interface OnTitleButtonClickListener {

+ 16 - 16
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextSeekBar.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.common
 
 import android.content.Context
 import android.support.constraint.ConstraintLayout
@@ -6,9 +6,9 @@ import android.util.AttributeSet
 import android.view.LayoutInflater
 import android.widget.SeekBar
 import com.kdanmobile.reader.R
-import kotlinx.android.synthetic.main.view_viewer_edit_item_seekbar.view.*
+import kotlinx.android.synthetic.main.view_media_box_seekbar.view.*
 
-class TextSeekBar : ConstraintLayout {
+class MediaBoxSeekBar : ConstraintLayout {
 
     private var title = ""
     private var unit = ""
@@ -25,7 +25,7 @@ class TextSeekBar : ConstraintLayout {
     var formatter = defaultFormatter
         set(value) {
             field = value
-            tv_seekBarValue?.text = "${formatter.format(currentValue)}$unit"
+            tv_mediaBoxSeekBar_value?.text = "${formatter.format(currentValue)}$unit"
         }
 
     interface SeekBarFormatter {
@@ -35,8 +35,8 @@ class TextSeekBar : ConstraintLayout {
     var currentValue = 0
         set(value) {
             field = Math.max(Math.min(value, maxValue), minValue)
-            tv_seekBarValue?.text = "${formatter.format(currentValue)}$unit"
-            seekBar?.progress = field - minValue
+            tv_mediaBoxSeekBar_value?.text = "${formatter.format(currentValue)}$unit"
+            seekBar_mediaBoxSeekBar?.progress = field - minValue
         }
     var onSeekBarChangeListener: SeekBar.OnSeekBarChangeListener? = null
 
@@ -55,23 +55,23 @@ class TextSeekBar : ConstraintLayout {
     }
 
     private fun initAttr(attributeSet: AttributeSet) {
-        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.TextSeekBar, 0, 0)
-        title = typedArray.getString(R.styleable.TextSeekBar_title) ?: ""
-        unit = typedArray.getString(R.styleable.TextSeekBar_unit) ?: ""
-        maxValue = typedArray.getInteger(R.styleable.TextSeekBar_maxValue, 100)
-        minValue = typedArray.getInteger(R.styleable.TextSeekBar_minValue, 0)
+        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.MediaBoxSeekBar, 0, 0)
+        title = typedArray.getString(R.styleable.MediaBoxSeekBar_title) ?: ""
+        unit = typedArray.getString(R.styleable.MediaBoxSeekBar_unit) ?: ""
+        maxValue = typedArray.getInteger(R.styleable.MediaBoxSeekBar_maxValue, 100)
+        minValue = typedArray.getInteger(R.styleable.MediaBoxSeekBar_minValue, 0)
         if (maxValue < minValue)
             maxValue = minValue
-        initValue = typedArray.getInteger(R.styleable.TextSeekBar_initValue, 0)
+        initValue = typedArray.getInteger(R.styleable.MediaBoxSeekBar_initValue, 0)
         initValue = Math.max(Math.min(initValue, maxValue), minValue)
     }
 
     private fun initView() {
-        LayoutInflater.from(context).inflate(R.layout.view_viewer_edit_item_seekbar, this)
+        LayoutInflater.from(context).inflate(R.layout.view_media_box_seekbar, this)
 
-        tv_seekBarTitle.text = title
-        seekBar.max = maxValue - minValue
-        seekBar.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener {
+        tv_mediaBoxSeekBar_title.text = title
+        seekBar_mediaBoxSeekBar.max = maxValue - minValue
+        seekBar_mediaBoxSeekBar.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener {
             override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
                 currentValue = progress + minValue
                 onSeekBarChangeListener?.onProgressChanged(seekBar, currentValue, fromUser)

+ 6 - 4
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/ShapeTabView.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.shape
 
 import android.content.Context
 import android.graphics.Color
@@ -12,13 +12,15 @@ import android.view.ViewGroup
 import com.kdanmobile.kmpdfkit.globaldata.AnnotConfig
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.screen.data.ShapeAttribute
+import com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
+import com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxSeekBar
 import kotlinx.android.synthetic.main.view_viewer_edit_item_shape_border.view.*
 import kotlinx.android.synthetic.main.view_viewer_edit_item_shape_fill.view.*
 import kotlinx.android.synthetic.main.view_viewer_edit_tab_shape.view.*
 
 class ShapeTabView : ConstraintLayout {
 
-    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+    var onMediaBoxHeaderClickListener: MediaBoxHeader.OnTitleButtonClickListener? = null
         set(value) {
             field = value
             titleButton_shape?.onTitleButtonClickListener = field
@@ -103,13 +105,13 @@ class ShapeTabView : ConstraintLayout {
             }
             val view = layoutInflater.inflate(resourceId, container, false)
             if (position == 0) {
-                view.seekBar_shapeBorder_opacity.formatter = object : TextSeekBar.SeekBarFormatter {
+                view.seekBar_shapeBorder_opacity.formatter = object : MediaBoxSeekBar.SeekBarFormatter {
                     override fun format(value: Int): String {
                         return Math.round(value / 2.55).toInt().toString()
                     }
                 }
             } else {
-                view.seekBar_shapeFill_opacity.formatter = object : TextSeekBar.SeekBarFormatter {
+                view.seekBar_shapeFill_opacity.formatter = object : MediaBoxSeekBar.SeekBarFormatter {
                     override fun format(value: Int): String {
                         return Math.round(value / 2.55).toInt().toString()
                     }

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureAddListener.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.signature
 
 interface OnSignatureAddListener {
     fun onSignatureAdd(path: String)

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureClickListener.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.signature
 
 interface OnSignatureClickListener {
     fun onSignatureClick(path: String)

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnSignatureRemoveListener.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.signature
 
 interface OnSignatureRemoveListener {
     fun onSignatureRemove(path: String)

+ 1 - 2
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureAdapter.kt

@@ -1,9 +1,8 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.signature
 
 import android.content.Context
 import android.graphics.Bitmap
 import android.graphics.BitmapFactory
-import android.graphics.Color
 import android.graphics.Matrix
 import android.support.v4.util.LruCache
 import android.support.v7.widget.RecyclerView

+ 2 - 2
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureRecyclerViewItemDecoration.kt

@@ -1,8 +1,8 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.signature
 
 import android.graphics.Rect
-import android.view.View
 import android.support.v7.widget.RecyclerView
+import android.view.View
 
 
 class SignatureRecyclerViewItemDecoration(private val space: Int, private val additionalPadding: Int) : RecyclerView.ItemDecoration() {

+ 6 - 6
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureTabView.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.signature
 
 import android.content.Context
 import android.content.Intent
@@ -9,18 +9,18 @@ import android.view.LayoutInflater
 import android.view.View
 import com.kdanmobile.reader.Config
 import com.kdanmobile.reader.R
-import com.kdanmobile.reader.screen.SignatureActivity
 import com.kdanmobile.reader.screen.data.SignatureAttribute
+import com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
+import com.kdanmobile.reader.screen.signature.SignatureActivity
+import com.kdanmobile.reader.utils.DensityUtil
 import kotlinx.android.synthetic.main.view_viewer_edit_tab_signature.view.*
 import java.io.File
 import java.util.*
-import android.support.v7.widget.DividerItemDecoration
-import com.kdanmobile.reader.utils.DensityUtil
 
 
 class SignatureTabView : ConstraintLayout {
 
-    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+    var onMediaBoxHeaderClickListener: MediaBoxHeader.OnTitleButtonClickListener? = null
 
     private lateinit var signaturePaths: ArrayList<String>
     private lateinit var selectedSignaturePath: String
@@ -48,7 +48,7 @@ class SignatureTabView : ConstraintLayout {
         adapter.setOnSignatureClickListener(object : OnSignatureClickListener {
             override fun onSignatureClick(path: String) {
                 selectedSignaturePath = path
-                onTitleButtonClickListener?.onTitleButtonClick()
+                onMediaBoxHeaderClickListener?.onTitleButtonClick()
             }
         })
         adapter.setOnSignatureRemoveListener(object : OnSignatureRemoveListener {

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampAdapter.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.stamp
 
 import android.content.Context
 import android.support.v7.widget.RecyclerView

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/CustomStampType.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.stamp
 
 import com.kdanmobile.kmpdfkit.annotation.stamp.StampConfig
 import com.kdanmobile.kmpdfkit.annotation.stamp.view.KMPDFStampTextView

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/OnStampClickListener.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.stamp
 
 interface OnStampClickListener {
     fun onStampClick(index: Int)

+ 3 - 2
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StampTabView.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.stamp
 
 import android.content.Context
 import android.graphics.Rect
@@ -15,6 +15,7 @@ import com.kdanmobile.kmpdfkit.annotation.stamp.TextStampConfig
 import com.kdanmobile.kmpdfkit.annotation.stamp.view.KMPDFStampTextView
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.screen.data.StampAttribute
+import com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
 import kotlinx.android.synthetic.main.view_viewer_edit_item_stamp_custom.view.*
 import kotlinx.android.synthetic.main.view_viewer_edit_item_stamp_standard.view.*
 import kotlinx.android.synthetic.main.view_viewer_edit_tab_stamp.view.*
@@ -26,7 +27,7 @@ class StampTabView : ConstraintLayout {
     private var selectedCustomStampIndex = 0
     private var selectedStandardStampIndex = 0
 
-    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+    var onMediaBoxHeaderClickListener: MediaBoxHeader.OnTitleButtonClickListener? = null
         set(value) {
             field = value
             titleButton_stamp?.onTitleButtonClickListener = field

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/StandardStampAdapter.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.stamp
 
 import android.content.Context
 import android.support.v7.widget.RecyclerView

+ 1 - 1
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextAttrView.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.textbox
 
 import android.content.Context
 import android.graphics.PorterDuff

+ 3 - 2
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/TextBoxTabView.kt

@@ -1,4 +1,4 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.reader.mediabox.textbox
 
 import android.content.Context
 import android.graphics.Typeface
@@ -8,12 +8,13 @@ import android.view.LayoutInflater
 import android.widget.SeekBar
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.screen.data.TextBoxAttribute
+import com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
 import com.kdanmobile.reader.screen.view.ColorSelectView
 import kotlinx.android.synthetic.main.view_viewer_edit_tab_text_box.view.*
 
 class TextBoxTabView : ConstraintLayout {
 
-    var onTitleButtonClickListener: TitleButton.OnTitleButtonClickListener? = null
+    var onMediaBoxHeaderClickListener: MediaBoxHeader.OnTitleButtonClickListener? = null
         set(value) {
             field = value
             titleButton_textBox?.onTitleButtonClickListener = field

+ 6 - 7
reader/src/main/java/com/kdanmobile/reader/screen/SignatureActivity.kt

@@ -1,18 +1,17 @@
-package com.kdanmobile.reader.screen
+package com.kdanmobile.reader.screen.signature
 
-import android.support.v7.app.AppCompatActivity
+import android.graphics.Bitmap
 import android.os.Bundle
+import android.support.v4.content.ContextCompat
+import android.support.v7.app.AppCompatActivity
 import android.view.MenuItem
 import android.view.View
 import android.widget.SeekBar
+import com.kdanmobile.reader.Config
 import com.kdanmobile.reader.R
+import com.kdanmobile.reader.screen.reader.mediabox.signature.OnSignatureAddListener
 import com.kdanmobile.reader.screen.view.ColorSelectView
-import com.kdanmobile.reader.screen.view.edit.SignatureDrawView
 import kotlinx.android.synthetic.main.activity_view_signature_create.*
-import android.graphics.Bitmap
-import android.support.v4.content.ContextCompat
-import com.kdanmobile.reader.Config
-import com.kdanmobile.reader.screen.view.edit.OnSignatureAddListener
 import java.io.File
 import java.io.FileOutputStream
 import java.io.IOException

+ 4 - 5
reader/src/main/java/com/kdanmobile/reader/screen/view/edit/SignatureDrawView.kt

@@ -1,16 +1,15 @@
-package com.kdanmobile.reader.screen.view.edit
+package com.kdanmobile.reader.screen.signature
 
 import android.content.Context
 import android.graphics.Bitmap
 import android.graphics.Canvas
 import android.graphics.Paint
-import android.graphics.Path
-import android.util.AttributeSet
-import android.view.View
 import android.graphics.Paint.Cap
+import android.graphics.Path
 import android.support.v4.content.ContextCompat
+import android.util.AttributeSet
 import android.view.MotionEvent
-
+import android.view.View
 
 
 class SignatureDrawView : View {

+ 1 - 1
reader/src/main/res/layout/activity_reader.xml

@@ -293,7 +293,7 @@
             />
     </android.support.constraint.ConstraintLayout>
 
-    <com.kdanmobile.reader.screen.view.ViewerEditView
+    <com.kdanmobile.reader.screen.reader.mediabox.MediaBoxView
         android:id="@+id/viewerEditView"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />

+ 2 - 2
reader/src/main/res/layout/activity_view_signature_create.xml

@@ -49,7 +49,7 @@
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent" />
 
-    <com.kdanmobile.reader.screen.view.edit.SignatureDrawView
+    <com.kdanmobile.reader.screen.signature.SignatureDrawView
         android:id="@+id/drawView"
         android:layout_width="match_parent"
         android:layout_height="0dp"
@@ -89,7 +89,7 @@
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toLeftOf="@+id/guideline" />
 
-    <com.kdanmobile.reader.screen.view.edit.TextSeekBar
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxSeekBar
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:id="@+id/seekBar_signature"

+ 9 - 9
reader/src/main/res/layout/view_viewer_edit.xml

@@ -8,7 +8,7 @@
 
     <android.support.constraint.ConstraintLayout
         style="@style/MediaBoxStyle"
-        android:id="@+id/view_viewEdit_content"
+        android:id="@+id/view_mediaBox_dialog"
         tools:visibility="visible"
         tools:background="#AA00CC"
         android:visibility="invisible"
@@ -19,29 +19,29 @@
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent">
 
-        <com.kdanmobile.reader.screen.view.ViewerEditTabView
-            android:id="@+id/viewerEdit_tab"
+        <com.kdanmobile.reader.screen.reader.mediabox.MediaBoxTabView
+            android:id="@+id/mediaBoxTabView_mediaBox_tab"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginLeft="4dp"
             android:layout_marginStart="4dp"
             app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="@id/view_viewerEdit_divider"
+            app:layout_constraintRight_toRightOf="@id/view_mediaBox_divider"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
         <View
-            android:id="@+id/view_viewerEdit_divider"
+            android:id="@+id/view_mediaBox_divider"
             android:background="#1e000000"
-            app:layout_constraintLeft_toRightOf="@+id/viewerEdit_tab"
-            app:layout_constraintRight_toLeftOf="@id/viewEdit_layout_tab_content"
+            app:layout_constraintLeft_toRightOf="@+id/mediaBoxTabView_mediaBox_tab"
+            app:layout_constraintRight_toLeftOf="@id/viewGroup_mediaBox_pageContainer"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintBottom_toBottomOf="parent"
             android:layout_width="1dp"
             android:layout_height="0dp" />
 
         <android.support.constraint.ConstraintLayout
-            android:id="@+id/viewEdit_layout_tab_content"
+            android:id="@+id/viewGroup_mediaBox_pageContainer"
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:layout_marginEnd="8dp"
@@ -49,7 +49,7 @@
             android:layout_marginTop="12dp"
             android:background="@android:color/darker_gray"
             app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintLeft_toRightOf="@+id/view_viewerEdit_divider"
+            app:layout_constraintLeft_toRightOf="@+id/view_mediaBox_divider"
             app:layout_constraintRight_toRightOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 

+ 2 - 2
reader/src/main/res/layout/view_viewer_edit_item_title_button.xml

@@ -8,7 +8,7 @@
     tools:parentTag="android.support.constraint.ConstraintLayout">
 
     <TextView
-        android:id="@+id/tv_title"
+        android:id="@+id/tv_mediaBoxHeader_title"
         style="@style/Base.TextAppearance.Widget.AppCompat.Toolbar.Subtitle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -21,7 +21,7 @@
         app:layout_constraintLeft_toLeftOf="parent" />
 
     <Button
-        android:id="@+id/btn_add"
+        android:id="@+id/btn_mediaBoxHeader_add"
         android:layout_width="wrap_content"
         android:layout_height="32dp"
         android:layout_marginEnd="16dp"

+ 9 - 9
reader/src/main/res/layout/view_viewer_edit_item_seekbar.xml

@@ -8,7 +8,7 @@
     tools:parentTag="android.support.constraint.ConstraintLayout">
 
     <TextView
-        android:id="@+id/tv_seekBarTitle"
+        android:id="@+id/tv_mediaBoxSeekBar_title"
         style="@style/Base.TextAppearance.Widget.AppCompat.Toolbar.Subtitle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -18,12 +18,12 @@
         android:textColor="#de000000"
         android:text="Size"
         android:textSize="12sp"
-        app:layout_constraintBottom_toTopOf="@+id/seekBar"
+        app:layout_constraintBottom_toTopOf="@+id/seekBar_mediaBoxSeekBar"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
     <SeekBar
-        android:id="@+id/seekBar"
+        android:id="@+id/seekBar_mediaBoxSeekBar"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_marginLeft="16dp"
@@ -34,11 +34,11 @@
         android:thumbTint="#0077fd"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toLeftOf="@+id/tv_seekBarValue"
-        app:layout_constraintTop_toBottomOf="@+id/tv_seekBarTitle" />
+        app:layout_constraintRight_toLeftOf="@+id/tv_mediaBoxSeekBar_value"
+        app:layout_constraintTop_toBottomOf="@+id/tv_mediaBoxSeekBar_title" />
 
     <TextView
-        android:id="@+id/tv_seekBarValue"
+        android:id="@+id/tv_mediaBoxSeekBar_value"
         android:layout_width="36dp"
         android:layout_height="wrap_content"
         android:gravity="end"
@@ -47,9 +47,9 @@
         android:textColor="#61000000"
         android:text="24pt"
         android:textSize="12sp"
-        app:layout_constraintBottom_toBottomOf="@+id/seekBar"
-        app:layout_constraintLeft_toRightOf="@+id/seekBar"
+        app:layout_constraintBottom_toBottomOf="@+id/seekBar_mediaBoxSeekBar"
+        app:layout_constraintLeft_toRightOf="@+id/seekBar_mediaBoxSeekBar"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/seekBar" />
+        app:layout_constraintTop_toTopOf="@+id/seekBar_mediaBoxSeekBar" />
 
 </merge>

+ 9 - 9
reader/src/main/res/layout/view_viewer_edit_tab.xml

@@ -5,46 +5,46 @@
     android:layout_height="match_parent">
 
     <ImageButton
-        android:id="@+id/viewerEdit_tab_textBox"
+        android:id="@+id/ib_mediaBoxTab_textBox"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:background="@null"
         android:src="@drawable/ic_textbox" />
 
     <ImageButton
-        android:id="@+id/viewerEdit_tab_signature"
+        android:id="@+id/ib_mediaBoxTab_signature"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginTop="8dp"
         android:background="@null"
         android:src="@drawable/ic_signature"
-        app:layout_constraintTop_toBottomOf="@+id/viewerEdit_tab_textBox" />
+        app:layout_constraintTop_toBottomOf="@+id/ib_mediaBoxTab_textBox" />
 
     <ImageButton
-        android:id="@+id/viewerEdit_tab_stamp"
+        android:id="@+id/ib_mediaBoxTab_stamp"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginTop="8dp"
         android:background="@null"
         android:src="@drawable/ic_stamp"
-        app:layout_constraintTop_toBottomOf="@id/viewerEdit_tab_signature" />
+        app:layout_constraintTop_toBottomOf="@id/ib_mediaBoxTab_signature" />
 
     <ImageButton
-        android:id="@+id/viewerEdit_tab_shape"
+        android:id="@+id/ib_mediaBoxTab_shape"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginTop="8dp"
         android:background="@null"
         android:src="@drawable/ic_shape"
-        app:layout_constraintTop_toBottomOf="@+id/viewerEdit_tab_stamp" />
+        app:layout_constraintTop_toBottomOf="@+id/ib_mediaBoxTab_stamp" />
 
     <ImageButton
-        android:id="@+id/viewerEdit_tab_form"
+        android:id="@+id/ib_mediaBoxTab_form"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginTop="8dp"
         android:background="@null"
         android:src="@drawable/ic_form"
-        app:layout_constraintTop_toBottomOf="@+id/viewerEdit_tab_shape" />
+        app:layout_constraintTop_toBottomOf="@+id/ib_mediaBoxTab_shape" />
 
 </android.support.constraint.ConstraintLayout>

+ 2 - 2
reader/src/main/res/layout/view_viewer_edit_item_shape_border.xml

@@ -15,7 +15,7 @@
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintBottom_toTopOf="@+id/seekBar_shapeBorder_opacity" />
 
-    <com.kdanmobile.reader.screen.view.edit.TextSeekBar
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxSeekBar
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/seekBar_shapeBorder_opacity"
@@ -30,7 +30,7 @@
         app:layout_constraintTop_toBottomOf="@+id/colorChooser_shapeBorder"
         app:layout_constraintBottom_toTopOf="@+id/seekBar_shapeBorder_thickness" />
 
-    <com.kdanmobile.reader.screen.view.edit.TextSeekBar
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxSeekBar
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/seekBar_shapeBorder_thickness"

+ 1 - 1
reader/src/main/res/layout/view_viewer_edit_item_shape_fill.xml

@@ -15,7 +15,7 @@
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintBottom_toTopOf="@+id/seekBar_shapeFill_opacity" />
 
-    <com.kdanmobile.reader.screen.view.edit.TextSeekBar
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxSeekBar
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/seekBar_shapeFill_opacity"

+ 1 - 1
reader/src/main/res/layout/view_viewer_edit_tab_shape.xml

@@ -7,7 +7,7 @@
     android:focusable="true"
     android:background="#FFFFFFFF">
 
-    <com.kdanmobile.reader.screen.view.edit.TitleButton
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
         android:layout_width="match_parent"
         android:layout_height="56dp"
         android:id="@+id/titleButton_shape"

+ 1 - 1
reader/src/main/res/layout/view_viewer_edit_tab_stamp.xml

@@ -7,7 +7,7 @@
     android:focusable="true"
     android:background="#FFFFFFFF">
 
-    <com.kdanmobile.reader.screen.view.edit.TitleButton
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
         android:layout_width="match_parent"
         android:layout_height="56dp"
         android:id="@+id/titleButton_stamp"

+ 3 - 3
reader/src/main/res/layout/view_viewer_edit_tab_text_box.xml

@@ -7,7 +7,7 @@
     android:focusable="true"
     android:background="#FFFFFFFF">
 
-    <com.kdanmobile.reader.screen.view.edit.TitleButton
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
         android:layout_width="match_parent"
         android:layout_height="56dp"
         android:id="@+id/titleButton_textBox"
@@ -47,7 +47,7 @@
             app:layout_constraintBottom_toBottomOf="parent" />
     </android.support.constraint.ConstraintLayout>
 
-    <com.kdanmobile.reader.screen.view.edit.TextAttrView
+    <com.kdanmobile.reader.screen.reader.mediabox.textbox.TextAttrView
         android:layout_width="match_parent"
         android:layout_height="48dp"
         android:id="@+id/textAttrView_textBox"
@@ -68,7 +68,7 @@
         app:layout_constraintTop_toBottomOf="@+id/textAttrView_textBox"
         app:layout_constraintBottom_toTopOf="@+id/seekBar_textBox_textSize" />
 
-    <com.kdanmobile.reader.screen.view.edit.TextSeekBar
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxSeekBar
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/seekBar_textBox_textSize"

+ 2 - 2
reader/src/main/res/values/attrs.xml

@@ -8,7 +8,7 @@
 
     <attr name="title" format="string" />
 
-    <declare-styleable name="TextSeekBar">
+    <declare-styleable name="MediaBoxSeekBar">
         <attr name="title" />
         <attr name="unit" format="string" />
         <attr name="maxValue" format="integer" />
@@ -16,7 +16,7 @@
         <attr name="initValue" format="integer" />
     </declare-styleable>
 
-    <declare-styleable name="TitleButton">
+    <declare-styleable name="MediaBoxHeader">
         <attr name="title" />
         <attr name="buttonText" format="string" />
     </declare-styleable>