zhaoyi 8 anni fa
parent
commit
04ecd830ac

+ 66 - 6
app/src/main/java/com/sheep/jiuyan/samllsheep/page/MainActivity.java

@@ -5,9 +5,11 @@ import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.os.Build;
 import android.os.Bundle;
+import android.support.design.widget.AppBarLayout;
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.view.ViewPager;
+import android.support.v4.widget.SwipeRefreshLayout;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -27,6 +29,10 @@ import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 import java.util.ArrayList;
 import java.util.List;
 
+import de.hdodenhof.circleimageview.CircleImageView;
+
+import static android.support.v4.view.ViewPager.SCROLL_STATE_IDLE;
+
 
 /*
 * author:kemllor
@@ -41,6 +47,11 @@ public class MainActivity extends BaseActivity {
     private RappTabLayout mRappTabLayout;
     private ViewPager mViewPager;
     private AdpMainPageViewPager mAdpMainPageViewPager;
+    private SwipeRefreshLayout mSwipeRefreshLayout;
+    private FgtMainPageTask mFgtMainPageTask;
+    private FgtMainPageOffline mFgtMainPageOffline;
+    private AppBarLayout mAppBarLayout;
+
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -102,32 +113,81 @@ public class MainActivity extends BaseActivity {
 
     @Override
     public void initListener() {
+        //防止右滑一部分后,还能下拉刷新。
+        mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+                if (positionOffsetPixels > 10 && mSwipeRefreshLayout.isEnabled()) {
+                    mSwipeRefreshLayout.setEnabled(false);
+                }
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+                if (state == SCROLL_STATE_IDLE) {
+                    mSwipeRefreshLayout.setEnabled(true);
+                }
+            }
+        });
+        //防止下拉刷新效果差
+        mAppBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
+            @Override
+            public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
+                if (verticalOffset >= 0) {
+                    mSwipeRefreshLayout.setEnabled(true);
+                } else {
+                    mSwipeRefreshLayout.setEnabled(false);
+                }
+            }
+        });
+
+        mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                mSwipeRefreshLayout.setRefreshing(false);
+                G.showToast("刷新这里要改");
+                mFgtMainPageTask.initData(false);
+                //mFgtMainPageOffline.initData();
+            }
+        });
     }
 
     @Override
     public void initData() {
         ((TextView) findViewById(R.id.txt_main_activity_money))
-                .setText(G.mUser.getBalance());
+                .setText("¥" + G.mUser.getBalance());
         ((TextView) findViewById(R.id.txt_main_activity_nick))
                 .setText(G.mUser.getNickName());
         Glide.with(this)
                 .load(G.mUser.getIcon())
                 .placeholder(R.drawable.icon)
                 .dontAnimate()
-                .into((ImageView) findViewById(R.id.img_user));
+                .into((CircleImageView) findViewById(R.id.img_user));
     }
 
     @Override
     public void initView() {
         mRappTabLayout = (RappTabLayout) findViewById(R.id.tab_main_activity);
         mViewPager = (ViewPager) findViewById(R.id.viewpager_main_activity);
+        mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_main_activity);
+        mAppBarLayout = (AppBarLayout) findViewById(R.id.app_layout_main_activity);
+        mSwipeRefreshLayout.setProgressViewOffset(true,
+                getResources().getDimensionPixelOffset(R.dimen.layout_heigh_default),
+                G.getRealPix(80));
 
         mAdpMainPageViewPager = new AdpMainPageViewPager(getSupportFragmentManager());
-        mAdpMainPageViewPager.add(new FgtMainPageTask());
-        mAdpMainPageViewPager.add(new FgtMainPageOffline());
+        mFgtMainPageTask = new FgtMainPageTask();
+        mAdpMainPageViewPager.add(mFgtMainPageTask);
+        mFgtMainPageOffline = new FgtMainPageOffline();
+        mAdpMainPageViewPager.add(mFgtMainPageOffline);
         mViewPager.setAdapter(mAdpMainPageViewPager);
-        mRappTabLayout.setLine(G.getRealPix(30), G.getRealPix(4))
-                .setLineMargin(0, G.getRealPix(2), 0, G.getRealPix(4))
+        mRappTabLayout.setLine(G.getRealPix(20), G.getRealPix(4))
+                .setLineMargin(0, G.getRealPix(2), 0, 0)
                 .setLineColor(getResources().getColor(R.color.black_text_deep))
                 .setupWithViewPager(mViewPager, R.layout.tab_ripple);
 

+ 11 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/adapter/AdpMainActivity.java

@@ -2,6 +2,7 @@ package com.sheep.jiuyan.samllsheep.page.adapter;
 
 import android.content.Context;
 import android.content.Intent;
+import android.text.Html;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -10,6 +11,7 @@ import com.bumptech.glide.Glide;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.page.WebActivity;
 import com.sheep.jiuyan.samllsheep.page.entry.TaskPublish;
+import com.sheep.jiuyan.samllsheep.utils.G;
 
 /**
  * @ Created by Dlg
@@ -23,6 +25,7 @@ public class AdpMainActivity extends AdpCommonRecy<TaskPublish> {
 
     public final static int TAG_TASK = R.id.tagid1;
     private final static int TAG_URL = R.id.tagid2;
+    private final static String HTML_FORMAT = "任务数量:<font color=\"#ef712c\">数量</font>/总数";
 
     /**
      * 点击后的监听处理,一定要先设置再setAdapter
@@ -52,7 +55,8 @@ public class AdpMainActivity extends AdpCommonRecy<TaskPublish> {
         holder.getView(R.id.txt_baseactivity_title, TextView.class)
                 .setText(taskPublish.getTask().getTitle());
         holder.getView(R.id.tv_count, TextView.class)
-                .setText(taskPublish.getSurplusCount() + "/" + taskPublish.getTotalCouont());
+                .setText(Html.fromHtml(HTML_FORMAT.replace("数量", taskPublish.getSurplusCount() + "")
+                        .replace("总数", taskPublish.getTotalCouont() + "")));
         holder.getView(R.id.tv_time, TextView.class)
                 .setText(String.format("截止日期:%s", taskPublish.getOverTime()));
         holder.getView(R.id.tv_money, TextView.class)
@@ -80,6 +84,12 @@ public class AdpMainActivity extends AdpCommonRecy<TaskPublish> {
                 mContext.startActivity(intent);
             }
         });
+        holder.getView(R.id.btn_task_item).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                G.showToast("点下载游戏");
+            }
+        });
     }
 
 }

+ 5 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/fragment/FgtMainPageOffline.java

@@ -21,7 +21,7 @@ public class FgtMainPageOffline extends BaseFragment {
 
     @Override
     public int getLayoutId() {
-        return R.layout.fgt_main_page_task;
+        return R.layout.fgt_main_page_offline;
     }
 
     @Override
@@ -30,4 +30,8 @@ public class FgtMainPageOffline extends BaseFragment {
     }
 
 
+    public void initData(){
+
+    }
+
 }

+ 38 - 4
app/src/main/java/com/sheep/jiuyan/samllsheep/page/fragment/FgtMainPageTask.java

@@ -3,6 +3,8 @@ package com.sheep.jiuyan.samllsheep.page.fragment;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.support.v7.app.AlertDialog;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.TextView;
@@ -18,13 +20,18 @@ import com.sheep.jiuyan.samllsheep.page.adapter.AdpMainActivity;
 import com.sheep.jiuyan.samllsheep.page.entry.TaskPublish;
 import com.sheep.jiuyan.samllsheep.page.entry.User;
 import com.sheep.jiuyan.samllsheep.page.entry.WXTask;
+import com.sheep.jiuyan.samllsheep.utils.BackDo;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
+import com.sheep.jiuyan.samllsheep.utils.RecyleViewLoadMoreUtils;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 
+import okhttp3.Call;
+
 /**
  * @ Created by Dlg
  * @ <p>TiTle:  FgtMainPageTask</p>
@@ -39,16 +46,18 @@ public class FgtMainPageTask extends BaseFragment {
     private AdpMainActivity mAdapter;
     private TaskPublish mClickItem;
     private AlertDialog mDialog;
+    private RecyclerView mRecyclerView;
+    private RecyleViewLoadMoreUtils mRecyleViewLoadMoreUtils;
+    private int mIntLastPage = 0;
 
 
     @Override
     public int getLayoutId() {
-        return R.layout.fgt_main_page_offline;
+        return R.layout.fgt_main_page_task;
     }
 
     @Override
     public void onViewCreated() {
-
         mAdapter = new AdpMainActivity(getActivity());
         mAdapter.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -57,6 +66,17 @@ public class FgtMainPageTask extends BaseFragment {
                 checkUserTask();
             }
         });
+        mRecyclerView = findViewById(R.id.recy_fgt_main_page_task, RecyclerView.class);
+        mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
+        mRecyclerView.setAdapter(mAdapter);
+        mRecyleViewLoadMoreUtils = new RecyleViewLoadMoreUtils();
+        mRecyleViewLoadMoreUtils.setLoadMore(mRecyclerView, new BackDo() {
+            @Override
+            public void Run() {
+                initData(true);
+            }
+        });
+        initData(false);
     }
 
 
@@ -105,7 +125,7 @@ public class FgtMainPageTask extends BaseFragment {
         NetManager.get(Url.USER_REGISTER_TASK, map, getActivity(), new SheepCallback<String>(getActivity()) {
             @Override
             public void success(String o) {
-                initData();
+                initData(false);
                 String pkg = mClickItem.getTask().getPkg();
                 if (!TextUtils.isEmpty(pkg))
                     if (PackageUtil.isAppInstalled(getActivity(), pkg)) {
@@ -144,17 +164,31 @@ public class FgtMainPageTask extends BaseFragment {
     }
 
 
-    public void initData() {
+    public void initData(final boolean isLoadMore) {
+        //TODO 这里不知道怎么设计分页,自己添加吧。小刁写
+        mIntLastPage = isLoadMore ? mIntLastPage + 1 : 1;
         requestNewPeopleTask();
         HashMap<String, String> map = new HashMap<>();
         map.put("wx_open_id", SpUtils.getOpenId(getActivity()));
         NetManager.get(Url.PUBLISH_TASKS, map, getActivity(), new SheepCallback<List<TaskPublish>>(getActivity()) {
             @Override
             public void success(List<TaskPublish> tasks) {
+                if (!isLoadMore) {
+                    mAdapter.clear();
+                }
                 if (tasks != null && tasks.size() > 0) {
                     mAdapter.addAll(tasks);
                     mAdapter.notifyDataSetChanged();
                 }
+                //TODO 请求的个数最好弄成统一管理的常量
+                mRecyleViewLoadMoreUtils.setmIsLoading(tasks.size() != 10);
+            }
+
+            //TODO 你的框架不知道哪个是失败必须执行的,要添加拒绝加载更多等
+            @Override
+            public void onFailure(Call call, IOException e) {
+                super.onFailure(call, e);
+                mRecyleViewLoadMoreUtils.setmIsLoading(true);
             }
         });
         NetManager.get(Url.USER_INFO, map, getActivity(), new SheepCallback<User>(getActivity()) {

BIN
app/src/main/res/drawable-hdpi/switch.png


BIN
app/src/main/res/drawable-xhdpi/switch.png


BIN
app/src/main/res/drawable-xxhdpi/switch.png


+ 1 - 1
app/src/main/res/drawable/ic_arrow_back_24dp.xml

@@ -1,4 +1,4 @@
 <!--<vector xmlns:android="http://schemas.android.com/apk/res/android"--><!--android:width="24dp"--><!--android:height="24dp"--><!--android:viewportHeight="24.0"--><!--android:viewportWidth="24.0">--><!--<path--><!--android:fillColor="@color/B"--><!--android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z" />--><!--</vector>-->
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="@mipmap/narrow_black" />
+    <item android:drawable="@drawable/narrow_back_black" />
 </selector>

+ 6 - 0
app/src/main/res/drawable/sp_btn_common_green.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/colorPrimary" />
+    <corners android:radius="100dp" />
+</shape>

+ 6 - 0
app/src/main/res/drawable/sp_btn_common_orange.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/colorPrimary" />
+    <corners android:radius="100dp" />
+</shape>

+ 1 - 1
app/src/main/res/layout/line_h_1px_black.xml

@@ -4,5 +4,5 @@
     android:layout_width="match_parent"
     android:layout_height="1px"
     android:layout_alignParentBottom="true"
-    android:background="@color/black_light"/>
+    android:background="@color/divier"/>
 

+ 117 - 81
app/src/main/res/layout/main_activity.xml

@@ -1,96 +1,132 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.v4.widget.SwipeRefreshLayout 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:id="@+id/swipe_main_activity"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:addStatesFromChildren="true"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
-    <include layout="@layout/title" />
-
-    <android.support.constraint.ConstraintLayout
+    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@color/colorPrimary"
-        android:paddingTop="@dimen/content_padding_small">
+        android:layout_height="match_parent">
 
-        <TextView
-            android:id="@+id/txt_main_activity_money"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="xxx元"
-            android:textColor="@color/black_text_gray"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <LinearLayout
-            android:layout_width="wrap_content"
+        <android.support.design.widget.AppBarLayout
+            android:id="@+id/app_layout_main_activity"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:background="@drawable/texe_background_round_theme_left"
-            android:gravity="center_vertical"
-            android:orientation="horizontal"
-            android:paddingBottom="@dimen/content_padding_small"
-            android:paddingLeft="@dimen/content_padding"
-            android:paddingRight="@dimen/content_padding"
-            android:paddingTop="@dimen/content_padding_small"
-            app:layout_constraintTop_toBottomOf="@+id/txt_main_activity_money"
-            tools:layout_editor_absoluteX="0dp">
-
-            <ImageView
-                android:id="@+id/img_user"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_centerVertical="true"
-                android:src="@color/colorAccent" />
-
-            <TextView
-                android:id="@+id/txt_main_activity_nick"
-                android:layout_width="wrap_content"
+            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
+
+            <android.support.design.widget.CollapsingToolbarLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/content_padding_small"
-                android:text="陈大狗"
-                android:textColor="@color/theme_sheep_dark"
-                android:textSize="@dimen/text_size_2" />
-        </LinearLayout>
+                app:contentScrim="@color/colorPrimary"
+                app:layout_scrollFlags="scroll|exitUntilCollapsed">
 
 
-        <TextView
-            android:id="@+id/tv_withdraw"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerVertical="true"
-            android:background="@drawable/texe_background_round_theme_right"
-            android:gravity="center_vertical"
-            android:paddingBottom="@dimen/content_padding_small"
-            android:paddingLeft="@dimen/content_padding"
-            android:paddingTop="@dimen/content_padding_small"
-            android:text="现金提现"
-            android:textColor="@color/theme_sheep_dark"
-            android:textSize="@dimen/text_size_2"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/txt_main_activity_money" />
-
-        <com.sheep.jiuyan.samllsheep.page.view.RappTabLayout
-            android:id="@+id/tab_main_activity"
-            android:layout_width="344dp"
-            android:layout_height="48dp"
-            android:layout_marginTop="@dimen/content_padding_big"
-            app:layout_constraintTop_toBottomOf="@+id/tv_withdraw"
-            tools:layout_editor_absoluteX="8dp"></com.sheep.jiuyan.samllsheep.page.view.RappTabLayout>
-
-        <android.support.v4.view.ViewPager
-            android:id="@+id/viewpager_main_activity"
-            android:layout_width="344dp"
-            android:layout_height="wrap_content"
-            android:background="@color/white"
-            app:layout_constraintTop_toBottomOf="@+id/tab_main_activity"
-            tools:layout_editor_absoluteX="8dp">
+                <android.support.constraint.ConstraintLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/layout_heigh_default"
+                    android:background="@color/colorPrimary"
+                    android:paddingBottom="@dimen/content_padding_big"
+                    android:paddingTop="@dimen/content_padding_small">
+
+                    <TextView
+                        android:id="@+id/txt_main_activity_money"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="xxx元"
+                        android:textColor="@color/black_text_gray"
+                        app:layout_constraintLeft_toLeftOf="parent"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/texe_background_round_theme_left"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal"
+                        android:paddingBottom="@dimen/content_padding_small"
+                        android:paddingLeft="@dimen/content_padding"
+                        android:paddingRight="@dimen/content_padding"
+                        android:paddingTop="@dimen/content_padding_small"
+                        app:layout_constraintTop_toBottomOf="@id/txt_main_activity_money">
+
+                        <de.hdodenhof.circleimageview.CircleImageView
+                            android:id="@+id/img_user"
+                            android:layout_width="20dp"
+                            android:layout_height="20dp"
+                            android:layout_centerVertical="true"
+                            android:src="@color/colorAccent" />
+
+                        <TextView
+                            android:id="@+id/txt_main_activity_nick"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="@dimen/content_padding_small"
+                            android:text="陈大狗"
+                            android:textColor="@color/theme_sheep_dark"
+                            android:textSize="@dimen/text_size_2" />
+                    </LinearLayout>
+
 
-        </android.support.v4.view.ViewPager>
+                    <TextView
+                        android:id="@+id/tv_withdraw"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_centerVertical="true"
+                        android:background="@drawable/texe_background_round_theme_right"
+                        android:gravity="center_vertical"
+                        android:paddingBottom="@dimen/content_padding_small"
+                        android:paddingLeft="@dimen/content_padding"
+                        android:paddingTop="@dimen/content_padding_small"
+                        android:text="现金提现"
+                        android:textColor="@color/theme_sheep_dark"
+                        android:textSize="@dimen/text_size_2"
+                        app:layout_constraintRight_toRightOf="parent"
+                        app:layout_constraintTop_toBottomOf="@id/txt_main_activity_money" />
+
+                </android.support.constraint.ConstraintLayout>
+
+
+                <android.support.v7.widget.Toolbar
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/layout_heigh_default"
+                    android:layout_gravity="top"
+                    app:contentInsetLeft="0dp"
+                    app:contentInsetStart="0dp"
+                    app:layout_collapseMode="pin">
+
+                    <include layout="@layout/title" />
+                </android.support.v7.widget.Toolbar>
+
+            </android.support.design.widget.CollapsingToolbarLayout>
+
+            <com.sheep.jiuyan.samllsheep.page.view.RappTabLayout
+                android:id="@+id/tab_main_activity"
+                android:layout_width="match_parent"
+                android:layout_height="40dp" />
+        </android.support.design.widget.AppBarLayout>
+
+        <android.support.v4.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fillViewport="true"
+            app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+            <android.support.v4.view.ViewPager
+                android:id="@+id/viewpager_main_activity"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/white">
 
-    </android.support.constraint.ConstraintLayout>
+            </android.support.v4.view.ViewPager>
 
+        </android.support.v4.widget.NestedScrollView>
 
+    </android.support.design.widget.CoordinatorLayout>
 
-</LinearLayout>
+</android.support.v4.widget.SwipeRefreshLayout>

+ 56 - 42
app/src/main/res/layout/task_item.xml

@@ -1,27 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:orientation="vertical">
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
 
     <RelativeLayout
+        android:id="@+id/dingwei1"
         android:layout_width="match_parent"
-        android:layout_height="80dp"
-        android:layout_marginTop="10dp"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/content_padding"
         android:background="@color/backgroud"
-        >
+        android:padding="@dimen/content_padding">
 
         <ImageView
             android:id="@+id/img_icon"
             android:layout_width="50dp"
             android:layout_height="50dp"
+            android:layout_alignParentStart="true"
             android:layout_centerVertical="true"
-            android:layout_margin="5dp"
-            android:src="@drawable/icon"/>
+            android:src="@drawable/icon" />
 
         <LinearLayout
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:layout_marginBottom="5dp"
             android:layout_marginLeft="10dp"
             android:layout_marginTop="5dp"
@@ -36,8 +37,8 @@
                 android:layout_weight="1"
                 android:gravity="center_vertical"
                 android:text="title"
-                android:textColor="@color/black_dark"
-                android:textSize="14sp"/>
+                android:textColor="@color/black_text_deep"
+                android:textSize="@dimen/text_size_4" />
 
 
             <TextView
@@ -48,8 +49,8 @@
                 android:layout_weight="1"
                 android:gravity="center_vertical"
                 android:text="250/250"
-                android:textColor="@color/black_light"
-                android:textSize="12sp"/>
+                android:textColor="@color/black_text_gray"
+                android:textSize="@dimen/text_size_2" />
 
             <TextView
                 android:id="@+id/tv_time"
@@ -59,8 +60,8 @@
                 android:layout_weight="1"
                 android:gravity="center_vertical"
                 android:text="截止时间:2018-1-1"
-                android:textColor="@color/black_light"
-                android:textSize="12sp"/>
+                android:textColor="@color/black_text_gray"
+                android:textSize="@dimen/text_size_2" />
 
         </LinearLayout>
 
@@ -73,8 +74,9 @@
             android:layout_alignTop="@id/img_icon"
             android:layout_marginRight="10dp"
             android:text="5.00"
-            android:textColor="@color/sheep_red"
-            android:textSize="22sp"/>
+            android:textColor="@color/orange_text_light"
+            android:textSize="@dimen/text_size_5"
+            android:textStyle="bold" />
 
         <TextView
             android:id="@+id/tv_text1"
@@ -85,9 +87,10 @@
             android:layout_marginLeft="10dp"
             android:layout_marginRight="3dp"
             android:layout_toLeftOf="@id/tv_bouns"
+            android:gravity="bottom"
             android:text="+"
-            android:textColor="@color/black_light"
-            android:textSize="12sp"/>
+            android:textColor="@color/orange_text_light"
+            android:textSize="@dimen/text_size_4" />
 
         <TextView
             android:id="@+id/tv_money"
@@ -96,28 +99,39 @@
             android:layout_alignTop="@id/img_icon"
             android:layout_toLeftOf="@id/tv_text1"
             android:text="5.00"
-            android:textColor="@color/sheep_red"
-            android:textSize="22sp"/>
-
-        <TextView
-            android:padding="5dp"
-            android:id="@+id/tv_guide"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentRight="true"
-            android:layout_marginBottom="3dp"
-            android:layout_marginRight="5dp"
-            android:layout_weight="1"
-            android:gravity="center_vertical"
-            android:text="任务攻略 >>"
-            android:textColor="@color/theme"
-            android:textSize="12sp"
-            />
-
-        <include
-            layout="@layout/line_h_1px_black"/>
+            android:textColor="@color/orange_text_light"
+            android:textSize="@dimen/text_size_5"
+            android:textStyle="bold" />
 
     </RelativeLayout>
 
-</LinearLayout>
+    <TextView
+        android:id="@+id/tv_guide"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBottom="@+id/btn_task_item"
+        android:layout_below="@id/dingwei1"
+        android:layout_marginLeft="@dimen/content_padding"
+        android:layout_marginRight="@dimen/content_padding"
+        android:layout_marginTop="@dimen/content_padding"
+        android:gravity="center_vertical"
+        android:text="任务详情  >"
+        android:textColor="@color/black_text_gray"
+        android:textSize="@dimen/text_size_2" />
+
+    <Button
+        android:id="@+id/btn_task_item"
+        style="@style/style_btn"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_below="@id/dingwei1"
+        android:layout_margin="@dimen/content_padding"
+        android:text="下载游戏" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/content_padding"
+        android:layout_below="@id/btn_task_item"
+        android:background="@color/background_light_gray" />
+</RelativeLayout>