[ui调整]
This commit is contained in:
yangyakun
2023-08-02 19:18:55 +08:00
committed by zhongchao
parent e1f67cdf8f
commit 441b08dd0e
6 changed files with 32 additions and 14 deletions

View File

@@ -215,6 +215,18 @@ internal class InfoVideoView @JvmOverloads constructor(
return Pair(centerItemPosition, player)
}
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
super.onWindowFocusChanged(hasWindowFocus)
val carouselLayoutManager = rvVideoPlaylist?.layoutManager as CarouselLayoutManager
val (centerItemPosition: Int, player) = getPlayer(carouselLayoutManager)
player?.let {
if(it.isInPlayingState&&!it.isIfCurrentIsFullscreen&&!hasWindowFocus){
player.onVideoPause()
}
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
}

View File

@@ -122,6 +122,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
layoutParams2.height = AutoSizeUtils.dp2px(context,108f)
layoutParams2.width = AutoSizeUtils.dp2px(context,108f)
fullscreenButton.layoutParams = layoutParams2
fullscreenButton.visibility = View.VISIBLE
}
}
@@ -152,13 +153,13 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
super.onWindowFocusChanged(hasWindowFocus)
// if(isIfCurrentIsFullscreen&&smalllPlayer!=null){
// if(hasWindowFocus){//获取焦点
// onVideoResume()
// }else{
// onVideoPause()
// }
// }
if(isIfCurrentIsFullscreen&&smalllPlayer!=null){
if(hasWindowFocus){//获取焦点
onVideoResume()
}else{
onVideoPause()
}
}
}
override fun touchDoubleUp() {
@@ -167,7 +168,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun changeUiToNormal() {
super.changeUiToNormal()
setViewShowState(fullscreenButton, INVISIBLE)
//setViewShowState(fullscreenButton, INVISIBLE)
this.statusBarView?.visibility = View.VISIBLE
}

View File

@@ -16,7 +16,7 @@
app:compassDrawable="@drawable/taxi_p_map_car_light"
app:mapStyleExtraPath="style_extra.data"
app:mapStylePath="style.data"
app:leftPadding="160"
app:leftPadding="800"
app:rightPadding="160"
app:topPadding="160"
app:bottomPadding="160"

View File

@@ -8,6 +8,7 @@
<View
android:id="@+id/v_bottom_bg"
android:layout_width="@dimen/dp_842"
android:layout_height="@dimen/dp_466"
android:layout_marginTop="@dimen/dp_44"
@@ -38,7 +39,7 @@
android:textSize="@dimen/dp_35"
app:layout_constraintBaseline_toBaselineOf="@+id/actv_speed_value"
app:layout_constraintStart_toEndOf="@+id/actv_speed_value"
android:layout_marginStart="@dimen/dp_24"
android:layout_marginStart="@dimen/dp_20"
android:text="KM/H" />
<androidx.appcompat.widget.AppCompatTextView
@@ -71,7 +72,8 @@
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:background="@color/taxi_p_5C71AB"
android:background="@color/taxi_p_B35C71AB"
android:layout_marginTop="-15dp"
app:layout_constraintEnd_toEndOf="@+id/actv_endstation"
app:layout_constraintStart_toStartOf="@+id/actv_speed_value"
app:layout_constraintTop_toBottomOf="@+id/actv_speed_value" />
@@ -82,7 +84,8 @@
android:layout_width="0dp"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_51"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_66"
android:layout_marginStart="@dimen/dp_58"
android:textSize="@dimen/dp_61"
android:fontFamily="@font/din"
@@ -90,7 +93,8 @@
android:textColor="@color/taxi_p_081831"
app:layout_constraintEnd_toStartOf="@+id/actv_surplus_time"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actv_speed_value"
app:layout_constraintTop_toTopOf="@+id/v_bottom_bg"
app:layout_constraintBottom_toBottomOf="@+id/v_bottom_bg"
android:text="--" />
<androidx.appcompat.widget.AppCompatTextView

View File

@@ -43,6 +43,7 @@
<ImageView
android:id="@+id/fullscreen"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="@dimen/dp_42"

View File

@@ -61,7 +61,7 @@
<color name="taxi_p_004DC4">#004DC4</color>
<color name="taxi_p_293449">#293449</color>
<color name="taxi_p_203555">#203555</color>
<color name="taxi_p_5C71AB">#5C71AB</color>
<color name="taxi_p_B35C71AB">#B35C71AB</color>
<color name="taxi_p_081831">#081831</color>
<color name="taxi_p_112B57">#112B57</color>
<color name="taxi_p_66476FBE">#66476FBE</color>