[add] 四个蒙层角渐变动画

This commit is contained in:
liujing
2022-04-14 18:32:54 +08:00
parent e72317b288
commit da1ddb084b
12 changed files with 54 additions and 70 deletions

View File

@@ -632,7 +632,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
* 闪动动画
*/
fun flicker(view: View) {
val alphaAnimation = AlphaAnimation(0f, 1.0f)
val alphaAnimation = AlphaAnimation(0f, 0.88f)
alphaAnimation.setDuration(600)
alphaAnimation.setInterpolator(LinearInterpolator())
alphaAnimation.setRepeatCount(Animation.INFINITE)

View File

@@ -130,7 +130,7 @@ class V2XWarningView @JvmOverloads constructor(
hmiWarningLeftImg.visibility = View.GONE
hmiWarningLeftTopImg.visibility = View.GONE
hmiWarningLeftBottomImg.visibility = View.GONE
hmiWarningRightTopImg.visibility = View.VISIBLE
hmiWarningRightTopImg.visibility = View.GONE
hmiWarningRightBottomImg.visibility = View.VISIBLE
}
ALERT_WARNING_BOTTOM_LEFT -> {
@@ -174,7 +174,11 @@ class V2XWarningView @JvmOverloads constructor(
removeCallbacks(closeWarningTask)
when (direction) {
ALERT_WARNING_TOP -> {
hmiWarningTopImg.visibility = View.GONE
// hmiWarningTopImg.visibility = View.GONE
hmiWarningRightTopImg.visibility = View.GONE
// hmiWarningLeftTopImg.visibility = View.GONE
// hmiWarningLeftBottomImg.visibility = View.GONE
// hmiWarningRightBottomImg.visibility = View.GONE
}
ALERT_WARNING_RIGHT -> {
hmiWarningRightImg.visibility = View.GONE

View File

@@ -8,7 +8,7 @@
<ImageView
android:id="@+id/hmiWarningTopImg"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_290"
android:layout_height="@dimen/dp_328"
android:background="@drawable/module_hmi_warning_bkg_top"
android:visibility="gone"
tools:visibility="invisible" />
@@ -16,7 +16,7 @@
<!--左方-->
<ImageView
android:id="@+id/hmiWarningLeftImg"
android:layout_width="@dimen/dp_290"
android:layout_width="@dimen/dp_328"
android:layout_height="match_parent"
android:background="@drawable/module_hmi_warning_bkg_left"
android:visibility="gone"
@@ -25,25 +25,25 @@
<!--左上角-->
<ImageView
android:id="@+id/hmiWarningLeftTopImg"
android:layout_width="@dimen/dp_730"
android:layout_width="@dimen/dp_1600"
android:layout_height="match_parent"
android:background="@drawable/module_hmi_warning_bkg_left_top"
android:background="@drawable/top_left"
android:visibility="gone"
tools:visibility="invisible" />
<!--左下角-->
<ImageView
android:id="@+id/hmiWarningLeftBottomImg"
android:layout_width="@dimen/dp_730"
android:layout_width="@dimen/dp_1600"
android:layout_height="match_parent"
android:background="@drawable/module_hmi_warning_bkg_left_top"
android:background="@drawable/bottom_left"
android:visibility="gone"
tools:visibility="invisible" />
<!--右方-->
<ImageView
android:id="@+id/hmiWarningRightImg"
android:layout_width="@dimen/dp_290"
android:layout_width="@dimen/dp_328"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@drawable/module_hmi_warning_bkg_right"
@@ -63,10 +63,10 @@
<!--右下角-->
<ImageView
android:id="@+id/hmiWarningRightBottomImg"
android:layout_width="@dimen/dp_730"
android:layout_height="@dimen/dp_730"
android:layout_width="@dimen/dp_1600"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@drawable/module_hmi_warning_bkg_right_bottom"
android:background="@drawable/bottom_right"
android:visibility="gone"
tools:visibility="invisible" />
@@ -74,7 +74,7 @@
<ImageView
android:id="@+id/hmiWarningBottomImg"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_290"
android:layout_height="@dimen/dp_328"
android:layout_gravity="bottom"
android:background="@drawable/module_hmi_warning_bkg_bottom"
android:visibility="gone"

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:width="@dimen/dp_1600"
android:height="@dimen/dp_1600" />
<gradient
android:angle="45"
android:centerX="0"
android:centerY="1"
android:endColor="#00F03232"
android:gradientRadius="@dimen/dp_1200"
android:startColor="@color/module_hmi_warning_bg_color"
android:type="radial" />
</shape>

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:width="@dimen/dp_1600"
android:height="@dimen/dp_1600" />
<gradient
android:angle="315"
android:centerX="0"
android:centerY="0"
android:endColor="@color/module_hmi_warning_bg_color_end"
android:gradientRadius="@dimen/dp_1200"
android:startColor="@color/module_hmi_warning_bg_color"
android:type="radial" />
</shape>

View File

@@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:width="@dimen/dp_1600"
android:height="@dimen/dp_1600" />
<gradient
android:angle="135"
android:centerX="0"
android:centerY="1"
android:endColor="@color/module_hmi_warning_bg_color_end"
android:gradientRadius="@dimen/dp_1200"
android:startColor="@color/module_hmi_warning_bg_color"
android:type="radial" />
</shape>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/shape_left_top">
<rotate
android:fromDegrees="150"
android:pivotX="0%"
android:pivotY="0%">
<shape android:shape="rectangle">
<size
android:width="@dimen/dp_1600"
android:height="@dimen/dp_1600" />
<gradient
android:endColor="@color/module_hmi_warning_bg_color"
android:startColor="@color/module_hmi_warning_bg_color_light" />
</shape>
</rotate>
</item>
</layer-list>

View File

@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:width="@dimen/dp_1600"
android:height="@dimen/dp_1600" />
<gradient
android:angle="45"
android:centerX="1"
android:centerY="0"
android:endColor="@color/module_hmi_warning_bg_color_end"
android:gradientRadius="@dimen/dp_1200"
android:startColor="@color/module_hmi_warning_bg_color"
android:type="radial" />
</shape>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/shape_right_top">
<rotate
android:fromDegrees="45"
android:pivotX="135%"
android:pivotY="90%"
android:toDegrees="45">
<shape android:shape="rectangle">
<gradient
android:endColor="@color/module_hmi_warning_bg_color_light"
android:startColor="@color/module_hmi_warning_bg_color" />
</shape>
</rotate>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

View File

@@ -6,8 +6,8 @@
<color name="module_switch_map_bg">#323C6F</color>
<color name="module_ext_color_voice_text">#FFFFFF</color>
<color name="module_hmi_warning_bg_color">#727F2503</color>
<color name="module_hmi_warning_bg_color_end">#007F2503</color>
<color name="module_hmi_warning_bg_color">#FFED6515</color>
<color name="module_hmi_warning_bg_color_light">#0F7F2503</color>
</resources>

View File

@@ -15,6 +15,7 @@
<dimen name="dp_144">144px</dimen>
<dimen name="dp_186">186px</dimen>
<dimen name="dp_300">300px</dimen>
<dimen name="dp_328">328px</dimen>
<dimen name="dp_730">730px</dimen>
<dimen name="dp_1600">1600px</dimen>
</resources>