Commit 6ff1d32b authored by yinjiacheng's avatar yinjiacheng

update 确认订单页、订单详情页、选择自提点页、选择代金券页TopBar

update 通用TopBar支持设置状态栏颜色
parent 0e269007
......@@ -118,6 +118,13 @@ class CommonTopBarView @JvmOverloads constructor(
setBackgroundColor(color)
}
/**
* 设置状态栏颜色
*/
fun setStatusBarColor(@ColorInt color: Int) {
updateStatusBarColor(color)
}
/**
* 设置返回按钮图标
*/
......@@ -191,10 +198,15 @@ class CommonTopBarView @JvmOverloads constructor(
override fun onGlobalLayout() {
// 设置StatusBar背景色
if (statusBarColor != 0) {
(context as Activity).window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
(context as Activity).window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
(context as Activity).window.statusBarColor = statusBarColor
updateStatusBarColor(statusBarColor)
}
viewTreeObserver.removeOnGlobalLayoutListener(this)
}
private fun updateStatusBarColor(@ColorInt color: Int) {
val context = context as Activity
context.window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
context.window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
context.window.statusBarColor = color
}
}
......@@ -22,12 +22,10 @@
android:id="@+id/common_top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:CommonTopBarView_back_img="@drawable/icon_back_white"
app:CommonTopBarView_bg_color="@color/color_FD7823"
app:CommonTopBarView_bg_color="@color/white"
app:CommonTopBarView_horizontal_padding="@dimen/dp10"
app:CommonTopBarView_statusBar_color="@color/color_FD7823"
app:CommonTopBarView_title_text="确认订单"
app:CommonTopBarView_title_text_color="@color/white" />
app:CommonTopBarView_statusBar_color="@color/white"
app:CommonTopBarView_title_text="确认订单" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
......
......@@ -18,12 +18,10 @@
android:id="@+id/bv_top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:CommonTopBarView_back_img="@drawable/icon_back_white"
app:CommonTopBarView_bg_color="@color/color_FD7823"
app:CommonTopBarView_bg_color="@color/white"
app:CommonTopBarView_horizontal_padding="@dimen/dp10"
app:CommonTopBarView_statusBar_color="@color/color_FD7823"
app:CommonTopBarView_statusBar_color="@color/white"
app:CommonTopBarView_title_text="@string/order_detail"
app:CommonTopBarView_title_text_color="@color/white"
app:layout_constraintTop_toTopOf="parent" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout
......
......@@ -25,12 +25,10 @@
android:id="@+id/bv_top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:CommonTopBarView_back_img="@drawable/icon_back_white"
app:CommonTopBarView_bg_color="@color/color_FD7823"
app:CommonTopBarView_bg_color="@color/white"
app:CommonTopBarView_horizontal_padding="@dimen/dp10"
app:CommonTopBarView_statusBar_color="@color/color_FD7823"
app:CommonTopBarView_statusBar_color="@color/white"
app:CommonTopBarView_title_text="@string/select_pickup_point"
app:CommonTopBarView_title_text_color="@color/white"
app:layout_constraintTop_toTopOf="parent" />
<com.yidian.shenghuoquan.buserorder.ui.widget.PickupPointSearchView
......
......@@ -21,12 +21,10 @@
android:id="@+id/common_top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:CommonTopBarView_back_img="@drawable/icon_back_white"
app:CommonTopBarView_bg_color="@color/color_FD7823"
app:CommonTopBarView_bg_color="@color/white"
app:CommonTopBarView_horizontal_padding="@dimen/dp10"
app:CommonTopBarView_statusBar_color="@color/color_FD7823"
app:CommonTopBarView_title_text="我的代金券"
app:CommonTopBarView_title_text_color="@color/white" />
app:CommonTopBarView_statusBar_color="@color/white"
app:CommonTopBarView_title_text="我的代金券" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_voucher_list"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment