结束页面的阴影处理和上下高光

This commit is contained in:
yangyakun
2022-05-16 10:28:35 +08:00
parent 160a2b9dc6
commit 519af11cac
6 changed files with 116 additions and 63 deletions

View File

@@ -43,7 +43,8 @@ public class OCHBorderShadowLayout extends LinearLayout {
//阴影颜色
private int shadowColor = Color.parseColor("#333333");
//阴影的位置
private int shadowPosition = 0;
//阴影半径
private float shadowRadius = 0f;
@@ -93,6 +94,7 @@ public class OCHBorderShadowLayout extends LinearLayout {
xOffset = typedArray.getDimension(R.styleable.ShadowLayout_xOffset,DimenUtil.INSTANCE.dp2px(10));
yOffset = typedArray.getDimension(R.styleable.ShadowLayout_yOffset,DimenUtil.INSTANCE.dp2px(10));
bgColor = typedArray.getColor(R.styleable.ShadowLayout_bgColor,Color.WHITE);
shadowPosition = typedArray.getInt(R.styleable.ShadowLayout_shadow_position,0);
typedArray.recycle();
if (shadowRadius<0){
@@ -208,7 +210,23 @@ public class OCHBorderShadowLayout extends LinearLayout {
}
// mPaint.setShadowLayer(blurRadius,0,0,shadowColor);
if (blurRadius>0){
mPaint.setMaskFilter(new BlurMaskFilter(blurRadius,BlurMaskFilter.Blur.NORMAL));
switch (shadowPosition){
case 0:
mPaint.setMaskFilter(new BlurMaskFilter(blurRadius,BlurMaskFilter.Blur.NORMAL));
break;
case 1:
mPaint.setMaskFilter(new BlurMaskFilter(blurRadius,BlurMaskFilter.Blur.SOLID));
break;
case 2:
mPaint.setMaskFilter(new BlurMaskFilter(blurRadius,BlurMaskFilter.Blur.OUTER));
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mPaint.setStrokeWidth(0);
break;
case 3:
mPaint.setMaskFilter(new BlurMaskFilter(blurRadius,BlurMaskFilter.Blur.INNER));
break;
default:
}
}
mPaint.setColor(shadowColor);
mPaint.setAntiAlias(true);

View File

@@ -24,7 +24,13 @@
<attr name="xOffset" format="dimension"/>
<!--竖直位移 -->
<attr name="yOffset" format="dimension"/>
<!-- -->
<attr name="shadow_position" format="enum">
<enum name="normal" value="0" />
<enum name="solid" value="1" />
<enum name="outer" value="2" />
<enum name="inner" value="3" />
</attr>
</declare-styleable>
<!--CardView -->

View File

@@ -184,6 +184,9 @@ class TaxiPassengerCheckView :RelativeLayout, View.OnClickListener {
for(i in numSelect.indices){
numSelect[i] = null
}
numSelectTextView.forEach {
it?.text = ""
}
}
companion object {

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -7,72 +7,98 @@
android:background="@drawable/taxi_p_arrive_end_panel_bg"
tools:ignore="MissingDefaultResource">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_867"
android:layout_height="@dimen/dp_657"
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_109"
android:layout_marginBottom="@dimen/dp_110"
app:bgColor="@color/taxi_p_map_bg"
app:blurRadius="@dimen/dp_60"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/bg_taxi_p_arrived_info"
app:layout_constraintStart_toStartOf="parent">
app:layout_constraintStart_toStartOf="parent"
app:shadowColor="#80000000"
app:shadowRadius="60px"
app:shadow_position="outer"
app:xOffset="0px"
app:yOffset="0px">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_867"
android:layout_height="@dimen/dp_657"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/bg_taxi_p_arrived_info"
app:layout_constraintStart_toStartOf="parent">
<ImageView
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/taxi_p_arrived_end_light"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ImageView
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/taxi_p_arrived_end_light"
app:layout_constraintStart_toStartOf="parent"
android:rotation="180"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<View
android:id="@+id/bg_taxi_p_arrived_info_yello_v"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/bg_taxi_p_arrived_info_yello_v"
android:layout_marginTop="@dimen/dp_86"
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_140"/>
<TextView
android:id="@+id/arrived_end_station_title"
app:layout_constraintTop_toTopOf="@+id/bg_taxi_p_arrived_info_yello_v"
app:layout_constraintStart_toEndOf="@+id/bg_taxi_p_arrived_info_yello_v"
android:text="已到达"
android:layout_marginStart="@dimen/dp_41"
android:textColor="@android:color/white"
android:textSize="@dimen/sp_46"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<View
android:id="@+id/bg_taxi_p_arrived_info_yello_v"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/bg_taxi_p_arrived_info_yello_v"
android:layout_marginTop="@dimen/dp_86"
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_140"/>
<TextView
android:id="@+id/arrived_end_station"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station_title"
app:layout_constraintStart_toStartOf="@+id/arrived_end_station_title"
android:layout_marginTop="@dimen/dp_31"
android:includeFontPadding="false"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_56"
android:textStyle="bold"
tools:text="环球贸易中心-北门"/>
<TextView
android:id="@+id/arrived_end_station_title"
app:layout_constraintTop_toTopOf="@+id/bg_taxi_p_arrived_info_yello_v"
app:layout_constraintStart_toEndOf="@+id/bg_taxi_p_arrived_info_yello_v"
android:text="已到达"
android:layout_marginStart="@dimen/dp_41"
android:textColor="@android:color/white"
android:textSize="@dimen/sp_46"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<View
android:id="@+id/v_line"
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station"
android:layout_marginTop="@dimen/dp_49"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginStart="@dimen/dp_60"
android:layout_marginEnd="@dimen/dp_60"
android:layout_width="0dp"
android:layout_height="1px"
android:background="@drawable/bg_taxi_p_arrived_info_line" />
<TextView
android:id="@+id/arrived_end_station"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station_title"
app:layout_constraintStart_toStartOf="@+id/arrived_end_station_title"
android:layout_marginTop="@dimen/dp_31"
android:includeFontPadding="false"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_56"
android:textStyle="bold"
tools:text="环球贸易中心-北门"/>
<View
android:id="@+id/v_line"
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station"
android:layout_marginTop="@dimen/dp_49"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginStart="@dimen/dp_60"
android:layout_marginEnd="@dimen/dp_60"
android:layout_width="0dp"
android:layout_height="1px"
android:background="@drawable/bg_taxi_p_arrived_info_line" />
<TextView
android:id="@+id/tv_please_score"
app:layout_constraintStart_toStartOf="@+id/arrived_end_station"
app:layout_constraintTop_toBottomOf="@+id/v_line"
android:layout_marginTop="@dimen/dp_52"
android:textColor="@android:color/white"
android:textSize="@dimen/sp_46"
android:text="请对本次行程评分"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv_please_score"
app:layout_constraintStart_toStartOf="@+id/arrived_end_station"
app:layout_constraintTop_toBottomOf="@+id/v_line"
android:layout_marginTop="@dimen/dp_52"
android:textColor="@android:color/white"
android:textSize="@dimen/sp_46"
android:text="请对本次行程评分"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
</androidx.constraintlayout.widget.ConstraintLayout>