Skip to content

Instantly share code, notes, and snippets.

@330132662
Created October 12, 2020 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 330132662/dd003ab74b341d6547b1f3d2771fcdd6 to your computer and use it in GitHub Desktop.
Save 330132662/dd003ab74b341d6547b1f3d2771fcdd6 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.juhui.macao.ui.fragment.TestFragmentA"
tools:ignore="HardcodedText">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/abl_test_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0px">
<com.juhui.macao.widget.XCollapsingToolbarLayout
android:id="@+id/ctl_test_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentScrim="@color/white"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:scrimVisibleHeightTrigger="100dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity=""
android:scaleType="centerCrop"
android:src="@drawable/bg_launcher"
android:visibility="visible"
app:layout_collapseMode="parallax" />
<!--轮播-->
<cn.bingoogolapple.bgabanner.BGABanner
android:id="@+id/banner_main_accordion"
style="@style/BannerDefaultStyle"
android:layout_height="200dp"
android:layout_marginTop="60dp"
app:banner_pointDrawable="@drawable/selector_banner_unequal"
app:banner_transitionEffect="fade" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/t_test_title"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:layout_marginEnd="20dp"
app:layout_collapseMode="pin" />
<com.hjq.bar.TitleBar
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
app:backButton="false"
app:barStyle="transparent"
app:layout_collapseMode="pin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="10dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_test_address"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:gravity="center_vertical"
android:text="广州"
android:textColor="@color/white"
android:textSize="15sp" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_test_hint"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_weight="1"
android:background="@drawable/bg_home_search_bar_transparent"
android:gravity="center"
android:text="完善细节,追求完美"
android:textColor="@color/white60"
android:textSize="14sp" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_test_search"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:src="@drawable/ic_search_white" />
</LinearLayout>
</com.hjq.bar.TitleBar>
</com.juhui.macao.widget.XCollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<!--suppress AndroidDomInspection -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:orientation="vertical">
<!-- 公告入口 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginStart="0dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_notice_enter"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="1dp"
android:paddingBottom="1dp">
<ImageView
android:layout_width="30dp"
android:layout_height="wrap_content"
android:src="@drawable/ic_logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="@string/notice_shop" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="庆祝10月1日国庆节,新品上市"
android:textColor="@color/red" />
<ImageView
android:layout_width="30dp"
android:layout_height="wrap_content"
android:src="@drawable/logcat_ic_arrows_down" />
</LinearLayout>
<!-- 分类 不算楼层-->
<com.hjq.widget.layout.WrapRecyclerView
android:id="@+id/rv_category_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listCount="10"
tools:listitem="@layout/item_copy" />
<!-- 一楼 -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp">
<!--左侧-->
<ImageView
android:id="@+id/home_miaosha_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_logo"
app:layout_constraintBaseline_toBaselineOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/home_miaosha_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="活动秒杀"
android:textSize="@dimen/textSize_18"
app:layout_constraintBottom_toTopOf="@+id/home_ms_minute"
app:layout_constraintLeft_toRightOf="@+id/home_miaosha_icon"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Group
android:id="@+id/home_ms_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:constraint_referenced_ids="home_ms_hour,home_ms_minute,home_ms_seconds" />
<TextView
android:id="@+id/home_ms_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/shape_home_time"
android:text="10"
android:textColor="@color/white"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_miaosha_icon"
app:layout_goneMarginTop="20dp" />
<TextView
android:id="@+id/home_ms_hour_div"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:text=":"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_ms_hour"
app:layout_constraintTop_toBottomOf="@+id/home_miaosha_icon" />
<TextView
android:id="@+id/home_ms_minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_home_time"
android:text="26"
android:textColor="@color/white"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_ms_hour_div"
app:layout_constraintTop_toBottomOf="@+id/home_miaosha_icon" />
<TextView
android:id="@+id/home_ms_minute_div"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:text=":"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_ms_minute"
app:layout_constraintTop_toBottomOf="@+id/home_miaosha_icon" />
<TextView
android:id="@+id/home_ms_seconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_home_time"
android:text="59"
android:textColor="@color/white"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_ms_minute_div"
app:layout_constraintTop_toBottomOf="@+id/home_miaosha_icon" />
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_logo"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_ms_minute" />
<!-- 右侧 -->
<TextView
android:id="@+id/ms_list_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="16dp"
android:text="秒杀列表"
android:textColor="@color/red"
app:layout_constraintStart_toEndOf="@+id/home_miaosha_title"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="16dp"
android:text="查看更多"
app:layout_constraintStart_toEndOf="@+id/ms_list_title"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_ms_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
app:layout_constraintLeft_toRightOf="@+id/home_ms_seconds"
app:layout_constraintTop_toBottomOf="@+id/ms_list_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- 二楼 拼团-->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp">
<!--左侧-->
<ImageView
android:id="@+id/home_group_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_logo"
app:layout_constraintBaseline_toBaselineOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/home_group_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="拼团专区"
android:textSize="@dimen/textSize_18"
app:layout_constraintBottom_toTopOf="@+id/home_group_minute"
app:layout_constraintLeft_toRightOf="@+id/home_group_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/home_group_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/shape_home_time"
android:text="10"
android:textColor="@color/white"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_group_icon"
app:layout_goneMarginTop="20dp" />
<TextView
android:id="@+id/home_group_hour_div"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:text=":"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_group_hour"
app:layout_constraintTop_toBottomOf="@+id/home_group_icon" />
<TextView
android:id="@+id/home_group_minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_home_time"
android:text="26"
android:textColor="@color/white"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_group_hour_div"
app:layout_constraintTop_toBottomOf="@+id/home_group_icon" />
<TextView
android:id="@+id/home_group_minute_div"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:text=":"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_group_minute"
app:layout_constraintTop_toBottomOf="@+id/home_group_icon" />
<TextView
android:id="@+id/home_group_seconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_home_time"
android:text="59"
android:textColor="@color/white"
android:textSize="@dimen/textSize_14"
app:layout_constraintLeft_toRightOf="@+id/home_group_minute_div"
app:layout_constraintTop_toBottomOf="@+id/home_group_icon" />
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_logo"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_group_minute" />
<!-- 右侧 -->
<TextView
android:id="@+id/group_list_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="16dp"
android:text="秒杀列表"
android:textColor="@color/red"
app:layout_constraintStart_toEndOf="@+id/home_group_title"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="16dp"
android:text="查看更多"
app:layout_constraintStart_toEndOf="@+id/group_list_title"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_group_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
app:layout_constraintLeft_toRightOf="@+id/home_group_seconds"
app:layout_constraintTop_toBottomOf="@+id/group_list_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- 三楼 每周 楼层之间的上边距要大一些-->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="20dp"
android:paddingRight="10dp"
android:paddingBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="每周商品推荐"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/shape_home_qualitygood"
android:text="品质好货"
android:textColor="@color/home_quality_good" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:gravity="right"
android:text="更多" />
</LinearLayout>
<com.hjq.widget.layout.WrapRecyclerView
android:id="@+id/rv_good_weekly"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_copy" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<!--四楼 人气商品 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Popular_products"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/shape_home_brand"
android:text="品牌特惠"
android:textColor="@color/home_quality_brand" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:gravity="right"
android:text="更多" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_good_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listCount="10" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment