@@ -26,7 +26,8 @@ import java.util.*
2626/* *
2727 * 卡片 周视图 选择器
2828 */
29- open class CardWeekPickerDialog (context : Context ) : BottomSheetDialog(context), View.OnClickListener {
29+ open class CardWeekPickerDialog (context : Context ) : BottomSheetDialog(context),
30+ View .OnClickListener {
3031 companion object {
3132 const val CARD = 0 // 卡片
3233 const val CUBE = 1 // 方形
@@ -44,6 +45,8 @@ open class CardWeekPickerDialog(context: Context) : BottomSheetDialog(context),
4445 private val tv_submit by lazy { delegate.findViewById<TextView >(R .id.dialog_submit) }
4546 private val tv_title by lazy { delegate.findViewById<TextView >(R .id.tv_title) }
4647 private val linear_bg by lazy { delegate.findViewById<LinearLayout >(R .id.linear_bg) }
48+ private val divider_bottom by lazy { delegate.findViewById<View >(R .id.divider_bottom) }
49+ private val divider_line by lazy { delegate.findViewById<View >(R .id.dialog_select_border) }
4750
4851 private var mBehavior: BottomSheetBehavior <FrameLayout >? = null
4952
@@ -128,6 +131,19 @@ open class CardWeekPickerDialog(context: Context) : BottomSheetDialog(context),
128131 np_week!! .selectedTextColor = themeColor
129132 }
130133
134+ if (builder!! .assistColor != 0 ) {
135+ tv_title?.setTextColor(builder!! .assistColor)
136+ tv_cancel?.setTextColor(builder!! .assistColor)
137+ np_week!! .textColor = builder!! .assistColor
138+
139+
140+ }
141+ if (builder!! .dividerColor != 0 ) {
142+ divider_bottom?.setBackgroundColor(builder!! .dividerColor)
143+ divider_line?.setBackgroundColor(builder!! .dividerColor)
144+ np_week!! .dividerColor = builder!! .dividerColor
145+ }
146+
131147 }
132148
133149 // 视图周
@@ -194,6 +210,12 @@ open class CardWeekPickerDialog(context: Context) : BottomSheetDialog(context),
194210 @JvmField
195211 var themeColor: Int = 0
196212
213+ @JvmField
214+ var assistColor: Int = 0
215+
216+ @JvmField
217+ var dividerColor: Int = 0
218+
197219 @JvmField
198220 var wrapSelectorWheel: Boolean = true
199221
@@ -331,6 +353,24 @@ open class CardWeekPickerDialog(context: Context) : BottomSheetDialog(context),
331353 return this
332354 }
333355
356+ /* *
357+ * 这只dialog内辅助文字的颜色
358+ * @return Builder
359+ */
360+ fun setAssistColor (@ColorInt value : Int ): Builder {
361+ this .assistColor = value
362+ return this
363+ }
364+
365+ /* *
366+ * 这只dialog内分割线颜色
367+ * @return Builder
368+ */
369+ fun setDividerColor (@ColorInt value : Int ): Builder {
370+ this .dividerColor = value
371+ return this
372+ }
373+
334374 fun build (): CardWeekPickerDialog {
335375 return CardWeekPickerDialog (context, this )
336376 }
0 commit comments