Files
Android-key-of-love/app/src/main/res/layout/fragment_shop.xml

306 lines
14 KiB
XML
Raw Normal View History

2025-11-26 16:47:15 +08:00
<?xml version="1.0" encoding="utf-8"?>
2025-12-26 22:01:04 +08:00
<com.example.myapplication.widget.NoHorizontalInterceptSwipeRefreshLayout
2025-11-26 16:47:15 +08:00
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
2025-12-26 22:01:04 +08:00
android:id="@+id/swipeRefreshLayout"
2025-11-26 16:47:15 +08:00
android:layout_width="match_parent"
android:layout_height="match_parent"
2026-02-10 18:26:31 +08:00
android:layout_marginBottom="@dimen/sw_40dp">
2025-11-26 16:47:15 +08:00
2025-12-26 22:01:04 +08:00
<androidx.coordinatorlayout.widget.CoordinatorLayout
2025-11-26 16:47:15 +08:00
android:layout_width="match_parent"
2025-12-26 22:01:04 +08:00
android:layout_height="match_parent">
2025-11-26 16:47:15 +08:00
2025-12-26 22:01:04 +08:00
<!-- 背景-->
2026-01-23 16:52:51 +08:00
<!-- <ImageView
2025-12-26 22:01:04 +08:00
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/bg"
android:scaleType="fitXY"
2026-01-23 16:52:51 +08:00
android:adjustViewBounds="true" /> -->
2025-12-26 22:01:04 +08:00
<!-- 头部 + 标签行,放进 AppBarLayout 里 -->
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
2025-11-26 16:47:15 +08:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2026-01-23 16:52:51 +08:00
android:background="@drawable/bg_shop_gradient"
android:elevation="0dp"
android:stateListAnimator="@null">
2025-11-26 16:47:15 +08:00
2025-12-26 22:01:04 +08:00
<!-- 这一块会跟着滚动,滑出屏幕 -->
2025-11-26 16:47:15 +08:00
<LinearLayout
2025-12-26 22:01:04 +08:00
android:id="@+id/headerContainer"
2025-11-26 16:47:15 +08:00
android:layout_width="match_parent"
2025-12-26 22:01:04 +08:00
android:layout_height="wrap_content"
2026-02-10 18:26:31 +08:00
android:padding="@dimen/sw_16dp"
2025-12-26 22:01:04 +08:00
android:orientation="vertical"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
2025-11-26 16:47:15 +08:00
2026-01-23 16:52:51 +08:00
<!--消费记录,搜索、皮肤栏 -->
2025-12-26 22:01:04 +08:00
<LinearLayout
2025-11-26 16:47:15 +08:00
android:layout_width="match_parent"
2026-02-10 18:26:31 +08:00
android:layout_height="@dimen/sw_40dp"
2025-12-26 22:01:04 +08:00
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
2026-01-23 16:52:51 +08:00
<LinearLayout
android:id="@+id/recordButton"
android:layout_width="wrap_content"
2026-02-10 18:26:31 +08:00
android:layout_height="@dimen/sw_32dp"
2026-01-23 16:52:51 +08:00
android:gravity="center"
2026-02-10 18:26:31 +08:00
android:paddingStart="@dimen/sw_7dp"
android:paddingEnd="@dimen/sw_7dp"
2026-01-23 16:52:51 +08:00
android:background="@drawable/shop_record_bg"
android:orientation="horizontal">
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_15dp"
android:layout_height="@dimen/sw_16dp"
android:layout_marginEnd="@dimen/sw_4dp"
2026-01-23 16:52:51 +08:00
android:src="@drawable/record" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mine_consumption_record"
android:textColor="#02BEAC"/>
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
2025-12-26 22:01:04 +08:00
<ImageView
android:id="@+id/searchButton"
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_24dp"
android:layout_height="@dimen/sw_24dp"
android:layout_marginEnd="@dimen/sw_16dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/search" />
<ImageView
android:id="@+id/skinButton"
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_24dp"
android:layout_height="@dimen/sw_24dp"
android:layout_marginEnd="@dimen/sw_16dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/skin" />
</LinearLayout>
2025-11-26 16:47:15 +08:00
2025-12-26 22:01:04 +08:00
<!-- 小星星 -->
2025-11-26 16:47:15 +08:00
<LinearLayout
android:layout_width="match_parent"
2026-02-10 18:26:31 +08:00
android:layout_height="@dimen/sw_110dp"
android:layout_marginTop="@dimen/sw_16dp"
android:elevation="@dimen/sw_1dp"
2025-12-26 22:01:04 +08:00
android:orientation="horizontal">
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_18dp"
android:layout_height="@dimen/sw_18dp"
android:layout_marginTop="@dimen/sw_62dp"
android:layout_marginStart="@dimen/sw_10dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/yellow_star" />
2025-11-26 16:47:15 +08:00
<TextView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_68dp"
2025-11-26 16:47:15 +08:00
android:layout_height="wrap_content"
2026-02-10 18:26:31 +08:00
android:layout_marginTop="@dimen/sw_6dp"
android:layout_marginStart="@dimen/sw_6dp"
2026-01-21 21:53:34 +08:00
android:text="@string/shop_mall"
2025-11-26 16:47:15 +08:00
android:textColor="#1B1F1A"
2025-12-26 22:01:04 +08:00
android:textStyle="bold"
2026-02-10 18:26:31 +08:00
android:textSize="@dimen/sw_22sp" />
2025-12-26 22:01:04 +08:00
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_16dp"
android:layout_height="@dimen/sw_16dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/yellow_star" />
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_20dp"
android:layout_height="@dimen/sw_20dp"
android:layout_marginStart="@dimen/sw_62dp"
android:layout_marginTop="@dimen/sw_60dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/yellow_star" />
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_18dp"
android:layout_height="@dimen/sw_18dp"
android:layout_marginTop="@dimen/sw_62dp"
android:layout_marginStart="@dimen/sw_2dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/yellow_star" />
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_16dp"
android:layout_height="@dimen/sw_16dp"
android:layout_marginTop="@dimen/sw_60dp"
android:layout_marginStart="@dimen/sw_2dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/yellow_star" />
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_14dp"
android:layout_height="@dimen/sw_14dp"
android:layout_marginTop="@dimen/sw_54dp"
android:layout_marginStart="@dimen/sw_2dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/blue_star" />
</LinearLayout>
<!-- Points 卡片 -->
<FrameLayout
android:layout_width="match_parent"
2026-02-10 18:26:31 +08:00
android:layout_height="@dimen/sw_238dp"
android:layout_marginTop="@dimen/_sw_110dp"
android:elevation="@dimen/sw_10dp"
2025-12-26 22:01:04 +08:00
android:orientation="vertical">
2025-11-26 16:47:15 +08:00
2025-12-26 22:01:04 +08:00
<!-- 点数背景 -->
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/points" />
<!-- 内容 -->
2025-11-26 16:47:15 +08:00
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
2026-02-10 18:26:31 +08:00
android:layout_marginTop="@dimen/sw_110dp"
2025-12-26 22:01:04 +08:00
android:orientation="vertical">
2025-11-26 16:47:15 +08:00
<TextView
2025-12-26 22:01:04 +08:00
android:layout_width="match_parent"
2025-11-26 16:47:15 +08:00
android:layout_height="wrap_content"
2026-01-21 21:53:34 +08:00
android:text="@string/shop_points"
2025-12-26 22:01:04 +08:00
android:textColor="#1B1F1A"
2026-02-10 18:26:31 +08:00
android:textSize="@dimen/sw_14sp"
android:padding="@dimen/sw_20dp" />
2025-11-26 16:47:15 +08:00
<LinearLayout
2025-12-26 22:01:04 +08:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
2025-11-26 16:47:15 +08:00
android:orientation="horizontal">
2025-12-26 22:01:04 +08:00
<ImageView
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_38dp"
android:layout_height="@dimen/sw_38dp"
android:layout_marginStart="@dimen/sw_20dp"
2025-12-26 22:01:04 +08:00
android:src="@drawable/gold_coin" />
2025-11-26 16:47:15 +08:00
<TextView
2025-12-26 22:01:04 +08:00
android:id="@+id/balance"
android:layout_width="0dp"
2025-11-26 16:47:15 +08:00
android:layout_height="wrap_content"
2025-12-26 22:01:04 +08:00
android:layout_weight="1"
2026-02-10 18:26:31 +08:00
android:layout_marginStart="@dimen/sw_10dp"
android:layout_marginEnd="@dimen/sw_10dp"
2025-12-26 22:01:04 +08:00
android:text="0.00"
android:textColor="#02BEAC"
2026-02-10 18:26:31 +08:00
android:textSize="@dimen/sw_40sp" />
2025-12-26 22:01:04 +08:00
<!-- 按钮 -->
<LinearLayout
android:id="@+id/rechargeButton"
2026-02-10 18:26:31 +08:00
android:layout_width="@dimen/sw_114dp"
android:layout_height="@dimen/sw_42dp"
android:layout_marginEnd="@dimen/sw_10dp"
2025-11-26 16:47:15 +08:00
android:gravity="center"
2025-12-26 22:01:04 +08:00
android:background="@drawable/gold_coin_button"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2026-02-10 18:26:31 +08:00
android:textSize="@dimen/sw_13sp"
2025-12-26 22:01:04 +08:00
android:textStyle="bold"
android:gravity="center"
android:textColor="#1B1F1A"
2026-01-21 21:53:34 +08:00
android:text="@string/shop_recharge" />
2025-12-26 22:01:04 +08:00
</LinearLayout>
2025-11-26 16:47:15 +08:00
</LinearLayout>
</LinearLayout>
2025-12-26 22:01:04 +08:00
</FrameLayout>
</LinearLayout>
2025-11-26 16:47:15 +08:00
2025-12-26 22:01:04 +08:00
<!-- 标签行:仍然在 points 卡片下面,并设置成吸顶 -->
<HorizontalScrollView
android:id="@+id/tagScroll"
android:layout_width="match_parent"
2026-01-23 16:52:51 +08:00
android:layout_height="wrap_content"
2026-02-10 18:26:31 +08:00
android:paddingStart="@dimen/sw_16dp"
android:paddingEnd="@dimen/sw_16dp"
android:layout_marginBottom="@dimen/sw_18dp"
2025-12-26 22:01:04 +08:00
android:fillViewport="true"
android:scrollbars="none"
android:overScrollMode="never">
<LinearLayout
android:layout_width="wrap_content"
2026-01-23 16:52:51 +08:00
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView
android:id="@+id/shopTitle"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:text="@string/shop_title"
android:textColor="#1B1F1A"
2026-02-10 18:26:31 +08:00
android:textSize="@dimen/sw_20sp" />
2026-01-23 16:52:51 +08:00
<LinearLayout
android:id="@+id/tagContainer"
android:layout_width="wrap_content"
2026-02-10 18:26:31 +08:00
android:layout_height="@dimen/sw_30dp"
2026-01-23 16:52:51 +08:00
android:orientation="horizontal"
android:gravity="center_vertical" />
</LinearLayout>
2025-12-26 22:01:04 +08:00
</HorizontalScrollView>
</com.google.android.material.appbar.AppBarLayout>
<!-- 内容页,放进 ViewPager2 里 -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
2026-02-10 18:26:31 +08:00
android:layout_marginBottom="@dimen/sw_30dp"
2025-12-26 22:01:04 +08:00
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
2025-11-26 16:47:15 +08:00
2026-02-12 19:40:32 +08:00
<FrameLayout
android:id="@+id/noResultOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:importantForAccessibility="no"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:orientation="vertical"
android:gravity="center_horizontal">
<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>
2025-12-26 22:01:04 +08:00
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.example.myapplication.widget.NoHorizontalInterceptSwipeRefreshLayout>