1- package com.wpf.app.quick.helper.attribute
2-
3- import android.content.Context
4- import android.util.AttributeSet
5- import androidx.annotation.DrawableRes
6- import com.wpf.app.quick.R
7- import com.wpf.app.quick.constant.*
8- import com.wpf.app.quick.helper.attribute.base.AutoGetAttributeHelper
9-
10- /* *
11- * Created by 王朋飞 on 2022/4/29.
12- * Glide 参数配置帮助类
13- */
14- open class GlideAttributeHelper constructor(
15- context : Context ,
16- attributeSet : AttributeSet
17- ) : AutoGetAttributeHelper(context, attributeSet, R .styleable.GlideImageView ) {
18-
19- companion object {
20- const val asDrawable = 0
21- const val asBitmap = 1
22- const val asGif = 2
23- }
24-
25- var transcodeType: Int? = null
26- get() {
27- return when (field) {
28- 0 -> asDrawable
29- 1 -> asBitmap
30- 2 -> asGif
31- else -> asDrawable
32- }
33- }
34- var scaleType: Int? = null
35- get() {
36- return when (field) {
37- 0 -> MATRIX
38- 1 -> FIT_XY
39- 2 -> FIT_START
40- 3 -> FIT_CENTER
41- 4 -> FIT_END
42- 5 -> CENTER
43- 6 -> CENTER_CROP
44- 7 -> CENTER_INSIDE
45- 8 -> CIRCLE_CROP
46- else -> FIT_CENTER
47- }
48- }
49- var loadUrl: String? = null
50-
51- // 所有角
52- var roundedCorners = 0
53- // 左上圆角
54- var topLeftRadius = 0F
55- // 右上圆角
56- var topRightRadius = 0F
57- // 左下圆角
58- var bottomLeftRadius = 0F
59- // 右下圆角
60- var bottomRightRadius = 0F
61-
62- @DrawableRes
63- var placeholder: Int = 0
64-
65- @DrawableRes
66- var error: Int = 0
67- }
1+ // package com.wpf.app.quick.helper.attribute
2+ //
3+ // import android.content.Context
4+ // import android.util.AttributeSet
5+ // import androidx.annotation.DrawableRes
6+ // import com.wpf.app.quick.R
7+ // import com.wpf.app.quick.constant.*
8+ // import com.wpf.app.quick.helper.attribute.base.AutoGetAttributeHelper
9+ //
10+ // / **
11+ // * Created by 王朋飞 on 2022/4/29.
12+ // * Glide 参数配置帮助类
13+ // */
14+ // open class GlideAttributeHelper constructor(
15+ // context: Context,
16+ // attributeSet: AttributeSet
17+ // ) : AutoGetAttributeHelper(context, attributeSet, R.styleable.GlideImageView) {
18+ //
19+ // companion object {
20+ // const val asDrawable = 0
21+ // const val asBitmap = 1
22+ // const val asGif = 2
23+ // }
24+ //
25+ // var transcodeType:Int? = null
26+ // get() {
27+ // return when (field) {
28+ // 0 -> asDrawable
29+ // 1 -> asBitmap
30+ // 2 -> asGif
31+ // else -> asDrawable
32+ // }
33+ // }
34+ // var scaleType: Int? = null
35+ // get() {
36+ // return when (field) {
37+ // 0 -> MATRIX
38+ // 1 -> FIT_XY
39+ // 2 -> FIT_START
40+ // 3 -> FIT_CENTER
41+ // 4 -> FIT_END
42+ // 5 -> CENTER
43+ // 6 -> CENTER_CROP
44+ // 7 -> CENTER_INSIDE
45+ // 8 -> CIRCLE_CROP
46+ // else -> FIT_CENTER
47+ // }
48+ // }
49+ // var loadUrl: String? = null
50+ //
51+ // //所有角
52+ // var roundedCorners = 0
53+ // //左上圆角
54+ // var topLeftRadius = 0F
55+ // //右上圆角
56+ // var topRightRadius = 0F
57+ // //左下圆角
58+ // var bottomLeftRadius = 0F
59+ // //右下圆角
60+ // var bottomRightRadius = 0F
61+ //
62+ // @DrawableRes
63+ // var placeholder: Int = 0
64+ //
65+ // @DrawableRes
66+ // var error: Int = 0
67+ // }
0 commit comments