|
24 | 24 |
|
25 | 25 | package com.phantomvk.vkit.bubble |
26 | 26 |
|
| 27 | +import android.content.Context |
27 | 28 | import android.graphics.* |
28 | 29 | import androidx.annotation.ColorInt |
29 | | - |
30 | | -class BubbleDrawer(@Direction var arrowDirection: Int = Direction.START, |
31 | | - var arrowWidth: Float = 18F, |
32 | | - var arrowHeight: Float = 36F, |
33 | | - var arrowMarginTop: Float = 12F, |
34 | | - var cornerRadius: Float = 30F, |
35 | | - var strokeOffset: Float = 3F, |
| 30 | +import com.phantomvk.vkit.util.dip |
| 31 | + |
| 32 | +class BubbleDrawer(var context: Context, |
| 33 | + @Direction var arrowDirection: Int = Direction.START, |
| 34 | + var arrowWidth: Float = context.dip(6F), |
| 35 | + var arrowHeight: Float = context.dip(12F), |
| 36 | + var arrowMarginTop: Float = context.dip(4F), |
| 37 | + var cornerRadius: Float = context.dip(10F), |
| 38 | + var strokeOffset: Float = context.dip(1F), |
36 | 39 | @ColorInt var strokeColor: Int = 0xFFCFCFCF.toInt()) { |
37 | 40 |
|
38 | 41 | private val path = Path() |
|
0 commit comments