From 8226f232c39359b36aff8a9b0453c2fb48ee4372 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期一, 18 十二月 2023 11:48:53 +0800
Subject: [PATCH] 用户列表分页加载

---
 app/src/main/java/com/dayu/recharge/activity/NewCardActivity.java     |   46 ++++
 app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java |    2 
 app/src/main/java/com/dayu/recharge/dao/BaseDaoSingleton.java         |    2 
 app/src/main/java/com/dayu/recharge/adapter/BaseRecyclerAdapter.java  |   64 +++++++
 app/src/main/java/com/dayu/recharge/dao/UserCardDao.java              |    5 
 app/src/main/res/layout/activity_newcard_list.xml                     |   37 +++
 app/src/main/res/mipmap-xhdpi/ic_no_more.png                          |    0 
 app/src/main/res/values/colors.xml                                    |    3 
 app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java |   90 ++++++++-
 app/src/main/res/layout/item_new_card.xml                             |   93 +++++----
 app/src/main/res/layout/activity_recharge_list.xml                    |    2 
 app/src/main/java/com/dayu/recharge/adapter/NewCardAdapter.java       |   98 ++++++----
 app/build.gradle                                                      |   19 ++
 app/src/main/res/layout/item_no_more.xml                              |   29 +++
 14 files changed, 389 insertions(+), 101 deletions(-)

diff --git a/app/build.gradle b/app/build.gradle
index 1b6a414..590068d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,6 +1,14 @@
 apply plugin: 'com.android.application'
 
 android {
+    signingConfigs {
+        debug {
+            storeFile file('dycz.jks')
+            storePassword 'dycz@2023'
+            keyAlias 'dayu'
+            keyPassword 'dycz@2023'
+        }
+    }
     namespace 'com.dayu.recharge'
     compileSdk 33
 
@@ -16,6 +24,7 @@
         ndk{
             abiFilters 'armeabi-v7a'
         }
+        signingConfig signingConfigs.debug
 
     }
 
@@ -28,6 +37,9 @@
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
+    }
+    dataBinding {
+        enabled = true;
     }
     viewBinding {
         enabled = true;
@@ -70,4 +82,11 @@
     }
     //婊氬姩閫夋嫨妗�
     implementation 'com.contrarywind:Android-PickerView:4.1.9'
+
+    //鍒楄〃
+    implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5'
+    implementation 'io.github.scwang90:refresh-header-classics:2.0.5'
+    implementation 'androidx.recyclerview:recyclerview:1.2.0'//缁忓吀鍒锋柊澶�
+
+    implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
 }
\ No newline at end of file
diff --git a/app/src/main/java/com/dayu/recharge/activity/NewCardActivity.java b/app/src/main/java/com/dayu/recharge/activity/NewCardActivity.java
index 0d5db30..51d32af 100644
--- a/app/src/main/java/com/dayu/recharge/activity/NewCardActivity.java
+++ b/app/src/main/java/com/dayu/recharge/activity/NewCardActivity.java
@@ -36,6 +36,8 @@
 import org.json.JSONObject;
 
 import java.util.Arrays;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * Copyright (C), 2023,
@@ -93,7 +95,7 @@
                     if (userName.length() <= 1 || !validateName(userName)) {
                         TipUtil.show(NewCardActivity.this, "璇疯緭鍏ユ纭鍚�");
                         return;
-                    } else if (phone.length() < 11) {
+                    } else if (phone.length() < 11 || !isValidPhoneNumber(phone)) {
                         TipUtil.show(NewCardActivity.this, "璇疯緭鍏ユ纭墜鏈哄彿");
                         return;
                     } else if (!Utils.check(userID)) {
@@ -115,6 +117,45 @@
             }
         });
     }
+
+    private boolean isValidPhoneNumber(String phoneNumber) {
+        // 瀹氫箟鎵嬫満鍙风殑姝e垯琛ㄨ揪寮忥紝纭繚鏁板瓧閮ㄥ垎娌℃湁杩炵画6浣嶇浉鍚岀殑鏁板瓧
+        String phoneRegex = "^1[0-9]{10}$";
+
+        // 鍒涘缓 Pattern 瀵硅薄
+        Pattern pattern = Pattern.compile(phoneRegex);
+
+        // 鍒涘缓 matcher 瀵硅薄
+        Matcher matcher = pattern.matcher(phoneNumber);
+
+        // 鍒ゆ柇鎵嬫満鍙锋槸鍚﹀尮閰嶆鍒欒〃杈惧紡
+        return matcher.matches() && !hasSixConsecutiveSameDigits(phoneNumber);
+    }
+
+    /**
+     * 鍒ゆ柇鏄惁鏈�6涓浉鍚岀殑杩炵画鏁板瓧
+     *
+     * @param input
+     * @return
+     */
+    public static boolean hasSixConsecutiveSameDigits(String input) {
+        char[] digits = input.toCharArray();
+
+        for (int i = 0; i <= digits.length - 6; i++) {
+            boolean consecutiveSame = true;
+            for (int j = 1; j < 6; j++) {
+                if (digits[i + j] != digits[i + j - 1]) {
+                    consecutiveSame = false;
+                    break;
+                }
+            }
+            if (consecutiveSame) {
+                return true;
+            }
+        }
+        return false;
+    }
+
 
     private void rxPermission() {
         PermissionX.init(NewCardActivity.this).permissions(Manifest.permission.CAMERA)
@@ -320,10 +361,11 @@
             return (c >= 0x4e00 && c <= 0x9fa5);
         }
     }
+
     @Override
     protected void onDestroy() {
         super.onDestroy();
-        newCardActivity=null;
+        newCardActivity = null;
     }
 
 }
diff --git a/app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java b/app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java
index e959fbb..46bb0e6 100644
--- a/app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java
+++ b/app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java
@@ -3,8 +3,13 @@
 import static com.dayu.recharge.view.TitleBar.ClickType_RIGHT_TEXT;
 
 import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
 import android.view.LayoutInflater;
 import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
 
 import com.dayu.recharge.adapter.NewCardAdapter;
 import com.dayu.recharge.databinding.ActivityNewcardListBinding;
@@ -12,8 +17,19 @@
 import com.dayu.recharge.utils.TipUtil;
 import com.dayu.recharge.view.datepicker.CustomDatePicker;
 import com.dayu.recharge.view.datepicker.DateFormatUtils;
+import com.scwang.smart.refresh.footer.ClassicsFooter;
+import com.scwang.smart.refresh.header.ClassicsHeader;
+import com.scwang.smart.refresh.layout.api.RefreshLayout;
+import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
 
+import java.util.ArrayList;
 import java.util.List;
+
+import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
+import io.reactivex.rxjava3.core.Observable;
+import io.reactivex.rxjava3.core.Scheduler;
+import io.reactivex.rxjava3.schedulers.Schedulers;
 
 /**
  * Copyright (C), 2023,
@@ -26,12 +42,19 @@
 
 
     ActivityNewcardListBinding newcardListBinding;
-    List<UserCardBean> userCardBeanList;
+    List<UserCardBean> userCardBeanList = new ArrayList<>();
     NewCardAdapter adapter;
     private CustomDatePicker beginDatePicker;
     private CustomDatePicker endDatePicker;
     long beginTime;
     long endTime;
+
+    int page = 0;
+
+    //姣忛〉鏁版嵁鏉℃暟
+    int limit = 30;
+    RefreshLayout myRefreshLayout;
+    Handler handler;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -39,21 +62,68 @@
         newcardListBinding = ActivityNewcardListBinding.inflate(LayoutInflater.from(this));
         setContentView(newcardListBinding.getRoot());
         setRightButton();
-        setData();
         initDatePicker();
+        initList();
+        getList();
     }
 
-    private void setData() {
-        try {
-            userCardBeanList = baseDao.userCardDao().findAll();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+    private void initList() {
+        myRefreshLayout = (RefreshLayout) newcardListBinding.refreshLayout;
+        myRefreshLayout.setEnableRefresh(false);
+        myRefreshLayout.setRefreshFooter(new ClassicsFooter(this));
+        myRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
+            @Override
+            public void onLoadMore(RefreshLayout refreshlayout) {
+                page = page + 1;
+                getList();
+            }
+        });
         adapter = new NewCardAdapter(this, userCardBeanList);
-        newcardListBinding.newCardListView.setAdapter(adapter);
-
+        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
+        newcardListBinding.recyclerView.setLayoutManager(layoutManager);
+        newcardListBinding.recyclerView.setAdapter(adapter);
+        int totale = baseDao.userCardDao().getUserTotale();
+        newcardListBinding.userTotal.setText(totale + "");
     }
 
+
+    private void getList() {
+        // 鍒涘缓涓�涓� Observable
+        Observable<List<UserCardBean>> observable = Observable.create(emitter -> {
+            // 鍦ㄨ繖閲屾墽琛屽紓姝ユ搷浣�
+            List<UserCardBean> beanList;
+            if (beginTime == 0 && endTime == 0) {
+                beanList = asynchBaseDao.userCardDao().findAll(page * limit, limit);
+            } else {
+                beanList = asynchBaseDao.userCardDao().findByTime(beginTime, endTime);
+            }
+            // 灏嗙粨鏋滃彂閫佺粰瑙傚療鑰�
+            emitter.onNext(beanList);
+            emitter.onComplete();
+        });
+        // 璁㈤槄瑙傚療鑰�
+        observable.subscribeOn(Schedulers.io()) // 鎸囧畾鍦� IO 绾跨▼鎵ц
+                .observeOn(AndroidSchedulers.mainThread()) // 鎸囧畾鍦ㄥ崟涓�绾跨▼瑙傚療缁撴灉
+                .subscribe(
+                        result -> {
+                            // 鍦ㄨ繖閲屽鐞嗙粨鏋滐紝杩欓噷鏄湪涓荤嚎绋嬩腑
+//                            System.out.println("Result: " + result);
+                            if (result.size() < limit) {
+                                myRefreshLayout.finishLoadMoreWithNoMoreData();
+                            }
+                            if (result != null && result.size() > 0) {
+                                userCardBeanList.addAll(result);
+                            }
+                            adapter.notifyDataSetChanged();
+                        },
+                        error -> {
+                            // 澶勭悊閿欒
+                            System.err.println("Error: " + error.getMessage());
+                        }
+                );
+    }
+
+
     private void setRightButton() {
         titleBar.setOnItemclickListner(ClickType_RIGHT_TEXT, new View.OnClickListener() {
             @Override
diff --git a/app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java b/app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java
index 71f066c..f6c182b 100644
--- a/app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java
+++ b/app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java
@@ -57,7 +57,7 @@
             e.printStackTrace();
         }
         adapter = new NewCardAdapter(this, userCardBeanList);
-        binding.newCardListView.setAdapter(adapter);
+//        binding.newCardListView.setAdapter(adapter);
     }
 
     EdtDialog edtDialog;
diff --git a/app/src/main/java/com/dayu/recharge/adapter/BaseRecyclerAdapter.java b/app/src/main/java/com/dayu/recharge/adapter/BaseRecyclerAdapter.java
new file mode 100644
index 0000000..2560c5f
--- /dev/null
+++ b/app/src/main/java/com/dayu/recharge/adapter/BaseRecyclerAdapter.java
@@ -0,0 +1,64 @@
+package com.dayu.recharge.adapter;
+
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.dayu.recharge.databinding.ItemNoMoreBinding;
+
+/**
+ * Copyright (C), 2023,
+ * Author: zuo
+ * Date: 2023-04-20 8:48
+ * Description:
+ */
+public class BaseRecyclerAdapter<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> {
+
+    /**
+     * viewType--鍒嗗埆涓篿tem浠ュ強绌簐iew
+     */
+    public static final int VIEW_TYPE_ITEM = 1;
+    public static final int VIEW_TYPE_EMPTY = 0;
+
+    public int myiewType;
+
+
+    @NonNull
+    @Override
+    public T onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        return null;
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull T holder, int position) {
+
+    }
+
+    @Override
+    public int getItemCount() {
+        return 0;
+    }
+
+
+
+
+    static class ViewHolderEmpty extends RecyclerView.ViewHolder {
+        ItemNoMoreBinding mBinding;
+        public ItemNoMoreBinding getBinding() {
+            return mBinding;
+        }
+
+        public void setBinding(ItemNoMoreBinding binding) {
+            this.mBinding = binding;
+        }
+
+        public ViewHolderEmpty(ItemNoMoreBinding itemView) {
+            super(itemView.getRoot());
+            this.mBinding = itemView;
+
+        }
+    }
+
+
+}
diff --git a/app/src/main/java/com/dayu/recharge/adapter/NewCardAdapter.java b/app/src/main/java/com/dayu/recharge/adapter/NewCardAdapter.java
index 34cfc6d..72b7380 100644
--- a/app/src/main/java/com/dayu/recharge/adapter/NewCardAdapter.java
+++ b/app/src/main/java/com/dayu/recharge/adapter/NewCardAdapter.java
@@ -1,12 +1,20 @@
 package com.dayu.recharge.adapter;
 
 import android.content.Context;
