矽谷商城第二版6--購物車模塊

来源:http://www.cnblogs.com/ganchuanpu/archive/2017/05/15/6858614.html
-Advertisement-
Play Games

fragment_shoppingcart.xml 1、採用自定義技術實現購物車的加減號; 2、採用CartStorage實現購物車業務的處理; 3、採用popupwindow實現購物車的對話框 4、實現聯繫客服功能; 5、採用Html5和Android互調技術實現詳情頁面; 6、集成支付寶支付功能 ...


fragment_shoppingcart.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="#fff">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginLeft="30dp"
            android:layout_weight="1"
            android:text="購物車"
            android:textColor="#303235"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/tv_shopcart_edit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:text="編輯"
            android:textColor="#303235" />
    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="5dp"
        android:background="#eeee" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/recyclerview"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:layout_height="0dp"
                android:background="#eee" />


            <LinearLayout
                android:id="@+id/ll_check_all"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#fff"
                android:orientation="horizontal"
                android:visibility="visible">

                <CheckBox
                    android:id="@+id/checkbox_all"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:button="@null"
                    android:drawableLeft="@drawable/checkbox_selector"
                    android:drawablePadding="10dp"
                    android:padding="10dp"
                    android:paddingLeft="0dp"
                    android:text="全選"
                    android:textColor="#303235"
                    android:textSize="15sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="10dp"
                    android:text="合計:"
                    android:textColor="#303235"
                    android:textSize="15sp" />

                <TextView
                    android:id="@+id/tv_shopcart_total"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:padding="10dp"
                    android:text="¥0.00"
                    android:textColor="#ed3f3f"
                    android:textSize="15sp" />

                <Button
                    android:id="@+id/btn_check_out"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="#ed3f3f"
                    android:text="去結算"
                    android:textColor="#fff" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/ll_delete"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#fff"
                android:orientation="horizontal"
                android:padding="5dp"
                android:visibility="gone">

                <CheckBox
                    android:id="@+id/cb_all"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_weight="1"
                    android:button="@null"
                    android:drawableLeft="@drawable/checkbox_selector"
                    android:drawablePadding="10dp"
                    android:padding="10dp"
                    android:paddingLeft="0dp"
                    android:text="全選"
                    android:textColor="#303235"
                    android:textSize="15sp" />

                <Button
                    android:id="@+id/btn_delete"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:background="@drawable/words"
                    android:text="刪除"
                    android:textColor="#303235"
                    android:textSize="15sp" />

                <Button
                    android:id="@+id/btn_collection"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_marginLeft="15dp"
                    android:background="@drawable/wordsred"
                    android:text="收藏"
                    android:textColor="#ed3f3f"
                    android:textSize="15sp" />
            </LinearLayout>
        </LinearLayout>

        <include layout="@layout/empty_cart" />
    </FrameLayout>
</LinearLayout>

1、採用自定義技術實現購物車的加減號;
2、採用CartStorage實現購物車業務的處理;
3、採用popupwindow實現購物車的對話框
4、實現聯繫客服功能;
5、採用Html5和Android互調技術實現詳情頁面;
6、集成支付寶支付功能; 

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • https://developer.apple.com/contact/phone/ ...
  • 一,效果圖。 二,工程圖。 三,代碼。 RootViewController.h RootViewController.m ...
  • 首頁中點擊城市TextView調轉到當前城市選擇Activity fragment_city.xml ...
  • 一 fragment_home.xml 二 home_head_page.xml banner 兩頁Bar標誌 熱門電影三個作為一體addHeaderView(headView) 進RefreshListView 三 GoodsListAdapter: 1.SimpleDraweeView實現圓角圖 ...
  • 引言 在項目中,為了使用GreenDAO的自動生成DAO class的功能,我們必須建立entity,該entity通過java註解標識。 Schema是資料庫對象集合,我們可以通過gradle插件配置GreenDAO,除此之外,我們至少需要配置Schema的版本: 我們不僅可以配置schemaVe ...
  • 2017-05-15 概述 Dialog在Android中是一個很優秀的工具。在使用Dialog時,我們一般都會自定義要顯示的內容佈局。Dialog自帶了三個方法來支持自定義內容佈局。 這三個方法內部的實現原理都是一樣的,只是其封裝深度不同而已。三個方法可以說分別照顧了不同定製深度的開發者。 set ...
  • 文章參考自:http://www.runoob.com/w3cnote/android-tutorial-edittext.html 6.控制EditText四周的間隔距離與內部文字與邊框間的距離 我們使用margin相關屬性增加組件相對其他控制項的距離,比如android:marginTop = " ...
  • 轉載請註明:http://www.cnblogs.com/igoslly/p/6858656.html 初步設置Menu 設置Menu,在ActionBar上添加按鈕操作: 在main/res目錄下添加menu文件夾,創建main.xml文件 showAsAction屬性共有五個值:ifRoom、n ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...