Przeglądaj źródła

我的资产可以上下滑动

zengjiebin 7 lat temu
rodzic
commit
daaf5e92c7

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -254,7 +254,7 @@ public interface ApiService {
     /**
      * 用户提现记录
      */
-    @GET("app/withdraw/")
+    @GET(ApiKey.withdraw)
     Observable<BaseMessage> goWithdrawal(@Query("page") int page, @Query("per_page") int per_page, @Query("start_time") String start_time, @Query("end_time") String end_time);
 
 
@@ -486,7 +486,7 @@ public interface ApiService {
     /**
      * 充值记录
      */
-    @GET("app/recharge/recharge_balance_log")
+    @GET(ApiKey.recharge_balance_log)
     Observable<BaseMessage> getRechargeBalanceLog(@Query("page") int page, @Query("per_page") int per_page);
 
     /**
@@ -764,8 +764,8 @@ public interface ApiService {
     /**
      * 收支明细
      */
-    @GET("app/user/recharge_log")
-    Observable<BaseMessage> rechargeLog(@Query("page") int page, @Query("per_page") int per_page);
+    @GET(ApiKey.recharge_log)
+    Observable<BaseMessage> getRechargeLog(@Query("page") int page, @Query("per_page") int per_page);
 
 
     /**

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/RechargeLogEntity.java

@@ -13,7 +13,7 @@ import java.util.Locale;
  * Created by ljy on 2018/6/27.
  */
 
-public class RechargeLogEntity implements ILog {
+public class RechargeLog implements ILog {
     private int From1;//	integer($int64)1:完成任务 2提现审核不通过退钱 3微信挂机赚钱 4下级完成任务提成 5贷款 6注册奖励 7旧版同步过来的 8第三方充值 9新手任务 10Q币充值失败退钱11:提现 12游戏充值 13 购买APP Store充值卡 14 充值Q币 15打卡报名 16实名认证费用 17游戏消费 18扣除游戏抵扣券 19代理代充 21打卡奖励 22代理提成 23增加游戏抵扣券
 
     private String Status;//	string

+ 77 - 0
app/src/main/java/com/sheep/gamegroup/module/personal/adapter/AdpILog.java

@@ -0,0 +1,77 @@
+package com.sheep.gamegroup.module.personal.adapter;
+
+import android.support.annotation.Nullable;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.model.entity.ILog;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/12/21.
+ * realicing@sina.com
+ * 用户充值记录、提现记录、收支明细
+ */
+public class AdpILog extends BaseQuickAdapter<ILog, BaseViewHolder> {
+    public AdpILog(@Nullable List<ILog> data) {
+        super(R.layout.x_my_money_act_layout_item, data);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, ILog item) {
+        View convertView = helper.itemView;
+        int position = helper.getAdapterPosition();
+
+        View my_money_item_top = convertView.findViewById(R.id.my_money_item_top);
+        View my_money_item_center = convertView.findViewById(R.id.my_money_item_center);
+        View my_money_item_bottom = convertView.findViewById(R.id.my_money_item_bottom);
+        final TextView my_money_item_recharge_amount = convertView.findViewById(R.id.my_money_item_recharge_amount);
+        TextView my_money_item_recharge_status = convertView.findViewById(R.id.my_money_item_recharge_status);
+        TextView my_money_item_recharge_time = convertView.findViewById(R.id.my_money_item_recharge_time);
+        final ImageView my_money_item_recharge_amount_iv = convertView.findViewById(R.id.my_money_item_recharge_amount_iv);
+        final TextView my_money_item_recharge_amount_2 = convertView.findViewById(R.id.my_money_item_recharge_amount_2);
+        my_money_item_recharge_amount.setText(item.getEventText());
+        my_money_item_recharge_amount_2.setText(item.getEventText());
+        my_money_item_recharge_status.setText(item.getStateText());
+        my_money_item_recharge_status.setTextColor(item.isEventSuccess() ? 0xff282828 : 0xffff2e4b);
+        my_money_item_recharge_time.setText(TimeUtil.TimeStamp2Date(item.getEventTime(), "yyyy/MM/dd HH:mm"));
+        boolean isFirst = position == 0;
+        boolean isLast = ListUtil.isLastPosition(getData(), position);
+        my_money_item_top.setVisibility(isFirst ? View.VISIBLE : View.GONE);
+        my_money_item_center.setBackgroundColor(position % 2 == 1 ? 0xffF8F8F8 : 0xffffffff);
+        my_money_item_bottom.setVisibility(isLast ? View.VISIBLE : View.GONE);
+
+        my_money_item_recharge_amount_2.setVisibility(View.GONE);
+        my_money_item_recharge_amount.post(() -> {
+            if(!android.text.TextUtils.isEmpty(item.getEventText()) && my_money_item_recharge_amount.getLayout() != null){
+                int ellipis = my_money_item_recharge_amount.getLayout().getEllipsisCount(my_money_item_recharge_amount.getLineCount()-1);
+                if(ellipis > 0){
+                    my_money_item_recharge_amount_iv.setVisibility(View.VISIBLE);
+                }else {
+                    my_money_item_recharge_amount_iv.setVisibility(View.INVISIBLE);
+                }
+            }else {
+                my_money_item_recharge_amount_iv.setVisibility(View.INVISIBLE);
+            }
+        });
+
+        my_money_item_recharge_amount_iv.setOnClickListener(v -> {
+            item.isSelect(!item.getSelect());
+            if(item.getSelect()){
+                my_money_item_recharge_amount_2.setVisibility(View.VISIBLE);
+                my_money_item_recharge_amount_iv.setImageDrawable(SheepApp.getInstance().getResources().getDrawable(R.mipmap.myprice_off));
+            }else {
+                my_money_item_recharge_amount_2.setVisibility(View.GONE);
+                my_money_item_recharge_amount_iv.setImageDrawable(SheepApp.getInstance().getResources().getDrawable(R.mipmap.myprice_on));
+            }
+        });
+    }
+}

+ 58 - 0
app/src/main/java/com/sheep/gamegroup/module/personal/fragment/FgtRechargeBalanceLog.java

@@ -0,0 +1,58 @@
+package com.sheep.gamegroup.module.personal.fragment;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.ILog;
+import com.sheep.gamegroup.model.entity.RechargeBalanceLog;
+import com.sheep.gamegroup.module.personal.adapter.AdpILog;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.view.fragment.BaseListFragment3;
+
+import org.afinal.simplecache.ApiKey;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.reactivex.Observable;
+
+/**
+ * 我的资产 --> 充值记录
+ * Created by realicing on 2018/12/21.
+ * realicing@sina.com
+ */
+public class FgtRechargeBalanceLog extends BaseListFragment3<RechargeBalanceLog> {
+    @Override
+    public void initView() {
+        super.initView();
+        per_page = 100;
+    }
+
+    private List<ILog> logList = new ArrayList<>();
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new AdpILog(logList);
+    }
+
+    @Override
+    protected void loadList(List<RechargeBalanceLog> addList) {
+        ListUtil.addAll(logList, addList);
+        super.loadList(addList);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return ApiKey.pageKeyUrl(ApiKey.recharge_balance_log, page, per_page);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getRechargeBalanceLog(page, per_page);
+    }
+
+    @Override
+    protected Class<RechargeBalanceLog> getTClass() {
+        return RechargeBalanceLog.class;
+    }
+}

+ 59 - 0
app/src/main/java/com/sheep/gamegroup/module/personal/fragment/FgtRechargeLog.java

@@ -0,0 +1,59 @@
+package com.sheep.gamegroup.module.personal.fragment;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.ILog;
+import com.sheep.gamegroup.model.entity.RechargeLog;
+import com.sheep.gamegroup.module.personal.adapter.AdpILog;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.view.fragment.BaseListFragment3;
+
+import org.afinal.simplecache.ApiKey;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.reactivex.Observable;
+
+/**
+ * 我的资产 --> 消费记录
+ * Created by realicing on 2018/12/21.
+ * realicing@sina.com
+ */
+public class FgtRechargeLog extends BaseListFragment3<RechargeLog> {
+    @Override
+    public void initView() {
+        super.initView();
+        per_page = 100;
+    }
+
+    private List<ILog> logList = new ArrayList<>();
+
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new AdpILog(logList);
+    }
+
+    @Override
+    protected void loadList(List<RechargeLog> addList) {
+        ListUtil.addAll(logList, addList);
+        super.loadList(addList);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return ApiKey.pageKeyUrl(ApiKey.recharge_log, page, per_page);
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.getRechargeLog(page, per_page);
+    }
+
+    @Override
+    protected Class<RechargeLog> getTClass() {
+        return RechargeLog.class;
+    }
+}

+ 63 - 0
app/src/main/java/com/sheep/gamegroup/module/personal/fragment/FgtWithdraw.java

@@ -0,0 +1,63 @@
+package com.sheep.gamegroup.module.personal.fragment;
+
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.ILog;
+import com.sheep.gamegroup.model.entity.WithdrawalEty;
+import com.sheep.gamegroup.module.personal.adapter.AdpILog;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.view.fragment.BaseListFragment3;
+
+import org.afinal.simplecache.ApiKey;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.reactivex.Observable;
+
+/**
+ * 我的资产 --> 充值记录
+ * Created by realicing on 2018/12/21.
+ * realicing@sina.com
+ */
+public class FgtWithdraw extends BaseListFragment3<WithdrawalEty> {
+    @Override
+    public void initView() {
+        super.initView();
+        per_page = 100;
+    }
+
+    private List<ILog> logList = new ArrayList<>();
+    @Override
+    protected RecyclerView.Adapter getAdapter() {
+        return new AdpILog(logList);
+    }
+
+    @Override
+    protected void loadList(List<WithdrawalEty> addList) {
+        ListUtil.addAll(logList, addList);
+        super.loadList(addList);
+    }
+
+    @Override
+    protected String getKey(int page, int per_page) {
+        return ApiKey.pageKeyUrl(ApiKey.withdraw, page, per_page);
+    }
+
+    @Override
+    protected boolean isFirstGetACache() {
+        return false;
+    }
+
+    @Override
+    protected Observable<BaseMessage> getApi(ApiService apiService) {
+        return apiService.goWithdrawal(page, per_page,"",System.currentTimeMillis()+"");
+    }
+
+    @Override
+    protected Class<WithdrawalEty> getTClass() {
+        return WithdrawalEty.class;
+    }
+}

+ 83 - 14
app/src/main/java/com/sheep/gamegroup/view/activity/ActMyMoney.java

@@ -1,8 +1,10 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.os.Bundle;
+import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.design.widget.TabLayout;
+import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -10,19 +12,27 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.kfzs.duanduan.utils.NumberFormatUtils;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.view.fragment.FgtMyMoney1;
-import com.sheep.gamegroup.view.fragment.FgtMyMoney2;
-import com.sheep.gamegroup.view.fragment.FgtMyMoney3;
-import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
 import com.kfzs.duanduan.utils.StatusBarUtils;
+import com.scwang.smartrefresh.layout.SmartRefreshLayout;
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.absBase.BaseRefreshLoadMoreFragment;
+import com.sheep.gamegroup.absBase.ILoadMore;
+import com.sheep.gamegroup.absBase.IRefresh;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.UserAssets;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.personal.fragment.FgtRechargeBalanceLog;
+import com.sheep.gamegroup.module.personal.fragment.FgtRechargeLog;
+import com.sheep.gamegroup.module.personal.fragment.FgtWithdraw;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
+import com.sheep.gamegroup.view.fragment.BaseListFragment3;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -44,10 +54,13 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.MY_MONEY_TAB;
 
 public class ActMyMoney extends BaseActivity {
 
+    @BindView(R.id.refresh)
+    SmartRefreshLayout refresh;
+
     @BindView(R.id.indicator)
     TabLayout indicator;
     @BindView(R.id.pager)
-    ViewPager pager;
+    ViewPager viewPager;
 
     @BindView(R.id.my_money_total_money)
     TextView my_money_total_money;
@@ -83,20 +96,41 @@ public class ActMyMoney extends BaseActivity {
                 .setTitle(this,"我的资产")
                 .setTitleFinish(this);
         mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
-        mAdapter.add(new FgtMyMoney1(), tabNames[0]);
-        mAdapter.add(new FgtMyMoney2(), tabNames[1]);
-        mAdapter.add(new FgtMyMoney3(), tabNames[2]);
-        pager.setAdapter(mAdapter);
+        mAdapter.add(new FgtRechargeBalanceLog(), tabNames[0]);
+        mAdapter.add(new FgtWithdraw(), tabNames[1]);
+        mAdapter.add(new FgtRechargeLog(), tabNames[2]);
+        for (int i = 0; i < mAdapter.getCount(); i++) {
+            Fragment fragment = mAdapter.getItem(i);
+            if(fragment instanceof BaseRefreshLoadMoreFragment){
+                ((BaseRefreshLoadMoreFragment) fragment).setSmartRefreshLayout(refresh);
+            }
+        }
+        viewPager.setOffscreenPageLimit(mAdapter.getCount());
+        viewPager.setAdapter(mAdapter);
         new_tab();
+        //refresh
+        refresh.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
+
+            @Override
+            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
+                refreshData();
+            }
+
+            @Override
+            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
+                loadMoreData();
+            }
+        });
+        RefreshUtil.newInstance().publicParameterLoadMore(refresh, this);
     }
     private void new_tab(){
         indicator.addTab(indicator.newTab().setCustomView(tab_icon(tabNames[0], true)));
         indicator.addTab(indicator.newTab().setCustomView(tab_icon(tabNames[1], true)));
         indicator.addTab(indicator.newTab().setCustomView(tab_icon(tabNames[2], false)));
         //Tablayout自定义view绑定ViewPager
-        pager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(indicator));
-        indicator.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(pager));
-        pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(indicator));
+        indicator.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
+        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
             @Override
             public void onPageScrolled(int i, float v, int i1) {
 
@@ -114,6 +148,41 @@ public class ActMyMoney extends BaseActivity {
         });
 
     }