+import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
 import android.widget.TextView;
 
+import androidx.annotation.NonNull;
+import androidx.databinding.DataBindingUtil;
+import androidx.databinding.ViewDataBinding;
+import androidx.recyclerview.widget.RecyclerView;
+
 import com.dayu.recharge.R;
+import com.dayu.recharge.databinding.ItemNewCardBinding;
+import com.dayu.recharge.databinding.ItemNoMoreBinding;
 import com.dayu.recharge.dbBean.UserCardBean;
 import com.dayu.recharge.utils.DateUtil;
 
@@ -16,7 +24,7 @@
  * Created by zuoxiao on 2018/12/24.
  */
 
-public class NewCardAdapter extends BaseAdapter {
+public class NewCardAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> {
 
     List<UserCardBean> rechargeList;
     Context mContext;
@@ -26,51 +34,69 @@
         this.rechargeList = rechargeList;
     }
 
+
+    @NonNull
     @Override
-    public int getCount() {
-        if (rechargeList == null) {
-            return 0;
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        if (viewType == VIEW_TYPE_EMPTY) {
+            ItemNoMoreBinding emptyView = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.item_no_more, parent, false);
+            return new ViewHolderEmpty(emptyView);
+        } else {
+            ItemNewCardBinding binding = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.item_new_card, parent, false);
+            return new ViewHolder(binding);
+        }
+
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        if (holder instanceof ViewHolder) {
+            if (rechargeList.size() > 0) {
+                ((ViewHolder) holder).getBinding().userName.setText("鐢ㄦ埛鍚�:" + rechargeList.get(position).getUserName());
+                ((ViewHolder) holder).getBinding().userNo.setText("韬唤璇佸彿:" + rechargeList.get(position).getUserID());
+                ((ViewHolder) holder).getBinding().water.setText("鐢佃瘽:" + rechargeList.get(position).getPhone());
+                ((ViewHolder) holder).getBinding().date.setText("鏃ユ湡:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1));
+            }
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        //鍚屾椂杩欓噷涔熼渶瑕佹坊鍔犲垽鏂紝濡傛灉mData.size()涓�0鐨勮瘽锛屽彧寮曞叆涓�涓竷灞�锛屽氨鏄痚mptyView
+        // 閭d箞锛岃繖涓猺ecyclerView鐨刬temCount涓�1
+        if (rechargeList.size() == 0) {
+            return 1;
         }
         return rechargeList.size();
     }
 
     @Override
-    public Object getItem(int position) {
-        return position;
-    }
-
-    @Override
-    public long getItemId(int position) {
-        return position;
-    }
-
-    @Override
-    public View getView(int position, View convertView, ViewGroup parent) {
-        NewCardAdapter.ViewHolder holder = null;
-        if (convertView == null) {
-            holder = new NewCardAdapter.ViewHolder();
-            convertView = View.inflate(mContext, R.layout.item_new_card, null);
-            holder.userName = (TextView) convertView.findViewById(R.id.userName);
-            holder.userNo = (TextView) convertView.findViewById(R.id.userNo);
-            holder.water = (TextView) convertView.findViewById(R.id.water);
-            holder.date = (TextView) convertView.findViewById(R.id.date);
-
-            convertView.setTag(holder);
+    public int getItemViewType(int position) {
+        if (rechargeList.size() == 0) {
+            return VIEW_TYPE_EMPTY;
         } else {
-            holder = (NewCardAdapter.ViewHolder) convertView.getTag();
+            return VIEW_TYPE_ITEM;
         }
-        holder.userName.setText("鐢ㄦ埛鍚�:" + rechargeList.get(position).getUserName());
-        holder.userNo.setText("韬唤璇佸彿:" + rechargeList.get(position).getUserID());
-        holder.water.setText("鐢佃瘽:" + rechargeList.get(position).getPhone());
-        holder.date.setText("鏃ユ湡:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1));
-        return convertView;
     }
 
-    class ViewHolder {
 
-        TextView userName;
-        TextView userNo;
-        TextView water;
-        TextView date;
+    static class ViewHolder extends RecyclerView.ViewHolder {
+        ItemNewCardBinding mBinding;
+
+        public ItemNewCardBinding getBinding() {
+            return mBinding;
+        }
+
+        public void setBinding(ItemNewCardBinding binding) {
+            this.mBinding = binding;
+        }
+
+        public ViewHolder(ItemNewCardBinding itemView) {
+            super(itemView.getRoot());
+            this.mBinding = itemView;
+
+        }
     }
+
+
 }
diff --git a/app/src/main/java/com/dayu/recharge/dao/BaseDaoSingleton.java b/app/src/main/java/com/dayu/recharge/dao/BaseDaoSingleton.java
index 07d53c1..d5eb368 100644
--- a/app/src/main/java/com/dayu/recharge/dao/BaseDaoSingleton.java
+++ b/app/src/main/java/com/dayu/recharge/dao/BaseDaoSingleton.java
@@ -39,7 +39,7 @@
             AsynchBaseDao = Room.databaseBuilder(
                     context,
                     AppDatabase.class,
-                    "ConfigurationData"
+                    SqlitePath + "ConfigurationData"
             ).build();
         }
         return AsynchBaseDao;
diff --git a/app/src/main/java/com/dayu/recharge/dao/UserCardDao.java b/app/src/main/java/com/dayu/recharge/dao/UserCardDao.java
index 5ab72db..4e1dc5f 100644
--- a/app/src/main/java/com/dayu/recharge/dao/UserCardDao.java
+++ b/app/src/main/java/com/dayu/recharge/dao/UserCardDao.java
@@ -35,4 +35,9 @@
     List<UserCardBean> findByTime(long beginTime, long endTime);
     @Query("select  * from UserCardBean where userName like :data or userID like :data or  phone like :data")
     List<UserCardBean> findByData(String data);
+
+    @Query("select  * from UserCardBean order by date desc LIMIT :limit OFFSET :offset")
+    List<UserCardBean> findAll(int offset,int limit);
+    @Query("select COUNT(*) from UserCardBean")
+    int getUserTotale();
 }
diff --git a/app/src/main/res/layout/activity_newcard_list.xml b/app/src/main/res/layout/activity_newcard_list.xml
index b170f31..add0af0 100644
--- a/app/src/main/res/layout/activity_newcard_list.xml
+++ b/app/src/main/res/layout/activity_newcard_list.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout 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="match_parent"
@@ -14,13 +14,36 @@
         app:leftImage="@mipmap/icon_back"
         app:rightText="绛涢��" />
 
-    <ListView
-        android:id="@+id/newCard_listView"
+
+    <com.scwang.smart.refresh.layout.SmartRefreshLayout
+        android:id="@+id/refreshLayout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:cacheColorHint="#ffffff"
-        android:divider="@null"
-        android:dividerHeight="0dp" />
+        android:layout_above="@id/user_total"
+        android:layout_below="@+id/titleBar">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/recyclerView"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="#fff"
+            android:overScrollMode="never"
+            android:padding="10dp" />
+
+        <com.scwang.smart.refresh.footer.ClassicsFooter
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" />
+    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
 
 
-</LinearLayout>
\ No newline at end of file
+    <TextView
+        android:id="@+id/user_total"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:layout_alignParentBottom="true"
+        android:background="@color/title_bg"
+        android:gravity="center"
+        android:text="宸插垱寤虹敤鎴凤細"
+        android:textSize="@dimen/text_size" />
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_recharge_list.xml b/app/src/main/res/layout/activity_recharge_list.xml
index f1726f4..e9994ce 100644
--- a/app/src/main/res/layout/activity_recharge_list.xml
+++ b/app/src/main/res/layout/activity_recharge_list.xml
@@ -31,7 +31,7 @@
         android:layout_alignParentBottom="true"
         android:background="@color/title_bg"
         android:gravity="center"
-        android:text="绱鍏呭�硷細"
+        android:text="宸插姞杞芥暟鎹疮璁″厖鍊硷細"
         android:textSize="@dimen/text_size" />
 
 </RelativeLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_new_card.xml b/app/src/main/res/layout/item_new_card.xml
index 5c63167..574e7eb 100644
--- a/app/src/main/res/layout/item_new_card.xml
+++ b/app/src/main/res/layout/item_new_card.xml
@@ -1,57 +1,66 @@
 <?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="match_parent"
-    android:orientation="vertical">
+
+
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
 
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginLeft="15dp"
-        android:layout_marginTop="10dp"
-        android:layout_marginRight="15dp"
+        android:layout_height="match_parent"
         android:orientation="vertical">
 
-        <TextView
-            android:id="@+id/userName"
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="鐢ㄦ埛鍚�"
-            android:textSize="14sp" />
+            android:layout_marginLeft="15dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginRight="15dp"
+            android:orientation="vertical">
 
-        <TextView
-            android:id="@+id/userNo"
+            <TextView
+                android:id="@+id/userName"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="鐢ㄦ埛鍚�"
+                android:textSize="14sp" />
+
+            <TextView
+                android:id="@+id/userNo"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="鎴峰彿锛�123123"
+                android:textSize="14sp" />
+
+            <TextView
+                android:id="@+id/water"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="姘撮噺锛�123123"
+                android:textSize="14sp" />
+
+            <TextView
+                android:id="@+id/date"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="鏃ユ湡"
+                android:textSize="14sp" />
+
+
+        </LinearLayout>
+
+
+        <View
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="鎴峰彿锛�123123"
-            android:textSize="14sp" />
-
-        <TextView
-            android:id="@+id/water"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="姘撮噺锛�123123"
-            android:textSize="14sp" />
-
-        <TextView
-            android:id="@+id/date"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="鏃ユ湡"
-            android:textSize="14sp" />
-
+            android:layout_height="1px"
+            android:layout_marginTop="15dp"
+            android:background="#000000" />
 
     </LinearLayout>
 
 
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:layout_marginTop="15dp"
-        android:background="#000000" />
+</layout>
 
-</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_no_more.xml b/app/src/main/res/layout/item_no_more.xml
new file mode 100644
index 0000000..2127db5
--- /dev/null
+++ b/app/src/main/res/layout/item_no_more.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/white"
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="50dp"
+            android:layout_marginRight="50dp"
+            android:src="@mipmap/ic_no_more" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:text="娌℃湁鏁版嵁"
+            android:textColor="@color/choose_grey" />
+
+
+    </LinearLayout>
+</layout>
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-xhdpi/ic_no_more.png b/app/src/main/res/mipmap-xhdpi/ic_no_more.png
new file mode 100644
index 0000000..4769505
--- /dev/null
+++ b/app/src/main/res/mipmap-xhdpi/ic_no_more.png
Binary files differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index d1be4a7..b0f58e3 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -20,6 +20,7 @@
     <color name="date_picker_text_dark">#333333</color>
     <color name="ws_pay_alpha">#00000000</color>
     <color name="red">#ff0000</color>
-
+    <color name="white">#FFFFFFFF</color>
     <color name="text_wite">#ffffff</color>
+    <color name="choose_grey">#cdcdcd</color>
 </resources>

--
Gitblit v1.8.0