386 lines
16 KiB
XML
386 lines
16 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||
xmlns:tools="http://schemas.android.com/tools"
|
||
android:id="@+id/swipeRefreshLayout"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent">
|
||
|
||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||
android:id="@+id/rootCoordinator"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
tools:context=".ui.home.HomeFragment">
|
||
|
||
<!-- 原来的内容:背景 + VIP + 权益 + 按钮 -->
|
||
<FrameLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent">
|
||
|
||
<!-- 背景 -->
|
||
<ImageView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:src="@drawable/bg"
|
||
android:scaleType="fitXY"
|
||
android:adjustViewBounds="true" />
|
||
|
||
<!-- 内容 -->
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_gravity="center_horizontal"
|
||
android:orientation="vertical">
|
||
|
||
<!-- vip -->
|
||
<!-- 成为会员 -->
|
||
<ImageView
|
||
android:id="@+id/vip"
|
||
android:layout_width="@dimen/sw_216dp"
|
||
android:layout_height="@dimen/sw_161dp"
|
||
android:layout_gravity="top|center_horizontal"
|
||
android:layout_marginTop="@dimen/sw_40dp"
|
||
android:scaleType="fitCenter"
|
||
android:src="@drawable/vip" />
|
||
|
||
<TextView
|
||
android:id="@+id/member"
|
||
android:layout_marginTop="@dimen/sw_28dp"
|
||
android:layout_width="@dimen/sw_290dp"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_18sp"
|
||
android:textStyle="bold"
|
||
android:textColor="#1B1F1A"
|
||
android:layout_gravity="center_horizontal"
|
||
android:gravity="center"
|
||
android:text="@string/home_member" />
|
||
|
||
<TextView
|
||
android:id="@+id/Unlock"
|
||
android:layout_marginTop="@dimen/sw_3dp"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_14sp"
|
||
android:textColor="#1B1F1A"
|
||
android:layout_gravity="center_horizontal"
|
||
android:text="@string/home_unlock" />
|
||
|
||
<!-- 权益 -->
|
||
<LinearLayout
|
||
android:layout_marginTop="@dimen/sw_22dp"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_gravity="center_horizontal"
|
||
android:gravity="center_horizontal"
|
||
android:orientation="horizontal">
|
||
|
||
<!-- 权益1 -->
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="wrap_content"
|
||
android:layout_gravity="center_vertical"
|
||
android:layout_weight="1"
|
||
android:gravity="center"
|
||
android:orientation="vertical">
|
||
|
||
<ImageView
|
||
android:layout_width="@dimen/sw_54dp"
|
||
android:layout_height="@dimen/sw_44dp"
|
||
android:src="@drawable/ai_dialogue"
|
||
android:scaleType="fitCenter" />
|
||
|
||
<TextView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_12sp"
|
||
android:gravity="center"
|
||
android:textColor="#1B1F1A"
|
||
android:text="@string/home_ai_dialogue" />
|
||
</LinearLayout>
|
||
|
||
<!-- 权益2 -->
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="wrap_content"
|
||
android:layout_weight="1"
|
||
android:gravity="center"
|
||
android:layout_gravity="center_horizontal"
|
||
android:orientation="vertical">
|
||
|
||
<ImageView
|
||
android:layout_width="@dimen/sw_54dp"
|
||
android:layout_height="@dimen/sw_44dp"
|
||
android:src="@drawable/personalized_keyboard"
|
||
android:scaleType="fitCenter" />
|
||
|
||
<TextView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_12sp"
|
||
android:gravity="center"
|
||
android:textColor="#1B1F1A"
|
||
android:text="@string/home_ai_keyboard" />
|
||
</LinearLayout>
|
||
|
||
<!-- 权益3 -->
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="wrap_content"
|
||
android:layout_weight="1"
|
||
android:gravity="center"
|
||
android:layout_gravity="center_horizontal"
|
||
android:orientation="vertical">
|
||
|
||
<ImageView
|
||
android:layout_width="@dimen/sw_54dp"
|
||
android:layout_height="@dimen/sw_44dp"
|
||
android:src="@drawable/chat_persona"
|
||
android:scaleType="fitCenter" />
|
||
|
||
<TextView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_12sp"
|
||
android:gravity="center"
|
||
android:textColor="#1B1F1A"
|
||
android:text="@string/home_ai_persona" />
|
||
</LinearLayout>
|
||
|
||
<!-- 权益4 -->
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="wrap_content"
|
||
android:layout_weight="1"
|
||
android:gravity="center"
|
||
android:layout_gravity="center_horizontal"
|
||
android:orientation="vertical">
|
||
|
||
<ImageView
|
||
android:layout_width="@dimen/sw_54dp"
|
||
android:layout_height="@dimen/sw_44dp"
|
||
android:src="@drawable/emotional_counseling"
|
||
android:scaleType="fitCenter" />
|
||
|
||
<TextView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_12sp"
|
||
android:gravity="center"
|
||
android:textColor="#1B1F1A"
|
||
android:text="@string/home_ai_counseling" />
|
||
</LinearLayout>
|
||
</LinearLayout>
|
||
|
||
<!-- 按钮 -->
|
||
<LinearLayout
|
||
android:id="@+id/rechargeButton"
|
||
android:layout_marginTop="@dimen/sw_22dp"
|
||
android:layout_width="@dimen/sw_257dp"
|
||
android:layout_height="@dimen/sw_57dp"
|
||
android:layout_gravity="center_horizontal"
|
||
android:gravity="center"
|
||
android:background="@drawable/button_bg"
|
||
android:elevation="@dimen/sw_4dp"
|
||
android:orientation="horizontal">
|
||
|
||
<TextView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:textSize="@dimen/sw_15sp"
|
||
android:textStyle="bold"
|
||
android:gravity="center"
|
||
android:textColor="#1B1F1A"
|
||
android:text="@string/home_recharge" />
|
||
</LinearLayout>
|
||
|
||
</LinearLayout>
|
||
</FrameLayout>
|
||
|
||
<!-- 半透明遮罩:点击 / 下滑关闭底部盒子 -->
|
||
<View
|
||
android:id="@+id/view_scrim"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:background="#66000000"
|
||
android:visibility="gone" />
|
||
|
||
<!-- 圆角底部盒子(BottomSheet) -->
|
||
<com.google.android.material.card.MaterialCardView
|
||
android:id="@+id/bottomSheet"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:layout_gravity="bottom"
|
||
android:backgroundTint="@android:color/white"
|
||
app:cardUseCompatPadding="false"
|
||
app:cardElevation="@dimen/sw_8dp"
|
||
app:cardBackgroundColor="@android:color/white"
|
||
app:shapeAppearance="@style/ShapeAppearance.TopRoundedOnly"
|
||
app:layout_behavior="@string/bottom_sheet_behavior">
|
||
|
||
<ImageView
|
||
android:id="@+id/backgroundImage"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:src="@drawable/option_background"
|
||
android:scaleType="fitXY"
|
||
android:adjustViewBounds="true" />
|
||
|
||
<!-- 盒子内容 -->
|
||
<LinearLayout
|
||
android:orientation="vertical"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent">
|
||
|
||
<!-- 顶部“可点击的头部区域”,点击可展开/收起 -->
|
||
<LinearLayout
|
||
android:id="@+id/bottomSheetHeader"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="@dimen/sw_48dp"
|
||
android:gravity="center"
|
||
android:paddingTop="@dimen/sw_8dp"
|
||
android:paddingBottom="@dimen/sw_8dp"
|
||
android:orientation="vertical">
|
||
|
||
<!-- 小横条指示器 -->
|
||
<View
|
||
android:layout_width="@dimen/sw_40dp"
|
||
android:layout_height="@dimen/sw_4dp"
|
||
android:background="@drawable/bs_handle_bg" />
|
||
</LinearLayout>
|
||
|
||
<!-- 顶部选项栏:两个选项,对应两个列表 -->
|
||
<LinearLayout
|
||
android:id="@+id/topTabs"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="@dimen/sw_56dp"
|
||
android:orientation="horizontal"
|
||
android:gravity="center_vertical"
|
||
android:paddingStart="@dimen/sw_16dp"
|
||
android:paddingEnd="@dimen/sw_16dp">
|
||
|
||
<TextView
|
||
android:id="@+id/tab_list1"
|
||
android:layout_width="0dp"
|
||
android:layout_height="match_parent"
|
||
android:layout_weight="1"
|
||
android:layout_marginEnd="@dimen/sw_20dp"
|
||
android:gravity="center"
|
||
android:text="@string/home_tab1"
|
||
android:textSize="@dimen/sw_14sp"
|
||
android:textStyle="bold"
|
||
android:textColor="#1B1F1A" />
|
||
|
||
<TextView
|
||
android:id="@+id/tab_list2"
|
||
android:layout_width="0dp"
|
||
android:layout_height="match_parent"
|
||
android:layout_weight="1"
|
||
android:layout_marginStart="@dimen/sw_20dp"
|
||
android:gravity="center"
|
||
android:text="@string/home_tab2"
|
||
android:textSize="@dimen/sw_14sp"
|
||
android:textColor="#801B1F1A" />
|
||
</LinearLayout>
|
||
|
||
<!-- 第二个列表下面的标签行(数量不固定),只在第二个列表时可见 -->
|
||
<HorizontalScrollView
|
||
android:id="@+id/tagScroll"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="@dimen/sw_40dp"
|
||
android:visibility="gone"
|
||
android:fillViewport="true"
|
||
android:scrollbars="none"
|
||
android:overScrollMode="never">
|
||
|
||
<LinearLayout
|
||
android:id="@+id/tagContainer"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="match_parent"
|
||
android:orientation="horizontal"
|
||
android:gravity="center_vertical" />
|
||
</HorizontalScrollView>
|
||
|
||
<!-- 内容区:ViewPager2 里放不同的 RecyclerView(卡片列表)-->
|
||
<androidx.viewpager2.widget.ViewPager2
|
||
android:id="@+id/viewPager"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="0dp"
|
||
android:layout_weight="1" />
|
||
|
||
</LinearLayout>
|
||
|
||
<FrameLayout
|
||
android:id="@+id/noResultOverlay"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:background="@android:color/white"
|
||
android:visibility="gone"
|
||
android:clickable="true"
|
||
android:focusable="true"
|
||
android:importantForAccessibility="no">
|
||
|
||
<LinearLayout
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:layout_gravity="top|center_horizontal"
|
||
android:orientation="vertical"
|
||
android:gravity="center_horizontal">
|
||
|
||
<!-- 顶部“可点击的头部区域”,点击可展开/收起 -->
|
||
<LinearLayout
|
||
android:id="@+id/bottomSheetHeader"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="@dimen/sw_48dp"
|
||
android:gravity="center"
|
||
android:paddingTop="@dimen/sw_8dp"
|
||
android:paddingBottom="@dimen/sw_8dp"
|
||
android:orientation="vertical">
|
||
|
||
<!-- 小横条指示器 -->
|
||
<View
|
||
android:layout_width="@dimen/sw_40dp"
|
||
android:layout_height="@dimen/sw_4dp"
|
||
android:background="@drawable/bs_handle_bg" />
|
||
</LinearLayout>
|
||
|
||
<ImageView
|
||
android:id="@+id/noResultImage"
|
||
android:layout_width="@dimen/sw_175dp"
|
||
android:layout_height="@dimen/sw_177dp"
|
||
android:src="@drawable/no_search_result"
|
||
android:scaleType="fitCenter"
|
||
android:contentDescription="@null"
|
||
android:importantForAccessibility="no" />
|
||
|
||
<TextView
|
||
android:id="@+id/noResultText"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:gravity="center"
|
||
android:textAlignment="center"
|
||
android:text="@string/search_not_data"
|
||
android:textSize="@dimen/sw_13sp"
|
||
android:textColor="#1B1F1A"
|
||
android:includeFontPadding="false" />
|
||
</LinearLayout>
|
||
</FrameLayout>
|
||
|
||
</com.google.android.material.card.MaterialCardView>
|
||
|
||
<!-- 浮动按钮 -->
|
||
<ImageView
|
||
android:id="@+id/floatingImage"
|
||
android:layout_width="@dimen/sw_92dp"
|
||
android:layout_height="@dimen/sw_78dp"
|
||
android:elevation="@dimen/sw_99dp"
|
||
android:layout_gravity="center_vertical|end"
|
||
android:layout_marginEnd="@dimen/sw_16dp"
|
||
android:layout_marginTop="@dimen/sw_80dp"
|
||
android:src="@drawable/floating"
|
||
android:scaleType="centerInside" />
|
||
|
||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||
|
||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|