修复启动时序、重构详情页布局、对接取消订单接口
1. 启动时序修复:Launcher 从 ActivationActivity 改为 HomeActivity,
已激活用户直接进首页,不再闪现激活页
2. 详情页布局重构:左右分栏设计(左侧海报 + 右侧信息/操作),
全屏背景图 + 渐变遮罩,TV 端焦点导航
3. 对接后端取消订单接口 POST /api/jst/daycard/cancel/{orderNo},
用户关闭支付弹窗时自动取消未支付订单
This commit is contained in:
@@ -1,144 +1,156 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 详情页 -->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<!-- 详情页:左右分栏布局(参考生产项目),左侧海报 + 右侧信息/操作 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_main"
|
||||
android:fillViewport="true"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
android:background="@color/activity_detail_bg">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<!-- 全屏背景图(影片横版剧照) -->
|
||||
<ImageView
|
||||
android:id="@+id/ivBackdrop"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="@string/app_name"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- 渐变遮罩:左浅右深,保证右侧文字可读 -->
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_detail_scrim"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- 左侧竖版海报 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivPoster"
|
||||
android:layout_width="@dimen/qb_px_280"
|
||||
android:layout_height="@dimen/qb_px_400"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/bg_poster_rounded"
|
||||
android:clipToOutline="true"
|
||||
android:outlineProvider="background"
|
||||
android:contentDescription="@string/app_name"
|
||||
android:layout_marginStart="@dimen/qb_px_50"
|
||||
android:layout_marginTop="@dimen/qb_px_50"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/qb_px_40">
|
||||
android:layout_marginStart="@dimen/qb_px_36"
|
||||
android:layout_marginEnd="@dimen/qb_px_50"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="@dimen/mg_sp_32"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPoster"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ivPoster" />
|
||||
|
||||
<!-- 顶部 16:9 横幅背景图 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivBackdrop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="@string/app_name" />
|
||||
<!-- 元信息:分类 · 地区 · 年份 · 时长 -->
|
||||
<TextView
|
||||
android:id="@+id/tvType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qb_px_36"
|
||||
android:layout_marginEnd="@dimen/qb_px_50"
|
||||
android:layout_marginTop="@dimen/qb_px_16"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/mg_sp_20"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPoster"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
|
||||
|
||||
<!-- 海报 + 信息区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="-40dp"
|
||||
android:paddingHorizontal="@dimen/qb_px_50">
|
||||
<!-- 演员 -->
|
||||
<TextView
|
||||
android:id="@+id/tvActor"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qb_px_36"
|
||||
android:layout_marginEnd="@dimen/qb_px_50"
|
||||
android:layout_marginTop="@dimen/qb_px_12"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/mg_sp_20"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPoster"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvType" />
|
||||
|
||||
<!-- 海报 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivPoster"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="182dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/bg_poster_rounded"
|
||||
android:clipToOutline="true"
|
||||
android:outlineProvider="background"
|
||||
android:contentDescription="@string/app_name" />
|
||||
<!-- 简介 -->
|
||||
<TextView
|
||||
android:id="@+id/tvIntro"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qb_px_36"
|
||||
android:layout_marginEnd="@dimen/qb_px_50"
|
||||
android:layout_marginTop="@dimen/qb_px_12"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:textSize="@dimen/mg_sp_20"
|
||||
android:maxLines="3"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingExtra="@dimen/qb_px_4"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPoster"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvActor" />
|
||||
|
||||
<!-- 右侧信息区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="@dimen/qb_px_24"
|
||||
android:layout_marginBottom="-40dp">
|
||||
<!-- 播放按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnPlay"
|
||||
android:layout_width="@dimen/qb_px_180"
|
||||
android:layout_height="@dimen/qb_px_56"
|
||||
android:layout_marginStart="@dimen/qb_px_36"
|
||||
android:layout_marginTop="@dimen/qb_px_24"
|
||||
android:text="▶ 播放"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="@dimen/mg_sp_22"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_detail_play_btn"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:nextFocusRight="@id/btnBack"
|
||||
android:nextFocusLeft="@id/btnPlay"
|
||||
android:nextFocusUp="@id/btnPlay"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPoster"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvIntro" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="@dimen/mg_sp_28"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="400dp" />
|
||||
<!-- 返回按钮 -->
|
||||
<ImageView
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="@dimen/qb_px_56"
|
||||
android:layout_height="@dimen/qb_px_56"
|
||||
android:layout_marginStart="@dimen/qb_px_16"
|
||||
android:src="@drawable/ic_back"
|
||||
android:scaleType="center"
|
||||
android:contentDescription="@string/back"
|
||||
android:background="@drawable/bg_detail_back_btn"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:nextFocusLeft="@id/btnPlay"
|
||||
android:nextFocusRight="@id/btnBack"
|
||||
android:nextFocusUp="@id/btnBack"
|
||||
app:layout_constraintStart_toEndOf="@id/btnPlay"
|
||||
app:layout_constraintTop_toTopOf="@id/btnPlay"
|
||||
app:layout_constraintBottom_toBottomOf="@id/btnPlay" />
|
||||
|
||||
<!-- 元信息:分类 · 地区 · 年份 · 时长 -->
|
||||
<TextView
|
||||
android:id="@+id/tvType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/qb_px_8"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/mg_sp_16" />
|
||||
|
||||
<!-- 分割线 -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="@dimen/qb_px_10"
|
||||
android:layout_marginBottom="@dimen/qb_px_10"
|
||||
android:background="@color/divider" />
|
||||
|
||||
<!-- 演员 -->
|
||||
<TextView
|
||||
android:id="@+id/tvActor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/mg_sp_16"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingExtra="2dp" />
|
||||
|
||||
<!-- 简介 -->
|
||||
<TextView
|
||||
android:id="@+id/tvIntro"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/qb_px_8"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:textSize="@dimen/mg_sp_16"
|
||||
android:maxLines="4"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingExtra="@dimen/qb_px_4" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 操作按钮区 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/qb_px_24"
|
||||
android:paddingHorizontal="@dimen/qb_px_50">
|
||||
|
||||
<!-- 播放按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnPlay"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="52dp"
|
||||
android:text="▶ 播放"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="@dimen/mg_sp_20"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_play_button"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<!-- 返回按钮 -->
|
||||
<ImageView
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="@dimen/qb_px_40"
|
||||
android:layout_height="@dimen/qb_px_40"
|
||||
android:layout_marginStart="@dimen/qb_px_20"
|
||||
android:src="@drawable/ic_back"
|
||||
android:contentDescription="@string/back"
|
||||
android:background="?selectableItemBackgroundBorderless" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user