File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
library_tagflow/src/main/java/com/framework/tagflow Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ abstract class BaseTagAdapter<T> : BaseAdapter() {
5959 return
6060 }
6161 if (dataList[position] is BaseTagBean ){
62- (dataList[position] as BaseTagBean ).setSelected (true )
62+ (dataList[position] as BaseTagBean ).setIsSelected (true )
6363 }
6464 }
6565
@@ -71,7 +71,7 @@ abstract class BaseTagAdapter<T> : BaseAdapter() {
7171 return
7272 }
7373 if (dataList[position] is BaseTagBean ){
74- (dataList[position] as BaseTagBean ).setSelected (false )
74+ (dataList[position] as BaseTagBean ).setIsSelected (false )
7575 }
7676
7777 }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ package com.framework.tagflow.bean
99open class BaseTagBean {
1010 private var id = 0
1111 private var name: String? = null
12- private var selected = false // 是否选中
12+ private var isSelected = false // 是否选中
1313 private var tag: Any? = null // 标签额外信息
1414
1515 fun getId (): Int {
@@ -37,10 +37,10 @@ open class BaseTagBean {
3737 }
3838
3939 fun isSelected (): Boolean {
40- return selected
40+ return isSelected
4141 }
4242
43- fun setSelected (selected : Boolean ) {
44- this .selected = selected
43+ fun setIsSelected (selected : Boolean ) {
44+ this .isSelected = selected
4545 }
4646}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import android.util.AttributeSet
88import android.view.Gravity
99import androidx.annotation.ColorInt
1010import androidx.appcompat.widget.AppCompatTextView
11+ import androidx.core.content.ContextCompat
1112import com.framework.tagflow.utils.DensityUtils
1213import com.framework.tagflow.R
1314
@@ -52,7 +53,7 @@ open class DefaultTagView @JvmOverloads constructor(
5253 // 返回一个Drawable背景样式
5354 protected open fun getBackgroundDrawable (): Drawable ? {
5455 // 设置字体颜色的选择器
55- val colorSateList = mContext.resources. getColorStateList(R .color.secondary_text)
56+ val colorSateList = ContextCompat . getColorStateList(context, R .color.secondary_text)
5657 setTextColor(colorSateList)
5758 val normal = GradientDrawable ()
5859 normal.shape = GradientDrawable .RECTANGLE
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable
66import android.graphics.drawable.GradientDrawable
77import android.graphics.drawable.StateListDrawable
88import android.util.AttributeSet
9+ import androidx.core.content.ContextCompat
910import com.framework.tagflow.utils.DensityUtils
1011import com.framework.tagflow.R
1112
@@ -29,7 +30,7 @@ class MutSelectedTagView : DefaultTagView {
2930
3031 override fun getBackgroundDrawable (): Drawable ? {
3132 // 设置字体颜色的选择器
32- val colorSateList = mContext.resources. getColorStateList(R .color.secondary_text)
33+ val colorSateList = ContextCompat . getColorStateList(context, R .color.secondary_text)
3334 setTextColor(colorSateList)
3435 val normal = GradientDrawable ()
3536 normal.shape = GradientDrawable .RECTANGLE
You can’t perform that action at this time.
0 commit comments