仿拉手團購App1--首頁,拉手團購app1--

來源:互聯網
上載者:User

仿拉手團購App1--首頁,拉手團購app1--

一 fragment_home.xml

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"              android:orientation="vertical"              android:layout_width="match_parent"              android:layout_height="match_parent">    <include        android:id="@+id/home_titlebar"        layout="@layout/home_title_bar"/>    <com.handmark.pulltorefresh.library.PullToRefreshListView        android:id="@+id/home_pull_to_refresh_listView"        android:layout_width="match_parent"        android:layout_height="match_parent"/></LinearLayout>

二 home_head_page.xml

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"              xmlns:app="http://schemas.android.com/apk/res-auto"              android:orientation="vertical"              android:layout_width="match_parent"              android:layout_height="match_parent"              android:paddingBottom="@dimen/head_page_paddingTB">    <include        android:id="@+id/home_head_include_banner"        layout="@layout/home_banner"/>    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="168dp">        <android.support.v4.view.ViewPager            android:id="@+id/home_head_pager"            android:layout_width="match_parent"            android:layout_height="match_parent">        </android.support.v4.view.ViewPager>        <com.myxh.coolshopping.ui.widget.Indicator            android:id="@+id/home_head_indicator"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_alignParentBottom="true"            android:layout_centerHorizontal="true"            app:indicator_number="2"            app:indicator_radius="8"            app:indicator_foreColor="@color/app_yellow"            app:indicator_bgColor="@color/bg_common_gray"/>    </RelativeLayout>    <include        android:id="@+id/home_head_include_film"        layout="@layout/home_film"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_marginTop="@dimen/head_page_paddingTB"/></LinearLayout>

banner  兩頁Bar標誌 熱門電影三個作為一體addHeaderView(headView) 進RefreshListView 

 

三 GoodsListAdapter:

mGoodsListAdapter = new GoodsListAdapter(getActivity(),mGoodlist,headerViewsCount);mRefreshListView.setAdapter(mGoodsListAdapter);

1.SimpleDraweeView實現圓角圖片

2.免預約圖片的顯示

<FrameLayout    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_centerInParent="true">    <com.facebook.drawee.view.SimpleDraweeView        android:id="@+id/good_photo"        android:layout_width="@dimen/good_image_width"        android:layout_height="@dimen/good_image_height"        android:layerType="software"        android:scaleType="centerCrop"        fresco:placeholderImage="@mipmap/default_list_pic"/>    <ImageView        android:id="@+id/good_icon"        android:layout_width="@dimen/good_image_width"        android:layout_height="@dimen/good_image_height"        android:layerType="software"        android:scaleType="centerCrop"        android:src="@mipmap/pic_b"/>    <ImageView        android:id="@+id/good_appointment_img"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layerType="software"        android:scaleType="centerCrop"        android:src="@mipmap/appointment_img"/></FrameLayout>

Adapter中控制是否顯示

if (mGoodlist.get(i).getIs_appointment() == 1) {            holder.goodAppointmentImg.setVisibility(View.VISIBLE);} else {            holder.goodAppointmentImg.setVisibility(View.GONE);}

3.原有價格添加刪除線

holder.goodValue = (TextView) convertView.findViewById(R.id.good_tv_value);holder.goodValue.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);//添加刪除線

  

github地址:https://github.com/ganchuanpu/CoolShopping

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.