|
@@ -1,8 +1,11 @@
|
|
package com.kdanmobile.reader.view
|
|
package com.kdanmobile.reader.view
|
|
|
|
|
|
import android.content.Context
|
|
import android.content.Context
|
|
|
|
+import android.graphics.Color
|
|
import android.os.Build
|
|
import android.os.Build
|
|
import android.support.v4.content.ContextCompat
|
|
import android.support.v4.content.ContextCompat
|
|
|
|
+import android.support.v7.widget.MyRoundRectDrawableWithShadow
|
|
|
|
+import android.widget.LinearLayout
|
|
import android.widget.PopupWindow
|
|
import android.widget.PopupWindow
|
|
import com.kdanmobile.reader.R
|
|
import com.kdanmobile.reader.R
|
|
|
|
|
|
@@ -10,14 +13,20 @@ class AnnotationAttributeWindow(context: Context, isSimpleMode: Boolean) : Popup
|
|
val annotationAttributeView: AnnotationAttributeView
|
|
val annotationAttributeView: AnnotationAttributeView
|
|
|
|
|
|
init {
|
|
init {
|
|
|
|
+ width = LinearLayout.LayoutParams.WRAP_CONTENT
|
|
|
|
+ height = LinearLayout.LayoutParams.WRAP_CONTENT
|
|
isOutsideTouchable = true
|
|
isOutsideTouchable = true
|
|
isFocusable = true
|
|
isFocusable = true
|
|
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
|
|
|
- elevation = context.resources.getDimension(R.dimen.reader_annotation_property_setting_window_elevation)
|
|
|
|
- }
|
|
|
|
- setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.bg_annotation_property_setting_window))
|
|
|
|
annotationAttributeView = AnnotationAttributeView(context)
|
|
annotationAttributeView = AnnotationAttributeView(context)
|
|
annotationAttributeView.isSimpleMode = isSimpleMode
|
|
annotationAttributeView.isSimpleMode = isSimpleMode
|
|
contentView = annotationAttributeView
|
|
contentView = annotationAttributeView
|
|
|
|
+
|
|
|
|
+ val elevationSize = context.resources.getDimension(R.dimen.reader_annotation_property_setting_window_elevation)
|
|
|
|
+ when {
|
|
|
|
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP -> elevation = elevationSize
|
|
|
|
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN -> contentView.background = MyRoundRectDrawableWithShadow(context.resources, Color.TRANSPARENT, 0f, elevationSize, elevationSize)
|
|
|
|
+ else -> contentView.setBackgroundDrawable(MyRoundRectDrawableWithShadow(context.resources, Color.TRANSPARENT, 0f, elevationSize, elevationSize))
|
|
|
|
+ }
|
|
|
|
+ setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.bg_annotation_property_setting_window))
|
|
}
|
|
}
|
|
}
|
|
}
|