소스 검색

添加发现模块底线

(cherry picked from commit f789308)
zengjiebin 7 년 전
부모
커밋
ac8dc862f5

+ 2 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java

@@ -127,10 +127,11 @@ public class FgtFindChild extends BaseCompatFragment {
                     page += 1;
                     initData();
                 }else {
-                    view_list.loadMoreComplete();
+                    view_list.setNoMore(true);
                 }
             }
         });
+        ViewUtil.setBootomLine(view_list);
         view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         view_list.setAdapter(new AdbCommonRecycler<FindItem>(SheepApp.getInstance(), list){
 

+ 31 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -43,6 +43,8 @@ import com.bumptech.glide.Glide;
 import com.bumptech.glide.RequestBuilder;
 import com.bumptech.glide.request.RequestOptions;
 import com.google.gson.Gson;
+import com.jcodecraeer.xrecyclerview.CustomFooterViewCallBack;
+import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.kfzs.duanduan.fragment.FgtPersonalCenter;
 import com.sheep.gamegroup.dateview.DatePickerDialog;
 import com.sheep.gamegroup.dateview.DateUtil;
@@ -443,6 +445,35 @@ public class ViewUtil {
 
     }
 
+    public static void setBootomLine(XRecyclerView view_list) {
+        View view = LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.common_foot_view, null);
+        view_list.setFootView(view, new CustomFooterViewCallBack() {
+            @Override
+            public void onLoadingMore(View yourFooterView) {
+                TextView bottom_line_text = yourFooterView.findViewById(R.id.bottom_line_text);
+                bottom_line_text.setText("羊羊努力加载中...");
+            }
+
+            @Override
+            public void onLoadMoreComplete(View yourFooterView) {
+                TextView bottom_line_text = yourFooterView.findViewById(R.id.bottom_line_text);
+                bottom_line_text.setText("羊羊努力加载中...");
+            }
+
+            @Override
+            public void onSetNoMore(View yourFooterView, boolean noMore) {
+                TextView bottom_line_text = yourFooterView.findViewById(R.id.bottom_line_text);
+                bottom_line_text.setText("我是有底线的,点击我回到顶部");
+                yourFooterView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        view_list.scrollToPosition(0);
+                    }
+                });
+            }
+        });
+    }
+
     /**
      * popwindow消失监听类,消失恢复window透明度
      */

+ 30 - 0
app/src/main/res/layout/common_foot_view.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/bottom_line"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <!--必须至少两层,否则不能居中-->
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:padding="@dimen/content_padding_20">
+
+        <ImageView
+            android:layout_width="30dp"
+            android:layout_height="wrap_content"
+            android:adjustViewBounds="true"
+            android:scaleType="fitXY"
+            android:src="@mipmap/bottom_icon" />
+
+        <TextView
+            android:id="@+id/bottom_line_text"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/content_padding"
+            android:text="我是有底线的"
+            android:textColor="#C0C0C0"
+            android:textSize="14sp" />
+    </LinearLayout>
+</RelativeLayout>

+ 4 - 4
app/src/main/res/values/strings.xml

@@ -15,11 +15,11 @@
 
     <string name="total_money_lable">绵羊币总余额:</string>
     <string name="total_money">%s元</string>
-    <string name="task_reward">任务奖励额:%s元</string>
-    <string name="agent_extract">推广提成额:%s元</string>
-    <string name="recharge_amount">充值额:%s元</string>
+    <string name="task_reward">任务奖励额:%s元</string>
+    <string name="agent_extract">推广提成额:%s元</string>
+    <string name="recharge_amount">充值额:%s元</string>
     <string name="available_amount">可提现金额:%s元</string>
-    <string name="dingxiang_amount">福利额:%s元</string>
+    <string name="dingxiang_amount">福利额:%s元</string>
 
     <string name="rechargeq_amount">当前绵羊币余额:%s元</string>