[taxi_p]
[shadow video correct]
This commit is contained in:
yangyakun
2024-01-04 18:49:42 +08:00
parent adaf61a4d8
commit bc4ac135f1
3 changed files with 16 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ public class OCHBorderShadowLayout extends LinearLayout {
public static final float SHADOW_DEFAULT_RADIUS = DimenUtil.INSTANCE.dp2px(5);
//阴影最大偏移量
public static final float SHADOW_MAX_OFFSET = DimenUtil.INSTANCE.dp2px(20);
public static final float SHADOW_MAX_OFFSET = DimenUtil.INSTANCE.dp2px(90);
//阴影最大模糊半径
public static final float SHADOW_MAX_BLUR = DimenUtil.INSTANCE.dp2px(90);
@@ -57,6 +57,10 @@ public class OCHBorderShadowLayout extends LinearLayout {
//竖直方向位移
private float yOffset = DimenUtil.INSTANCE.dp2px(10);
//横向修正
private float blurCorrectX = DimenUtil.INSTANCE.dp2px(0);
//纵向修正
private float blurCorrectY = DimenUtil.INSTANCE.dp2px(0);
//背景色
private int bgColor = Color.WHITE;
@@ -93,6 +97,8 @@ public class OCHBorderShadowLayout extends LinearLayout {
hasEffect = typedArray.getBoolean(R.styleable.ShadowLayout_hasEffect, false);
xOffset = typedArray.getDimension(R.styleable.ShadowLayout_xOffset,DimenUtil.INSTANCE.dp2px(10));
yOffset = typedArray.getDimension(R.styleable.ShadowLayout_yOffset,DimenUtil.INSTANCE.dp2px(10));
blurCorrectX = typedArray.getDimension(R.styleable.ShadowLayout_blurCorrectX,DimenUtil.INSTANCE.dp2px(0));
blurCorrectY = typedArray.getDimension(R.styleable.ShadowLayout_blurCorrectY,DimenUtil.INSTANCE.dp2px(0));
bgColor = typedArray.getColor(R.styleable.ShadowLayout_bgColor,Color.WHITE);
shadowPosition = typedArray.getInt(R.styleable.ShadowLayout_shadow_position,0);
typedArray.recycle();
@@ -231,7 +237,7 @@ public class OCHBorderShadowLayout extends LinearLayout {
mPaint.setColor(shadowColor);
mPaint.setAntiAlias(true);
RectF shadowRect = new RectF(startX,startY,endX,endY);
RectF shadowRect = new RectF(startX+blurCorrectX,startY+blurCorrectY,endX-blurCorrectX,endY-blurCorrectY);
RectF locationRectF = new RectF(left,top,mWidthMode-right,mHeightMode-bottom);
if (shadowRadius==0){

View File

@@ -24,6 +24,10 @@
<attr name="xOffset" format="dimension"/>
<!--竖直位移 -->
<attr name="yOffset" format="dimension"/>
<!--横向修正 -->
<attr name="blurCorrectX" format="dimension"/>
<!--纵向向修正 -->
<attr name="blurCorrectY" format="dimension"/>
<!-- -->
<attr name="shadow_position" format="enum">
<enum name="normal" value="0" />

View File

@@ -14,6 +14,8 @@
app:shadowColor="#A63F5388"
app:shadowRadius="@dimen/dp_36"
app:shadow_position="outer"
app:blurCorrectX="20dp"
app:blurCorrectY="30dp"
app:xOffset="0dp"
app:yOffset="0dp"/>
@@ -23,8 +25,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@drawable/taxi_p_video_light_bg_shape"
android:layout_width="1682dp"
android:layout_height="@dimen/dp_991" />
android:layout_width="1642dp"
android:layout_height="@dimen/dp_931" />
<com.mogo.och.taxi.passenger.widget.ConsultVideoPlayer
android:id="@+id/video_item_player"