Wayne vor 5 Jahren
Ursprung
Commit
9783a9291f

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

@@ -432,8 +432,8 @@ abstract class ReaderActivity : AppCompatActivity() {
                     viewModel.highLightAttributeLiveData.value?.let { attr ->
                         window.annotationAttributeView.annotationAttribute = attr
                     }
-                    window.annotationAttributeView.onPropertyChangeListener = object : AnnotationAttributeView.OnPropertyChangeListener {
-                        override fun onPropertyChange(annotationAttributeView: AnnotationAttributeView) {
+                    window.annotationAttributeView.onChangeListener = object : AnnotationAttributeView.OnChangeListener {
+                        override fun onChange(annotationAttributeView: AnnotationAttributeView) {
                             viewModel.setHighLightAttributes(annotationAttributeView.annotationAttribute)
                         }
                     }
@@ -459,8 +459,8 @@ abstract class ReaderActivity : AppCompatActivity() {
                     viewModel.strikeAttributeLiveData.value?.let { attr ->
                         window.annotationAttributeView.annotationAttribute = attr
                     }
-                    window.annotationAttributeView.onPropertyChangeListener = object : AnnotationAttributeView.OnPropertyChangeListener {
-                        override fun onPropertyChange(annotationAttributeView: AnnotationAttributeView) {
+                    window.annotationAttributeView.onChangeListener = object : AnnotationAttributeView.OnChangeListener {
+                        override fun onChange(annotationAttributeView: AnnotationAttributeView) {
                             viewModel.setStrikeOutAttributes(annotationAttributeView.annotationAttribute)
                         }
                     }
@@ -486,8 +486,8 @@ abstract class ReaderActivity : AppCompatActivity() {
                     viewModel.underLineAttributeLiveData.value?.let { attr ->
                         window.annotationAttributeView.annotationAttribute = attr
                     }
-                    window.annotationAttributeView.onPropertyChangeListener = object : AnnotationAttributeView.OnPropertyChangeListener {
-                        override fun onPropertyChange(annotationAttributeView: AnnotationAttributeView) {
+                    window.annotationAttributeView.onChangeListener = object : AnnotationAttributeView.OnChangeListener {
+                        override fun onChange(annotationAttributeView: AnnotationAttributeView) {
                             viewModel.setUnderLineAttributes(annotationAttributeView.annotationAttribute)
                         }
                     }
@@ -513,8 +513,8 @@ abstract class ReaderActivity : AppCompatActivity() {
                     viewModel.inkAttributeLiveData.value?.let { attr ->
                         window.annotationAttributeView.inkAttribute = attr
                     }
-                    window.annotationAttributeView.onPropertyChangeListener = object : AnnotationAttributeView.OnPropertyChangeListener {
-                        override fun onPropertyChange(annotationAttributeView: AnnotationAttributeView) {
+                    window.annotationAttributeView.onChangeListener = object : AnnotationAttributeView.OnChangeListener {
+                        override fun onChange(annotationAttributeView: AnnotationAttributeView) {
                             viewModel.setInkAttributes(annotationAttributeView.inkAttribute)
                         }
                     }

+ 6 - 6
reader/src/main/java/com/kdanmobile/reader/view/AnnotationAttributeView.kt

@@ -66,7 +66,7 @@ class AnnotationAttributeView @JvmOverloads constructor(
             field = value
             update()
         }
-    var onPropertyChangeListener: OnPropertyChangeListener? = null
+    var onChangeListener: OnChangeListener? = null
     private val colorBtnMap = HashMap<Color, ImageView>().apply {
         put(Color.Color1, iv_readerAnnotationProperty_color1)
         put(Color.Color2, iv_readerAnnotationProperty_color2)
@@ -118,7 +118,7 @@ class AnnotationAttributeView @JvmOverloads constructor(
             field = value
             updateColor()
             updateColorButtons()
-            onPropertyChangeListener?.onPropertyChange(this)
+            onChangeListener?.onChange(this)
         }
     private val colorWithAlpha: Int
         get() {
@@ -159,7 +159,7 @@ class AnnotationAttributeView @JvmOverloads constructor(
             }
 
             override fun onStopTrackingTouch(p0: SeekBar?) {
-                onPropertyChangeListener?.onPropertyChange(this@AnnotationAttributeView)
+                onChangeListener?.onChange(this@AnnotationAttributeView)
             }
         })
     }
@@ -202,7 +202,7 @@ class AnnotationAttributeView @JvmOverloads constructor(
 
             override fun onStopTrackingTouch(p0: SeekBar?) {
                 window.dismiss()
-                onPropertyChangeListener?.onPropertyChange(this@AnnotationAttributeView)
+                onChangeListener?.onChange(this@AnnotationAttributeView)
             }
 
             private fun calculateOffsetX(seekBar: SeekBar): Int {
@@ -272,7 +272,7 @@ class AnnotationAttributeView @JvmOverloads constructor(
         }
     }
 
-    interface OnPropertyChangeListener {
-        fun onPropertyChange(annotationAttributeView: AnnotationAttributeView)
+    interface OnChangeListener {
+        fun onChange(annotationAttributeView: AnnotationAttributeView)
     }
 }