Forráskód Böngészése

Rename MediaBoxHeader

Wayne 5 éve
szülő
commit
89050c9c81

+ 5 - 5
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/ViewerEditView.kt

@@ -12,7 +12,7 @@ import android.view.View.OnClickListener
 import android.view.animation.AccelerateDecelerateInterpolator
 import android.widget.ImageButton
 import com.kdanmobile.reader.R
-import com.kdanmobile.reader.screen.reader.mediabox.common.TitleButton
+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
@@ -192,7 +192,7 @@ class ViewerEditView @JvmOverloads constructor(
             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 {
+            textBoxTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
                     onViewerEditTabAddButtonClickListener?.onTabTextBoxAddButtonClick(textBoxTabView)
                 }
@@ -206,7 +206,7 @@ class ViewerEditView @JvmOverloads constructor(
             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 {
+            signatureTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
                     onViewerEditTabAddButtonClickListener?.onTabSignatureAddButtonClick(signatureTabView)
                 }
@@ -220,7 +220,7 @@ class ViewerEditView @JvmOverloads constructor(
             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 {
+            stampTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
                     onViewerEditTabAddButtonClickListener?.onTabStampAddButtonClick(stampTabView)
                 }
@@ -234,7 +234,7 @@ class ViewerEditView @JvmOverloads constructor(
             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 {
+            shapeTabView.onMediaBoxHeaderClickListener = object: MediaBoxHeader.OnTitleButtonClickListener {
                 override fun onTitleButtonClick() {
                     onViewerEditTabAddButtonClickListener?.onTabShapeAddButtonClick(shapeTabView)
                 }

+ 9 - 9
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/common/TitleButton.kt

@@ -5,9 +5,9 @@ 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 {

+ 2 - 2
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/shape/ShapeTabView.kt

@@ -12,15 +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 com.kdanmobile.reader.screen.reader.mediabox.common.TitleButton
 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

+ 3 - 3
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/signature/SignatureTabView.kt

@@ -10,7 +10,7 @@ import android.view.View
 import com.kdanmobile.reader.Config
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.screen.data.SignatureAttribute
-import com.kdanmobile.reader.screen.reader.mediabox.common.TitleButton
+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.*
@@ -20,7 +20,7 @@ import java.util.*
 
 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 {

+ 2 - 2
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/stamp/StampTabView.kt

@@ -15,7 +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.TitleButton
+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.*
@@ -27,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

+ 2 - 2
reader/src/main/java/com/kdanmobile/reader/screen/reader/mediabox/textbox/TextBoxTabView.kt

@@ -8,13 +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.TitleButton
+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

+ 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"

+ 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.reader.mediabox.common.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.reader.mediabox.common.TitleButton
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
         android:layout_width="match_parent"
         android:layout_height="56dp"
         android:id="@+id/titleButton_stamp"

+ 1 - 1
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.reader.mediabox.common.TitleButton
+    <com.kdanmobile.reader.screen.reader.mediabox.common.MediaBoxHeader
         android:layout_width="match_parent"
         android:layout_height="56dp"
         android:id="@+id/titleButton_textBox"

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

@@ -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>