+    private int refreshDataCount = 0;
+    //刷新数据
+    public void refreshData(){
+        refreshData(viewPager.getCurrentItem());
+    }
+    //刷新数据
+    public void refreshData(int position){
+        boolean isRefresh = false;
+        if (refreshDataCount != 0) {
+            Fragment item = mAdapter.getItem(position);
+            if (item instanceof IRefresh) {//可刷新,就调用当前fragment刷新数据
+                ((IRefresh) item).refreshData();
+                isRefresh = true;
+            }
+        }
+        refreshDataCount++;
+        if(!isRefresh)
+            notifyDataSetChanged();
+    }
+    //加载更多数据
+    private void loadMoreData() {
+        Fragment item = mAdapter.getItem(viewPager.getCurrentItem());
+        if (item instanceof ILoadMore) {//可加载更多,就调用当前fragment刷新数据
+            ((ILoadMore) item).loadMoreData();
+        } else {
+            notifyDataSetChanged();
+        }
+    }
+
+    private void notifyDataSetChanged() {
+        if (refresh != null) {
+            refresh.finishRefresh();
+            refresh.finishLoadMore();
+        }
+    }
 
     private View tab_icon(String name,boolean isShow){
         View newtab =  LayoutInflater.from(this).inflate(R.layout.tab_item,null);

+ 1 - 23
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGameCenter.java

@@ -1,44 +1,22 @@
 package com.sheep.gamegroup.view.fragment;
 
-import android.app.Activity;
 import android.content.Intent;
-import android.provider.MediaStore;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
 import android.view.View;
 import android.widget.Button;
 import android.widget.ImageButton;
-import android.widget.ImageView;
-
-import com.kfzs.duanduan.utils.NumberFormatUtils;
-import com.sheep.gamegroup.model.entity.ArticleTag;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DataUtil;
+
 import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.ActDownloadMgr;
 import com.sheep.gamegroup.view.activity.ActMain;
 import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
-import com.sheep.jiuyan.samllsheep.utils.G;
-
-import org.afinal.simplecache.ApiKey;
-
-import java.util.List;
 
 import butterknife.BindView;
 import butterknife.OnClick;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.schedulers.Schedulers;
-import rx.functions.Action1;
-
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_TAG;
 
 /**
  * Created by realicing on 2018/6/27.

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyMoney3.java

@@ -1,7 +1,7 @@
 package com.sheep.gamegroup.view.fragment;
 
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.RechargeLogEntity;
+import com.sheep.gamegroup.model.entity.RechargeLog;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import java.util.List;
@@ -15,12 +15,12 @@ import io.reactivex.Observable;
  */
 public class FgtMyMoney3 extends AbsFgtMyMoney {
     @Override
-    protected List<RechargeLogEntity> getDatas(BaseMessage baseMessage) {
-        return baseMessage.getDatas(RechargeLogEntity.class);
+    protected List<RechargeLog> getDatas(BaseMessage baseMessage) {
+        return baseMessage.getDatas(RechargeLog.class);
     }
 
     @Override
     protected Observable<BaseMessage> initObservable(int page, int per_page) {
-        return SheepApp.getInstance().getNetComponent().getApiService().rechargeLog(page, per_page);
+        return SheepApp.getInstance().getNetComponent().getApiService().getRechargeLog(page, per_page);
     }
 }

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGame.java

@@ -1,6 +1,5 @@
 package com.sheep.gamegroup.view.fragment;
 
-import android.app.Activity;
 import android.content.Context;
 import android.support.annotation.NonNull;
 import android.support.v7.widget.LinearLayoutManager;

+ 0 - 7
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -45,7 +45,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
-import com.kfzs.duanduan.view.DialogStorageLow;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
 import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
@@ -58,7 +57,6 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BulletinEnty;
 import com.sheep.gamegroup.model.entity.CashAwarsEntity;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
-import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.entity.MessageUnReadEntity;
 import com.sheep.gamegroup.model.entity.MoreDataEntity;
 import com.sheep.gamegroup.model.entity.RecyleObj;
@@ -89,7 +87,6 @@ import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
 import com.sheep.gamegroup.view.activity.ActMsg;
 import com.sheep.gamegroup.view.activity.NotificationsUtils;
 import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
@@ -123,9 +120,7 @@ import java.util.Locale;
 import javax.inject.Inject;
 
 import butterknife.BindView;
-import butterknife.ButterKnife;
 import butterknife.OnClick;
-import butterknife.Unbinder;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 import rx.functions.Action1;
@@ -245,7 +240,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     public static final int WHAT_LOAD_RUN_TASK = 1;//加载正在进行的任务列表
     public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
 
-    private int clickCount = 0;
     public Handler mHandler = new Handler(Looper.getMainLooper()) {
         @Override
         public void handleMessage(Message msg) {
@@ -1021,7 +1015,6 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
                 }
                 UMConfigUtils.IdEvent.HOME_LIST.commit(homeListEntity.getId());
                 if ("-2".equals(homeListEntity.getJump())) {
-                    clickCount += 1;
                     setValueList(!homeListEntity.isSelect());
                 } else {
                     CommonUtil.getInstance()

+ 3 - 5
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SignActivity.java

@@ -15,7 +15,7 @@ import com.sheep.gamegroup.absBase.BaseUMActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.entity.PunchAndSign;
-import com.sheep.gamegroup.model.entity.RechargeLogEntity;
+import com.sheep.gamegroup.model.entity.RechargeLog;
 import com.sheep.gamegroup.model.entity.RobTask;
 import com.sheep.gamegroup.model.entity.SheepSignResult;
 import com.sheep.gamegroup.model.entity.UserSign;
@@ -33,12 +33,10 @@ import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
 import com.sheep.gamegroup.view.customview.ErasableTextView;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.jiuyan.samllsheep.ui.view.EggView;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 import com.umeng.socialize.UMShareAPI;
-import com.umeng.socialize.UMShareListener;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 
 import java.util.Collections;
@@ -204,7 +202,7 @@ public class SignActivity extends BaseUMActivity {
     //是否完成最后一次刮奖数据的获取
     private boolean isFinishInitLastScratch = false;
     //最后一次刮奖数据
-    private RechargeLogEntity rechargeLogEntity;
+    private RechargeLog rechargeLogEntity;
 
     private void initUserSignLastScratch() {
         SheepApp.getInstance().getNetComponent().getApiService().getUserSignLastScratch()
@@ -213,7 +211,7 @@ public class SignActivity extends BaseUMActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        rechargeLogEntity = baseMessage.getData(RechargeLogEntity.class);
+                        rechargeLogEntity = baseMessage.getData(RechargeLog.class);
                         isFinishInitLastScratch = true;
                         updateSignGuaJiang();
 

+ 6 - 0
app/src/main/java/org/afinal/simplecache/ApiKey.java

@@ -72,6 +72,12 @@ public class ApiKey {
     public static final String getVideoTopic = "app/video/topic";
     //客户端插件更新/插件获取
     public static final String getPackageVersion = "app/version/package_version";
+    //充值记录
+    public static final String recharge_balance_log = "app/recharge/recharge_balance_log";
+    //提现记录
+    public static final String recharge_log = "app/user/recharge_log";
+    //收支明细、消费记录
+    public static final String withdraw = "app/withdraw";
 
     public static final String getPackageVersion(String package_name, String type, int version){
         return String.format(Locale.CHINA, "%s?package_name=%s&type=%s&version=%d", getPackageVersion, package_name, type, version);

+ 235 - 206
app/src/main/res/layout/act_my_money.xml

@@ -1,229 +1,258 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/refresh"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@color/white_light"
-    android:orientation="vertical">
+    android:layout_height="match_parent">
 
-    <android.support.constraint.ConstraintLayout
+    <android.support.v4.widget.NestedScrollView
+        android:id="@+id/scrollView"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@mipmap/home_blue_bg"
-        android:paddingBottom="52dp"
-        android:paddingTop="@dimen/status_bar_height">
-
-        <ImageView
-            android:id="@+id/img_baseactivity_title"
-            android:layout_width="wrap_content"
-            android:layout_height="?attr/actionBarSize"
-            android:paddingStart="@dimen/content_padding_20"
-            android:paddingEnd="@dimen/content_padding_20"
-            android:gravity="center_vertical"
-            android:scaleType="centerInside"
-            android:src="@drawable/narrow_back_white"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:id="@+id/txt_baseactivity_title"
-            android:layout_width="wrap_content"
-            android:layout_height="?attr/actionBarSize"
-            android:layout_centerInParent="true"
-            android:gravity="center"
-            android:text="@string/app_name"
-            android:textColor="@color/white"
-            android:textSize="@dimen/text_size_4"
-            app:layout_constraintBottom_toBottomOf="@+id/img_baseactivity_title"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="@+id/img_baseactivity_title" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/content_padding_10"
-            android:text="@string/total_money_lable"
-            android:textSize="15sp"
-            android:textColor="@color/white"
-            android:layout_marginStart="@dimen/content_padding_20"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/img_baseactivity_title" />
+        android:layout_height="match_parent"
+        android:layout_gravity="fill_vertical"
+        android:fillViewport="true"
+        android:scrollbars="none"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
         <LinearLayout
-            android:id="@+id/my_money_ll"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:layout_marginEnd="@dimen/content_padding_20"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/img_baseactivity_title" >
-            <TextView
-                android:id="@+id/my_money_agent_extract"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="12dp"
-                android:text="@string/agent_extract"
-                android:textColor="@color/white"
-                android:textSize="12sp" />
-
-            <TextView
-                android:id="@+id/my_money_task_reward"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/task_reward"
-                android:textColor="@color/white"
-                android:layout_marginTop="@dimen/content_padding_20"
-                android:textSize="12sp" />
-            <LinearLayout
-                android:layout_width="wrap_content"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@color/white_light"
+            android:orientation="vertical">
+
+            <android.support.constraint.ConstraintLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:paddingTop="10dp"
-                android:paddingBottom="10dp"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
+                android:background="@mipmap/home_blue_bg"
+                android:paddingTop="@dimen/status_bar_height"
+                android:paddingBottom="52dp">
+
+                <ImageView
+                    android:id="@+id/img_baseactivity_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="?attr/actionBarSize"
+                    android:gravity="center_vertical"
+                    android:paddingStart="@dimen/content_padding_20"
+                    android:paddingEnd="@dimen/content_padding_20"
+                    android:scaleType="centerInside"
+                    android:src="@drawable/narrow_back_white"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:id="@+id/txt_baseactivity_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="?attr/actionBarSize"
+                    android:layout_centerInParent="true"
+                    android:gravity="center"
+                    android:text="@string/app_name"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_size_4"
+                    app:layout_constraintBottom_toBottomOf="@+id/img_baseactivity_title"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="@+id/img_baseactivity_title" />
 
                 <TextView
-                    android:id="@+id/my_money_dingxiang_amount"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/dingxiang_amount"
+                    android:layout_marginStart="@dimen/content_padding_20"
+                    android:layout_marginTop="@dimen/content_padding_10"
+                    android:text="@string/total_money_lable"
                     android:textColor="@color/white"
-                    android:textSize="12sp" />
+                    android:textSize="15sp"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/img_baseactivity_title" />
 
-                <ImageView
-                    android:id="@+id/my_money_dingxiang_amount_iv"
-                    android:layout_width="35dp"
-                    android:layout_height="35dp"
-                    android:padding="10dp"
-                    android:src="@mipmap/question_mark" />
-            </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/my_money_ll"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="@dimen/content_padding_20"
+                    android:orientation="vertical"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/img_baseactivity_title">
 
-            <TextView
-                android:id="@+id/my_money_recharge_amount"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/recharge_amount"
-                android:textColor="@color/white"
-                android:textSize="12sp"/>
+                    <TextView
+                        android:id="@+id/my_money_agent_extract"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="12dp"
+                        android:text="@string/agent_extract"
+                        android:textColor="@color/white"
+                        android:textSize="12sp" />
 
-        </LinearLayout>
+                    <TextView
+                        android:id="@+id/my_money_task_reward"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="@dimen/content_padding_20"
+                        android:text="@string/task_reward"
+                        android:textColor="@color/white"
+                        android:textSize="12sp" />
 
-        <TextView
-            android:id="@+id/my_money_available_amount"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="@color/white"
-            android:textSize="12sp"
-            android:text="@string/available_amount"
-            android:layout_marginStart="@dimen/content_padding_20"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintBottom_toBottomOf="@+id/my_money_ll" />
-        <TextView
-            android:id="@+id/my_money_total_money"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/total_money"
-            android:layout_marginBottom="@dimen/content_padding_10"
-            android:textSize="25sp"
-            android:textColor="@color/white"
-            android:layout_marginStart="@dimen/content_padding_20"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintBottom_toTopOf="@+id/my_money_available_amount" />
-
-    </android.support.constraint.ConstraintLayout>
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="-37dp"
-        android:layout_marginEnd="@dimen/content_padding_10"
-        android:layout_marginStart="@dimen/content_padding_10"
-        android:orientation="vertical"
-        android:background="@drawable/x_shap_shadow_bg_rectgangle_white">
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:paddingTop="@dimen/content_padding_10"
-            android:paddingBottom="@dimen/content_padding_10"
-            android:paddingStart="@dimen/content_padding_20"
-            android:paddingEnd="@dimen/content_padding_20"
-            android:orientation="horizontal">
-            <ImageView
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:src="@drawable/selector_tab_my_money1"/>
-            <TextView
-                android:id="@+id/my_money_recharge_tv"
-                android:layout_width="0dp"
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal"
+                        android:paddingTop="10dp"
+                        android:paddingBottom="10dp">
+
+                        <TextView
+                            android:id="@+id/my_money_dingxiang_amount"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="@string/dingxiang_amount"
+                            android:textColor="@color/white"
+                            android:textSize="12sp" />
+
+                        <ImageView
+                            android:id="@+id/my_money_dingxiang_amount_iv"
+                            android:layout_width="35dp"
+                            android:layout_height="35dp"
+                            android:padding="10dp"
+                            android:src="@mipmap/question_mark" />
+                    </LinearLayout>
+
+                    <TextView
+                        android:id="@+id/my_money_recharge_amount"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/recharge_amount"
+                        android:textColor="@color/white"
+                        android:textSize="12sp" />
+
+                </LinearLayout>
+
+                <TextView
+                    android:id="@+id/my_money_available_amount"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="@dimen/content_padding_20"
+                    android:text="@string/available_amount"
+                    android:textColor="@color/white"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="@+id/my_money_ll"
+                    app:layout_constraintStart_toStartOf="parent" />
+
+                <TextView
+                    android:id="@+id/my_money_total_money"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="@dimen/content_padding_20"
+                    android:layout_marginBottom="@dimen/content_padding_10"
+                    android:text="@string/total_money"
+                    android:textColor="@color/white"
+                    android:textSize="25sp"
+                    app:layout_constraintBottom_toTopOf="@+id/my_money_available_amount"
+                    app:layout_constraintStart_toStartOf="parent" />
+
+            </android.support.constraint.ConstraintLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/content_padding_10"
-                android:layout_weight="1"
-                android:textColor="@color/gray_4"
-                android:textSize="15sp"
-                android:text="充值"/>
-            <ImageView
-                android:layout_width="15dp"
-                android:layout_height="15dp"
-                android:src="@mipmap/x_ic_next"/>
+                android:layout_marginTop="-37dp"
+                android:layout_marginEnd="@dimen/content_padding_10"
+                android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+                android:orientation="vertical">
 
-        </LinearLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="@color/white_bg_line"
-            android:layout_marginLeft="@dimen/content_padding_20"
-            android:layout_marginRight="@dimen/content_padding_20"
-            />
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingStart="@dimen/content_padding_20"
+                    android:paddingTop="@dimen/content_padding_10"
+                    android:paddingEnd="@dimen/content_padding_20"
+                    android:paddingBottom="@dimen/content_padding_10">
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:paddingTop="@dimen/content_padding_10"
-            android:paddingBottom="@dimen/content_padding_10"
-            android:paddingStart="@dimen/content_padding_20"
-            android:paddingEnd="@dimen/content_padding_20"
-            android:orientation="horizontal">
-            <ImageView
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:src="@drawable/selector_tab_my_money2"/>
-            <TextView
-                android:id="@+id/my_money_withdraw_tv"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
+                    <ImageView
+                        android:layout_width="20dp"
+                        android:layout_height="20dp"
+                        android:src="@drawable/selector_tab_my_money1" />
+
+                    <TextView
+                        android:id="@+id/my_money_recharge_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/content_padding_10"
+                        android:layout_weight="1"
+                        android:text="充值"
+                        android:textColor="@color/gray_4"
+                        android:textSize="15sp" />
+
+                    <ImageView
+                        android:layout_width="15dp"
+                        android:layout_height="15dp"
+                        android:src="@mipmap/x_ic_next" />
+
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1px"
+                    android:layout_marginLeft="@dimen/content_padding_20"
+                    android:layout_marginRight="@dimen/content_padding_20"
+                    android:background="@color/white_bg_line" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingStart="@dimen/content_padding_20"
+                    android:paddingTop="@dimen/content_padding_10"
+                    android:paddingEnd="@dimen/content_padding_20"
+                    android:paddingBottom="@dimen/content_padding_10">
+
+                    <ImageView
+                        android:layout_width="20dp"
+                        android:layout_height="20dp"
+                        android:src="@drawable/selector_tab_my_money2" />
+
+                    <TextView
+                        android:id="@+id/my_money_withdraw_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/content_padding_10"
+                        android:layout_weight="1"
+                        android:text="提现"
+                        android:textColor="@color/gray_4"
+                        android:textSize="15sp" />
+
+                    <ImageView
+                        android:layout_width="15dp"
+                        android:layout_height="15dp"
+                        android:src="@mipmap/x_ic_next" />
+
+                </LinearLayout>
+            </LinearLayout>
+
+            <android.support.design.widget.TabLayout
+                android:id="@+id/indicator"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
                 android:layout_marginStart="@dimen/content_padding_10"
-                android:layout_weight="1"
-                android:textColor="@color/gray_4"
-                android:textSize="15sp"
-                android:text="提现"/>
-            <ImageView
-                android:layout_width="15dp"
-                android:layout_height="15dp"
-                android:src="@mipmap/x_ic_next"/>
+                android:layout_marginTop="@dimen/content_padding_20"
+                android:layout_marginEnd="@dimen/content_padding_10"
+                android:background="@drawable/shape_main_solid_rectangle_small_top"
+                app:tabGravity="center"
+                app:tabIndicatorColor="#4bc1fe"
+                app:tabIndicatorHeight="0dp"
+                app:tabMode="fixed"
+                app:tabSelectedTextColor="@android:color/white"
+                app:tabTextAppearance="@android:style/TextAppearance.Holo.Medium"
+                app:tabTextColor="#444444" />
 
-        </LinearLayout>
-    </LinearLayout>
-    <android.support.design.widget.TabLayout
-        android:id="@+id/indicator"
-        android:layout_width="match_parent"
-        android:layout_height="50dp"
-        android:layout_marginTop="@dimen/content_padding_20"
-        android:layout_marginEnd="@dimen/content_padding_10"
-        android:layout_marginStart="@dimen/content_padding_10"
-        android:background="@drawable/shape_main_solid_rectangle_small_top"
-        app:tabGravity="center"
-        app:tabIndicatorColor="#4bc1fe"
-        app:tabIndicatorHeight="0dp"
-        app:tabMode="fixed"
-        app:tabSelectedTextColor="@android:color/white"
-        app:tabTextAppearance="@android:style/TextAppearance.Holo.Medium"
-        app:tabTextColor="#444444" />
-
-    <android.support.v4.view.ViewPager
-        android:id="@+id/pager"
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1" />
+            <com.kfzs.android.view.widget.WrapContentHeightViewPager
+                android:id="@+id/pager"
+                android:layout_width="match_parent"
+                android:layout_height="0dip"
+                android:layout_weight="1" />
 
-</LinearLayout>
+        </LinearLayout>
+    </android.support.v4.widget.NestedScrollView>
+</com.scwang.smartrefresh.layout.SmartRefreshLayout>

+ 1 - 2
app/src/main/res/layout/net_empty_rv.xml

@@ -7,8 +7,7 @@
         android:id="@+id/check_net_ll"
         layout="@layout/check_net_view"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/title" />
+        android:layout_height="wrap_content" />
 
     <include
         android:id="@+id/empty_view"