[m2]
[ui调整]
This commit is contained in:
yangyakun
2023-04-11 17:09:19 +08:00
parent ea6cba2ee5
commit 7258c0ff07
16 changed files with 71 additions and 21 deletions

View File

@@ -20,7 +20,7 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
init {
hideWidget()
GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL)
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_16_9)
GSYVideoType.setRenderType(GSYVideoType.GLSURFACE)
}

View File

@@ -30,6 +30,11 @@ class AdvanceVideoView @JvmOverloads constructor(
private var videoRelativeLayout: RelativeLayout? = null
private var cacheImage: ImageView? = null
private var connerTopLeft: ImageView? = null
private var connerTopRight: ImageView? = null
private var connerBottomLeft: ImageView? = null
private var connerBottomRight: ImageView? = null
private var videoViewPlayer: AdvanceGSYVideoPlayer? = null
private var gsyVideoOptionBuilder: GSYVideoOptionBuilder? = null
private var mOnCompletionListener: GSYSampleCallBack? = null
@@ -57,24 +62,56 @@ class AdvanceVideoView @JvmOverloads constructor(
private fun initVideoView() {
videoRelativeLayout = RelativeLayout(context)
addView(videoRelativeLayout, LayoutParams(-1, -1))
val outLayout = LayoutParams(-1, -1)
addView(videoRelativeLayout,outLayout)
if (videoViewPlayer === null) {
//视频播放控件
videoViewPlayer = AdvanceGSYVideoPlayer(context)
}
var layoutParams = LayoutParams(-1, -1)
val layoutParams = LayoutParams(-1, -1)
//设置videoview占满父view播放
layoutParams.addRule(ALIGN_PARENT_LEFT)
layoutParams.addRule(ALIGN_PARENT_RIGHT)
layoutParams.addRule(ALIGN_PARENT_TOP)
layoutParams.addRule(ALIGN_PARENT_BOTTOM)
val dp2px = AutoSizeUtils.dp2px(context, 16f)
videoRelativeLayout?.outlineProvider = TextureVideoViewOutlineProvider(dp2px.toFloat())
videoRelativeLayout?.clipToOutline = true
videoRelativeLayout?.addView(videoViewPlayer, layoutParams)
val imageSize = AutoSizeUtils.dp2px(context, 25f)
if(connerTopLeft==null){
connerTopLeft = ImageView(context)
connerTopLeft?.setImageResource(R.drawable.m2_video_top_left)
}
val layoutParentTopLeft = LayoutParams(imageSize, imageSize)
layoutParentTopLeft.addRule(ALIGN_PARENT_TOP)
layoutParentTopLeft.addRule(ALIGN_PARENT_LEFT)
videoRelativeLayout?.addView(connerTopLeft, layoutParentTopLeft)
if(connerTopRight==null){
connerTopRight = ImageView(context)
connerTopRight?.setImageResource(R.drawable.m2_video_top_right)
}
val layoutParentTopRight = LayoutParams(imageSize, imageSize)
layoutParentTopRight.addRule(ALIGN_PARENT_TOP)
layoutParentTopRight.addRule(ALIGN_PARENT_RIGHT)
videoRelativeLayout?.addView(connerTopRight, layoutParentTopRight)
if(connerBottomLeft==null){
connerBottomLeft = ImageView(context)
connerBottomLeft?.setImageResource(R.drawable.m2_video_bottom_left)
}
val layoutParentBottomLeft = LayoutParams(imageSize, imageSize)
layoutParentBottomLeft.addRule(ALIGN_PARENT_BOTTOM)
layoutParentBottomLeft.addRule(ALIGN_PARENT_LEFT)
videoRelativeLayout?.addView(connerBottomLeft, layoutParentBottomLeft)
if(connerBottomRight==null){
connerBottomRight = ImageView(context)
connerBottomRight?.setImageResource(R.drawable.m2_video_bottom_right)
}
val layoutParentBottomRight = LayoutParams(imageSize, imageSize)
layoutParentBottomRight.addRule(ALIGN_PARENT_RIGHT)
layoutParentBottomRight.addRule(ALIGN_PARENT_BOTTOM)
videoRelativeLayout?.addView(connerBottomRight, layoutParentBottomRight)
}
fun setVideoPath(path: String,cacheImageUrl: String) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -19,17 +19,28 @@
app:mapStylePath="@string/m2_over_map_style_path"
app:resetDrawableMarginBottom="@dimen/dp_54"
app:resetDrawableMarginRight="@dimen/dp_34"
app:compassDrawable="@drawable/amap_custom_corner_m2"
app:arrivedDrawable="@drawable/m2_amap_arrived_road"
app:unArrivedDrawable="@drawable/m2_amap_arriving_road"
app:mapTilt="0"
app:leftPadding="200"
app:startPointDrawable="@drawable/m2_map_start_icon" />
<androidx.constraintlayout.widget.ConstraintLayout
<ImageView
android:id="@+id/cl_left_container_back"
android:layout_width="0dp"
android:scaleType="fitXY"
android:layout_height="match_parent"
android:src="@drawable/bg_driving_info_image"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.516"/>
<View
android:id="@+id/cl_left_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@drawable/bg_driving_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.5">
</androidx.constraintlayout.widget.ConstraintLayout>
app:layout_constraintWidth_percent="0.5"/>
<ImageView
android:id="@+id/iv_line_name_container"
@@ -226,6 +237,7 @@
android:id="@+id/aciv_speed_time_bg"
android:layout_width="0dp"
android:layout_height="@dimen/dp_181"
android:scaleType="fitXY"
android:src="@drawable/shuttle_p_card_split"
app:layout_constraintEnd_toEndOf="@+id/cl_left_container"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -41,10 +41,10 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="@dimen/dp_61"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_25"
android:layout_marginEnd="@dimen/dp_25"
app:blurRadius="@dimen/dp_15"
app:shadowColor="#80000000"
app:shadowColor="#802F3E67"
app:shadowRadius="@dimen/dp_16"
app:shadow_position="outer"
app:xOffset="0dp"
@@ -54,8 +54,8 @@
<FrameLayout
android:id="@+id/driving_fragment"
android:layout_width="match_parent"
android:layout_marginStart="@dimen/dp_35"
android:layout_marginEnd="@dimen/dp_35"
android:layout_marginStart="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_40"
android:layout_height="@dimen/dp_492"
android:layout_marginTop="@dimen/dp_13"
app:layout_constraintTop_toTopOf="@+id/och_shadow_layout"
@@ -88,11 +88,12 @@
<FrameLayout
android:id="@+id/video_fragment"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_560"
android:layout_marginBottom="@dimen/dp_44"
android:layout_marginEnd="@dimen/dp_42"
android:layout_marginStart="@dimen/dp_42"
android:layout_height="562.5dp"
android:layout_marginBottom="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_40"
android:layout_marginStart="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<!-- 16 9 -->
<!-- 1000 562.5 -->
</androidx.constraintlayout.widget.ConstraintLayout>