|
@@ -4,13 +4,10 @@ import android.content.Context
|
|
|
import android.support.v4.graphics.ColorUtils
|
|
|
import android.util.AttributeSet
|
|
|
import android.view.View
|
|
|
-import android.view.ViewGroup
|
|
|
import android.widget.ImageView
|
|
|
import android.widget.LinearLayout
|
|
|
-import android.widget.PopupWindow
|
|
|
import android.widget.SeekBar
|
|
|
import com.kdanmobile.reader.R
|
|
|
-import com.kdanmobile.reader.Utils
|
|
|
import com.kdanmobile.reader.annotationattribute.AnnotationAttribute
|
|
|
import com.kdanmobile.reader.annotationattribute.AnnotationColor
|
|
|
import com.kdanmobile.reader.annotationattribute.Brush
|
|
@@ -164,6 +161,8 @@ class AnnotationAttributeView @JvmOverloads constructor(
|
|
|
|
|
|
private fun setupOpacitySeekBar() {
|
|
|
seekBar_readerAnnotationProperty_opacity.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
|
|
+ /** Hide display view now (1/5) **/
|
|
|
+ /*
|
|
|
val colorDisplayerView = ColorOpacityDisplayerView(context)
|
|
|
val windowW = ViewGroup.LayoutParams.WRAP_CONTENT
|
|
|
val windowH = ViewGroup.LayoutParams.WRAP_CONTENT
|
|
@@ -175,28 +174,40 @@ class AnnotationAttributeView @JvmOverloads constructor(
|
|
|
val h = Utils.makeDropDownMeasureSpec(window.height)
|
|
|
measure(w, h)
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
override fun onProgressChanged(seekBar: SeekBar, progress: Int, p2: Boolean) {
|
|
|
opacity = progress
|
|
|
+ updateOpacity()
|
|
|
+ /** Hide display view now (2/5) **/
|
|
|
+ /*
|
|
|
val x = calculateOffsetX(seekBar)
|
|
|
val y = calculateOffsetY(seekBar)
|
|
|
window.update(seekBar, x, y, window.width, window.height)
|
|
|
- updateOpacity()
|
|
|
colorDisplayerView.color = colorWithAlpha
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
|
|
+ /** Hide display view now (3/5) **/
|
|
|
+ /*
|
|
|
val x = calculateOffsetX(seekBar)
|
|
|
val y = calculateOffsetY(seekBar)
|
|
|
colorDisplayerView.color = colorWithAlpha
|
|
|
window.showAsDropDown(seekBar, x, y)
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
override fun onStopTrackingTouch(p0: SeekBar?) {
|
|
|
+ /** Hide display view now (4/5) **/
|
|
|
+ /*
|
|
|
window.dismiss()
|
|
|
+ */
|
|
|
onChangeListener?.onChange(this@AnnotationAttributeView)
|
|
|
}
|
|
|
|
|
|
+ /** Hide display view now (5/5) **/
|
|
|
+ /*
|
|
|
private fun calculateOffsetX(seekBar: SeekBar): Int {
|
|
|
val seekBarLineWidth = seekBar.width - seekBar.paddingLeft - seekBar.paddingRight
|
|
|
val progress = seekBar.progress.toFloat() / seekBar.max.toFloat()
|
|
@@ -206,6 +217,7 @@ class AnnotationAttributeView @JvmOverloads constructor(
|
|
|
private fun calculateOffsetY(seekBar: SeekBar): Int {
|
|
|
return -seekBar.height - contentView.measuredHeight
|
|
|
}
|
|
|
+ */
|
|
|
})
|
|
|
}
|
|
|
|