package com.kdanmobile.reader.view

import android.content.Context
import android.os.Build
import android.support.v4.content.ContextCompat
import android.widget.PopupWindow
import com.kdanmobile.reader.R

class AnnotationAttributeWindow(context: Context, isSimpleMode: Boolean) : PopupWindow(context) {
    val annotationAttributeView: AnnotationAttributeView

    init {
        isOutsideTouchable = 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.isSimpleMode = isSimpleMode
        contentView = annotationAttributeView
    }
}