欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

Android仿拉手网团购App产品详情界面效果

程序员文章站 2023-11-26 22:41:58
先给大家展示下效果图,如果感觉还不错,请参考实例代码。 效果图如下所示: 具体代码如下所示: activity_detail.xml

先给大家展示下效果图,如果感觉还不错,请参考实例代码。

效果图如下所示:

Android仿拉手网团购App产品详情界面效果Android仿拉手网团购App产品详情界面效果

具体代码如下所示:

activity_detail.xml

<?xml version="1.0" encoding="utf-8"?>
<relativelayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.myxh.coolshopping.ui.activity.detailactivity">
  <relativelayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/detail_layout_buy">
    <com.myxh.coolshopping.ui.widget.observerscrollview
      android:id="@+id/detail_scroll_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
      <linearlayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <com.facebook.drawee.view.simpledraweeview
          android:id="@+id/detail_product_photo"
          android:layout_width="match_parent"
          android:layout_height="@dimen/detail_photo_height"
          android:scaletype="centercrop"
          app:placeholderimage="@mipmap/home_adver_320"/>
        <view
          style="@style/detail_view_style"/>
        <linearlayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:padding="@dimen/detail_product_info_layout_padding">
          <textview
            android:id="@+id/detail_tv_product_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="竹林宾馆"
            android:textsize="@dimen/textsize_20"
            android:textcolor="@color/app_yellow"/>
          <linearlayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margintop="5dp"
            android:layout_marginbottom="5dp"
            android:gravity="center_vertical"
            android:orientation="horizontal">
            <textview
              android:id="@+id/detail_tv_description"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:paddingright="10dp"
              tools:text="大床房入住一晚,交通便利"
              android:textsize="@dimen/textsize_13"/>
            <textview
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/detail_bought"
              android:textsize="@dimen/textsize_14"/>
            <textview
              android:id="@+id/detail_tv_bought"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              tools:text="289"
              android:textsize="@dimen/textsize_14"/>
          </linearlayout>
          <view
            style="@style/detail_view_style"
            android:layout_margintop="@dimen/detail_view_margintop"/>
          <linearlayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingtop="5dp"
            android:paddingbottom="5dp"
            android:orientation="horizontal"
            android:background="@color/white">
            <linearlayout
              android:id="@+id/detail_sure_layout_anytime"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginright="@dimen/detail_sure_layout_marginright"
              android:gravity="center_vertical"
              android:orientation="horizontal">
              <imageview
                android:layout_width="@dimen/detail_sure_icon_width"
                android:layout_height="@dimen/detail_sure_icon_height"
                android:src="@mipmap/mini_icon_sure"/>
              <textview
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginleft="@dimen/detail_sure_text_marginleft"
                android:text="@string/detail_sure_anytime"
                android:textsize="@dimen/textsize_14"/>
            </linearlayout>
            <linearlayout
              android:id="@+id/detail_sure_layout_overdue"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginright="@dimen/detail_sure_layout_marginright"
              android:gravity="center_vertical"
              android:orientation="horizontal">
              <imageview
                android:layout_width="@dimen/detail_sure_icon_width"
                android:layout_height="@dimen/detail_sure_icon_height"
                android:src="@mipmap/mini_icon_sure"/>
              <textview
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginleft="@dimen/detail_sure_text_marginleft"
                android:text="@string/detail_sure_overdue"
                android:textsize="@dimen/textsize_14"/>
            </linearlayout>
            <linearlayout
              android:id="@+id/detail_sure_layout_sevenday"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginright="@dimen/detail_sure_layout_marginright"
              android:gravity="center_vertical"
              android:orientation="horizontal">
              <imageview
                android:layout_width="@dimen/detail_sure_icon_width"
                android:layout_height="@dimen/detail_sure_icon_height"
                android:src="@mipmap/mini_icon_sure"/>
              <textview
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginleft="@dimen/detail_sure_text_marginleft"
                android:text="@string/detail_sure_sevenday"
                android:textsize="@dimen/textsize_14"/>
            </linearlayout>
          </linearlayout>
          <view
            style="@style/detail_view_style"/>
          <linearlayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margintop="@dimen/detail_merchant_info_layout_margintop"
            android:background="@color/white"
            android:orientation="vertical">
            <textview
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/detail_merchant_info"
              android:textcolor="@color/detail_merchant_info_color"
              android:textsize="@dimen/textsize_17"/>
            <view
              style="@style/detail_view_style"
              android:layout_margintop="@dimen/detail_view_margintop"/>
            <textview
              android:id="@+id/detail_tv_merchant_title"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:padding="5dp"
              tools:text="兴鑫宾馆"
              android:textsize="@dimen/textsize_16"/>
            <linearlayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:padding="@dimen/detail_merchant_detail_layout_padding"
              android:orientation="horizontal">
              <linearlayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:orientation="vertical">
                <textview
                  android:id="@+id/detail_merchant_tv_address"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  tools:text="湖北咸宁咸安区鱼水路89号"/>
                <textview
                  android:id="@+id/detail_merchant_tv_hours"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margintop="5dp"
                  tools:text="营业时间:24小时"/>
                <textview
                  android:id="@+id/detail_merchant_tv_distance"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margintop="5dp"
                  tools:text="6.8km"/>
              </linearlayout>
              <view
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@mipmap/line_divide_vertical"/>
              <imageview
                android:id="@+id/detail_merchant_iv_call"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_gravity="center"
                android:src="@mipmap/ic_call"/>
            </linearlayout>
          </linearlayout>
        </linearlayout>
        <include
          android:id="@+id/detail_include_description"
          layout="@layout/layout_detail_description"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/>
      </linearlayout>
    </com.myxh.coolshopping.ui.widget.observerscrollview>
    <linearlayout
      android:id="@+id/detail_title_layout"
      android:layout_width="match_parent"
      android:layout_height="45dp"
      android:orientation="horizontal"
      android:layout_alignparenttop="true"
      android:padding="@dimen/detail_title_layout_padding">
      <imageview
        android:id="@+id/detail_title_iv_back"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:src="@mipmap/icon_back_black"/>
      <textview
        android:id="@+id/detail_title_tv_title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center"
        android:layout_marginend="@dimen/detail_title_tv_marginlr"
        android:layout_marginstart="@dimen/detail_title_tv_marginlr"
        android:gravity="center"
        tools:text="国际酒店"
        android:singleline="true"
        android:ellipsize="end"
        android:textsize="@dimen/textsize_20"/>
      <imageview
        android:id="@+id/detail_title_iv_favorite"
        android:layout_toleftof="@+id/detail_title_iv_share"
        android:layout_marginright="5dp"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:src="@mipmap/icon_uncollect_black"/>
      <imageview
        android:id="@+id/detail_title_iv_share"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignparentright="true"
        android:src="@mipmap/icon_share_black"/>
    </linearlayout>
  </relativelayout>
  <relativelayout
    android:id="@+id/detail_layout_buy"
    android:layout_width="match_parent"
    android:layout_height="@dimen/detail_layout_buy_height"
    android:layout_alignparentbottom="true"
    android:background="@color/white">
    <view
      style="@style/detail_view_style"/>
    <linearlayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:orientation="horizontal">
      <linearlayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:layout_weight="1"
        android:orientation="horizontal">
        <linearlayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal">
          <textview
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginleft="15dp"
            android:text="$"
            android:textsize="@dimen/textsize_14"
            android:textcolor="@color/app_yellow"
            android:textstyle="bold"/>
          <textview
            android:id="@+id/detail_layout_buy_price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginleft="@dimen/detail_layout_buy_price_marginleft"
            tools:text="119"
            android:textsize="@dimen/textsize_23"
            android:textcolor="@color/app_yellow"
            android:textstyle="bold"/>
        </linearlayout>
        <linearlayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:layout_marginleft="15dp"
          android:orientation="vertical">
          <textview
            android:id="@+id/detail_layout_buy_value"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="$998"
            android:textsize="@dimen/textsize_12"/>
          <textview
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/detail_bottom_retail_price"
            android:textsize="@dimen/textsize_12"/>
        </linearlayout>
      </linearlayout>
      <button
        android:id="@+id/detail_layout_buy_btn"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:text="@string/detail_bottom_buy"
        android:textsize="@dimen/textsize_17"
        android:textcolor="@color/white"
        android:background="@color/app_yellow"/>
    </linearlayout>
  </relativelayout>
</relativelayout>

以上所述是小编给大家介绍的android仿拉手团购app产品详情界面效果,希望对大家有所帮助