package com.yeshi.ec.rebate.myapplication.ui.mine;
|
|
import android.content.DialogInterface;
|
import android.content.Intent;
|
import android.graphics.drawable.AnimationDrawable;
|
import android.os.Bundle;
|
import android.provider.Settings;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.SimpleItemAnimator;
|
import android.view.Gravity;
|
import android.view.LayoutInflater;
|
import android.view.MotionEvent;
|
import android.view.View;
|
import android.view.ViewGroup;
|
import android.widget.CheckBox;
|
import android.widget.CompoundButton;
|
import android.widget.FrameLayout;
|
import android.widget.ImageView;
|
import android.widget.LinearLayout;
|
import android.widget.TextView;
|
import android.widget.Toast;
|
import android.widget.ToggleButton;
|
|
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONArray;
|
import com.google.gson.Gson;
|
import com.wpc.library.content.ConnectivityChangeHelper;
|
import com.wpc.library.recyclerviewhelper.DividerItemDecoration;
|
import com.wpc.library.util.common.DimenUtils;
|
import com.yeshi.ec.rebate.myapplication.BasicTextHttpResponseHandler;
|
import com.yeshi.ec.rebate.myapplication.R;
|
import com.yeshi.ec.rebate.myapplication.ShoppingApi;
|
import com.yeshi.ec.rebate.myapplication.contract.SelectionStoreHouse31Contract;
|
import com.yeshi.ec.rebate.myapplication.entity.SelectionStoreHouse;
|
import com.yeshi.ec.rebate.myapplication.entity.TaoBaoGoodsBrief;
|
import com.yeshi.ec.rebate.myapplication.entity.goods.ShareCommonGoods;
|
import com.yeshi.ec.rebate.myapplication.presenter.SelectionStoreHouse31Presenter;
|
import com.yeshi.ec.rebate.myapplication.ui.dialog.JumpTaoBaoDialog;
|
import com.yeshi.ec.rebate.myapplication.ui.dialog.OrderAppealHistoryDeleteHintDialog;
|
import com.yeshi.ec.rebate.myapplication.ui.dialog.ShapeLoadingDialog;
|
import com.yeshi.ec.rebate.myapplication.ui.recommend.MultiGoodsShareActivity;
|
import com.yeshi.ec.rebate.myapplication.util.TopStatusSettings;
|
import com.yeshi.ec.rebate.myapplication.view.BaseActivity;
|
|
import org.apache.http.Header;
|
import org.json.JSONObject;
|
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* Created by weikou2015 on 2018/1/19.
|
* 分享库
|
*/
|
public class SelectionStoreHouseActivity31 extends BaseActivity<SelectionStoreHouse31Contract.SelectionStoreHouseView,
|
SelectionStoreHouse31Presenter> implements SelectionStoreHouse31Contract.SelectionStoreHouseView, View.OnClickListener {
|
private TextView tv_left;
|
private TextView tv_middle;
|
private View bottom;
|
private ImageView iv_loading;
|
private TextView tv_loading;
|
private LinearLayout ll_delete, ll_go_scan;
|
private TextView tv_delete;
|
public CheckBox cb_delete_all;
|
// private TextView tv_delete_all;
|
private SwipeRefreshLayout rl_collect;
|
private RecyclerView rv_share_house;
|
private ToggleButton tv_top_bar_right;
|
private SelectionStoreHouseAdapter31 adapter;
|
private boolean isLoad = false;
|
private ImageView iv_slid_top;
|
private String TYPE = "goodsStorage";
|
private TextView tv_notice_content;
|
private LinearLayout ll_notice;
|
private ImageView iv_close;
|
private ConnectivityChangeHelper mChangeHelper;
|
private LinearLayout ll_no_net, ll_request_failture, ll_content;
|
public JumpTaoBaoDialog dialog;
|
public TextView tv_share;
|
private boolean cb_touch = false;
|
private int goodsType = 1;////平台: 1淘宝 2京东 3拼多多
|
|
private TextView storehouse_tb;//淘宝tab
|
private TextView storehouse_jd;//京东tab
|
private TextView storehouse_pdd;//拼多多tab
|
private View storehouse_tbline;
|
private View storehouse_jdline;
|
private View storehouse_pddline;
|
|
|
@Override
|
protected void initActivityView(Bundle savedInstanceState) {
|
setContentView(R.layout.activity_selection_storehouse);
|
}
|
|
@Override
|
protected void findViewById() {
|
TopStatusSettings.setStatusViewAndDeepColor(this);
|
storehouse_tb = findViewById(R.id.storehouse_tb);
|
storehouse_jd = findViewById(R.id.storehouse_jd);
|
storehouse_pdd = findViewById(R.id.storehouse_pdd);
|
storehouse_tbline = findViewById(R.id.storehouse_tbline);
|
storehouse_jdline = findViewById(R.id.storehouse_jdline);
|
storehouse_pddline = findViewById(R.id.storehouse_pddline);
|
storehouse_tb.setOnClickListener(this);
|
storehouse_jd.setOnClickListener(this);
|
storehouse_pdd.setOnClickListener(this);
|
tv_left = findViewById(R.id.tv_top_bar_left);
|
tv_middle = findViewById(R.id.tv_top_bar_middle);
|
tv_top_bar_right = findViewById(R.id.btn_delete);
|
rl_collect = findViewById(R.id.rl_collect);
|
rv_share_house = findViewById(R.id.rv_share_house);
|
tv_delete = findViewById(R.id.tv_delete);
|
tv_share = findViewById(R.id.tv_share);
|
cb_delete_all = findViewById(R.id.cb_delete_all);
|
ll_delete = findViewById(R.id.ll_delete);
|
ll_go_scan = findViewById(R.id.ll_go_scan);
|
iv_slid_top = findViewById(R.id.iv_slid_top);
|
iv_slid_top.setOnClickListener(this);
|
ll_delete.setVisibility(View.GONE);
|
tv_top_bar_right.setVisibility(View.INVISIBLE);
|
tv_middle.setText("分享库");
|
tv_left.setOnClickListener(this);
|
tv_top_bar_right.setOnClickListener(this);
|
tv_top_bar_right.setChecked(false);
|
tv_delete.setOnClickListener(this);
|
tv_share.setOnClickListener(this);
|
ll_content = findViewById(R.id.ll_content);
|
ll_no_net = findViewById(R.id.ll_no_net);
|
ll_go_scan = findViewById(R.id.ll_go_scan);
|
ll_request_failture = findViewById(R.id.ll_request_failture);
|
findViewById(R.id.tv_net_setting).setOnClickListener(this);
|
findViewById(R.id.tv_refresh).setOnClickListener(this);
|
|
float hRatio = 260 / 720f;
|
float wRatio = 23 / 720f;
|
int bottomPo = (int) (DimenUtils.getScreenWidth(this) * hRatio);
|
int rightPo = (int) (DimenUtils.getScreenWidth(this) * wRatio);
|
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(DimenUtils.dip2px(this, 40), DimenUtils.dip2px(this, 40));
|
params.setMargins(0, 0, rightPo, bottomPo);
|
params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
|
iv_slid_top.setLayoutParams(params);
|
//设置 RecyclerView 显示模式
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
rv_share_house.setLayoutManager(linearLayoutManager);
|
DividerItemDecoration decoration = new DividerItemDecoration(DividerItemDecoration.VERTICAL);
|
decoration.setSize(DimenUtils.dip2px(this, 5));
|
rv_share_house.addItemDecoration(decoration);
|
adapter = new SelectionStoreHouseAdapter31(SelectionStoreHouseActivity31.this, wList);
|
|
bottom = LayoutInflater.from(this).inflate(R.layout.item_recyclerview_bottom, null);
|
tv_loading = bottom.findViewById(R.id.tv_loading);
|
iv_loading = bottom.findViewById(R.id.iv_loading);
|
AnimationDrawable animationDrawable = (AnimationDrawable) getResources().getDrawable(
|
R.drawable.anim_list_loading);
|
iv_loading.setImageDrawable(animationDrawable);
|
animationDrawable.start();
|
// Glide.with(this).load(R.drawable.gif_loading).into(iv_loading);
|
bottom.setVisibility(View.GONE);
|
adapter.addFooterView(bottom);
|
|
tv_notice_content = findViewById(R.id.tv_notice_content);
|
ll_notice = findViewById(R.id.ll_notice);
|
iv_close = findViewById(R.id.iv_close);
|
|
View header = LayoutInflater.from(this).inflate(R.layout.item_recyclerview_bottom, null);
|
header.findViewById(R.id.iv_loading).setVisibility(View.GONE);
|
header.findViewById(R.id.tv_loading).setVisibility(View.GONE);
|
header.findViewById(R.id.ll_loading).setLayoutParams(new FrameLayout.LayoutParams(
|
ViewGroup.LayoutParams.MATCH_PARENT, DimenUtils.dip2px(this, 8)));
|
adapter.addHeaderView(header);
|
|
rv_share_house.setAdapter(adapter);
|
((SimpleItemAnimator) rv_share_house.getItemAnimator()).setSupportsChangeAnimations(false); //取消RecyclerView的动画效果
|
mChangeHelper = new ConnectivityChangeHelper(this,
|
new ConnectivityChangeHelper.OnConnectivityChangeListener() {
|
|
@Override
|
public void onNetworkUnAvailable() {
|
}
|
|
@Override
|
public void onNetworkAvailable() {
|
mPresenter.requestState(0, ll_delete
|
, ll_go_scan, ll_no_net, ll_request_failture, ll_content, tv_top_bar_right);
|
if (wList.size() == 0) {
|
setData();
|
}
|
}
|
});
|
|
rl_collect.setColorSchemeColors(getResources().getColor(R.color.theme));
|
rl_collect.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
@Override
|
public void onRefresh() {
|
page = 1;
|
rl_collect.setRefreshing(true);
|
if (!tv_top_bar_right.isChecked())
|
setData();
|
else
|
rl_collect.setRefreshing(false);
|
}
|
});
|
|
rv_share_house.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
@Override
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
super.onScrollStateChanged(recyclerView, newState);
|
LinearLayoutManager manager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
int first = manager.findFirstVisibleItemPosition();
|
int last = manager.findLastVisibleItemPosition();
|
int total = manager.getItemCount();
|
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
|
if (first == 0) {
|
iv_slid_top.setVisibility(View.GONE);
|
}
|
if (last == total - 1 && wList.size() < count && isLoad && !tv_top_bar_right.isChecked()) {
|
page++;
|
isLoad = false;
|
iv_loading.setVisibility(View.VISIBLE);
|
tv_loading.setText("正在加载更多是数据");
|
setData();
|
}
|
}
|
}
|
|
@Override
|
public void onScrolled(RecyclerView recyclerView, int dx, final int dy) {
|
super.onScrolled(recyclerView, dx, dy);
|
if (Math.abs(dy) > 10) {
|
if (dy > 0) {
|
iv_slid_top.setVisibility(View.GONE);
|
} else {
|
iv_slid_top.setVisibility(View.VISIBLE);
|
}
|
}
|
}
|
});
|
cb_delete_all.setOnTouchListener(new View.OnTouchListener() {
|
@Override
|
public boolean onTouch(View v, MotionEvent event) {
|
cb_touch = true;
|
return false;
|
}
|
});
|
/**
|
* 全选按钮
|
*/
|
cb_delete_all.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
@Override
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
if (isChecked) {
|
adapter.allSelect(true, goodsType);
|
} else {
|
if (cb_touch)
|
adapter.allSelect(false, goodsType);
|
}
|
cb_touch = false;
|
}
|
});
|
rl_collect.setRefreshing(true);
|
}
|
|
@Override
|
protected SelectionStoreHouse31Presenter createPresenter() {
|
return new SelectionStoreHouse31Presenter(this);
|
}
|
|
|
@Override
|
protected void getData() {
|
//小黄条
|
mPresenter.getAppPageNotification(TYPE);
|
}
|
|
|
@Override
|
protected void onResume() {
|
super.onResume();
|
mChangeHelper.registerReceiver();
|
if (dialog != null && dialog.isShowing())
|
dialog.dismiss();
|
}
|
|
@Override
|
protected void onPause() {
|
super.onPause();
|
mChangeHelper.unregisterReceiver();
|
}
|
|
/**
|
* 小黄条
|
*/
|
|
List<SelectionStoreHouse> wList = new ArrayList<>();
|
|
private int page = 1;//页码初始值
|
|
private int count = 999;
|
|
/**
|
* 获取分享库数据
|
*/
|
public void setData() {
|
String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", "");
|
tv_top_bar_right.setEnabled(false);
|
if (page > 1) {
|
bottom.setVisibility(View.VISIBLE);
|
} else {
|
bottom.setVisibility(View.GONE);
|
}
|
mPresenter.getSelectioStoreHouseList(page + "", uid, goodsType + "");
|
}
|
|
ShapeLoadingDialog pd = null;
|
private boolean storehouse_mode = false;//淘宝京东拼多多 选中标记
|
private boolean storehouse_modeJD = false;//淘宝京东拼多多 选中标记
|
private boolean storehouse_modePDD = false;//淘宝京东拼多多 选中标记
|
|
@Override
|
public void onClick(View v) {
|
switch (v.getId()) {
|
case R.id.tv_top_bar_left:
|
finish();
|
break;
|
case R.id.iv_slid_top://滚动到顶部
|
rv_share_house.getLayoutManager().scrollToPosition(0);
|
break;
|
case R.id.tv_delete://删除
|
int size = 0;
|
if (goodsType == 1) {//淘宝
|
size = adapter.selectList.size();
|
} else if (goodsType == 2) {//京东
|
size = adapter.selectListJD.size();
|
} else {//拼多多
|
size = adapter.selectListPDD.size();
|
}
|
if (size > 0) {
|
OrderAppealHistoryDeleteHintDialog.Builder builder = new OrderAppealHistoryDeleteHintDialog.Builder(this);
|
builder.setMessage("删除后将无法恢复,确定要删除?").setNegativeButton("不了", new DialogInterface.OnClickListener() {
|
@Override
|
public void onClick(DialogInterface dialog, int which) {
|
dialog.dismiss();
|
}
|
}).setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
@Override
|
public void onClick(DialogInterface dialog, int which) {
|
dialog.dismiss();
|
delete(goodsType);
|
}
|
}).create().show();
|
}
|
break;
|
case R.id.tv_share://分享
|
int size2 = 0;
|
if (goodsType == 1) {//淘宝
|
size2 = adapter.selectList.size();
|
} else if (goodsType == 2) {//京东
|
size2 = adapter.selectListJD.size();
|
} else {//拼多多
|
size2 = adapter.selectListPDD.size();
|
}
|
if (size2 > 0 && size2 < 10) {
|
final Intent intent = new Intent(SelectionStoreHouseActivity31.this, MultiGoodsShareActivity.class);
|
//整理数据
|
Map<String, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
for (SelectionStoreHouse house : wList)
|
goodsMap.put(house.getStorageId(), house.getGoods());
|
final List<ShareCommonGoods> shareGoodsList = new ArrayList<>();
|
ArrayList<String> ids = null;
|
|
if (goodsType == 1) {//淘宝
|
ids = adapter.selectList;
|
} else if (goodsType == 2) {//京东
|
ids = adapter.selectListJD;
|
} else {//拼多多
|
ids = adapter.selectListPDD;
|
}
|
|
|
if (ids != null)
|
for (String id : ids) {
|
TaoBaoGoodsBrief goods = goodsMap.get(id);
|
if (goods != null) {
|
shareGoodsList.add(new ShareCommonGoods(goods.getGoodsId(), goods.getGoodsType()));
|
}
|
}
|
|
if (shareGoodsList.size() > 0) {
|
//请求分享
|
String idsString = new Gson().toJson(ids);
|
String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", "");
|
ShoppingApi.shareSelectStoreHouse(this, idsString, uid, goodsType, new BasicTextHttpResponseHandler() {
|
@Override
|
public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception {
|
if (jsonObject.optInt("code") == 0) {
|
String imgUrl = jsonObject.optJSONObject("data")
|
.optJSONObject("shareImg").optString("url");
|
String shareId = jsonObject.optJSONObject("data").optString("shareId");
|
//跳转界面
|
intent.putExtra("shareId", shareId);
|
intent.putExtra("goodsInfo", MultiGoodsShareActivity.getGoodsIntentData(shareGoodsList));
|
startActivityForResult(intent, 11);
|
} else {
|
Toast.makeText(SelectionStoreHouseActivity31.this, jsonObject.optString("msg"), Toast.LENGTH_SHORT).show();
|
finish();
|
}
|
}
|
|
@Override
|
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
|
super.onFailure(statusCode, headers, responseString, throwable);
|
Toast.makeText(SelectionStoreHouseActivity31.this, "数据获取失败", Toast.LENGTH_SHORT).show();
|
finish();
|
}
|
});
|
}
|
} else if (size2 == 0) {
|
Toast.makeText(SelectionStoreHouseActivity31.this, "请选择商品", Toast.LENGTH_SHORT).show();
|
} else {
|
Toast.makeText(SelectionStoreHouseActivity31.this, "最多分享9个商品", Toast.LENGTH_SHORT).show();
|
}
|
break;
|
/**
|
* 选择/or/完成
|
*/
|
case R.id.btn_delete:
|
if (tv_top_bar_right.isChecked()) {//完成(选中)
|
ll_delete.setVisibility(View.VISIBLE);//底部 选择/删除/分享栏(显示)
|
rl_collect.setEnabled(false);
|
if (goodsType == 1) {//淘宝
|
storehouse_mode = true;
|
} else if (goodsType == 2) {//京东
|
storehouse_modeJD = true;
|
} else {//拼多多
|
storehouse_modePDD = true;
|
}
|
} else {//选择(取消)
|
ll_delete.setVisibility(View.GONE);//底部 选择/删除/分享栏(隐藏)
|
rl_collect.setEnabled(true);
|
if (goodsType == 1) {//淘宝
|
storehouse_mode = false;
|
} else if (goodsType == 2) {//京东
|
storehouse_modeJD = false;
|
} else {//拼多多
|
storehouse_modePDD = false;
|
}
|
}
|
this.setSelectedMode(tv_top_bar_right.isChecked(), goodsType);
|
break;
|
case R.id.tv_net_setting://设置
|
startActivity(new Intent(Settings.ACTION_SETTINGS));
|
break;
|
case R.id.tv_refresh://刷新
|
startActivity(new Intent(Settings.ACTION_SETTINGS));
|
break;
|
case R.id.storehouse_tb://淘宝
|
goodsType = 1;
|
page = 1;
|
rl_collect.setRefreshing(true);
|
mPresenter.setBar(1, storehouse_tb, storehouse_jd, storehouse_pdd, storehouse_tbline, storehouse_jdline, storehouse_pddline);
|
setData();
|
tv_top_bar_right.setChecked(storehouse_mode);
|
// this.setSelectedMode(storehouse_mode, goodsType);
|
ll_delete.setVisibility(storehouse_mode ? View.VISIBLE : View.GONE);
|
break;
|
case R.id.storehouse_jd://京东
|
goodsType = 2;
|
page = 1;
|
rl_collect.setRefreshing(true);
|
mPresenter.setBar(2, storehouse_tb, storehouse_jd, storehouse_pdd, storehouse_tbline, storehouse_jdline, storehouse_pddline);
|
setData();
|
tv_top_bar_right.setChecked(storehouse_modeJD);
|
// this.setSelectedMode(storehouse_modeJD, goodsType);
|
ll_delete.setVisibility(storehouse_modeJD ? View.VISIBLE : View.GONE);
|
break;
|
case R.id.storehouse_pdd://拼多多
|
goodsType = 3;
|
page = 1;
|
rl_collect.setRefreshing(true);
|
mPresenter.setBar(3, storehouse_tb, storehouse_jd, storehouse_pdd, storehouse_tbline, storehouse_jdline, storehouse_pddline);
|
setData();
|
tv_top_bar_right.setChecked(storehouse_modePDD);
|
// this.setSelectedMode(storehouse_modeJD, goodsType);
|
ll_delete.setVisibility(storehouse_modePDD ? View.VISIBLE : View.GONE);
|
break;
|
default:
|
break;
|
}
|
}
|
|
/**
|
* 分享后回调
|
*
|
* @param requestCode
|
* @param resultCode
|
* @param data
|
*/
|
@Override
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
super.onActivityResult(requestCode, resultCode, data);
|
if (requestCode == 11 && resultCode == 12) {
|
//清除选中数据
|
if (goodsType == 1) {
|
adapter.selectList.clear();
|
} else if (goodsType == 2) {
|
adapter.selectListJD.clear();
|
} else {
|
adapter.selectListPDD.clear();
|
}
|
//右上角 改未未选中
|
tv_top_bar_right.setChecked(false);
|
rl_collect.setEnabled(true);//下拉刷新
|
updateView();//更新 顶部和底部状态栏
|
ll_delete.setVisibility(View.GONE);
|
ActivityResult = true;//设置分享回调标记
|
setData();//再次请求数据
|
}
|
}
|
|
/**
|
* 标记是否是onActivityResult 返回防止重新请求数据 显示item选择框
|
*/
|
private boolean ActivityResult = false;
|
|
/**
|
* 请求删除选择商品
|
*/
|
private void delete(int goodsType) {
|
if (pd == null) {
|
pd = new ShapeLoadingDialog.Builder(this).build();
|
}
|
pd.show();
|
String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", "");
|
String ids = "";//获取要删除的商品ID
|
if (goodsType == 1) {//淘宝
|
ids = JSONArray.parseArray(JSON.toJSONString(adapter.selectList)).toJSONString();
|
} else if (goodsType == 2) {//京东
|
ids = JSONArray.parseArray(JSON.toJSONString(adapter.selectListJD)).toJSONString();
|
} else {//拼多多
|
ids = JSONArray.parseArray(JSON.toJSONString(adapter.selectListPDD)).toJSONString();
|
}
|
//请求删除选择商品
|
mPresenter.deleteSelectStoreHouse(ids, uid);
|
}
|
|
/**
|
* 更新 选择状态 更新全选/删除/分享状态
|
*/
|
public void updateView() {
|
// tv_top_bar_right.setChecked(isSelectedMode());
|
//因为在点击分享后就会回调onActivityResult方法 但是上面的选择按钮状态没有改变
|
//所有当已经选中改变下面底部栏隐藏
|
if (!tv_top_bar_right.isChecked()) {
|
ll_delete.setVisibility(View.VISIBLE);
|
} else {
|
ll_delete.setVisibility(View.GONE);
|
}
|
//清除 当前京东拼多多淘宝 选中状态
|
if (goodsType == 1) {
|
storehouse_mode = false;
|
} else if (goodsType == 2) {
|
storehouse_modeJD = false;
|
} else
|
storehouse_modePDD = false;
|
//右上角 按钮设置为未选中
|
tv_top_bar_right.setChecked(false);
|
}
|
|
/**
|
* 重置adapter-item选中
|
*
|
* @param selectedMode
|
* @param goodsType
|
*/
|
public void setSelectedMode(boolean selectedMode, int goodsType) {
|
adapter.setSelectedMode(selectedMode, goodsType, storehouse_modeJD, storehouse_modePDD, storehouse_mode);
|
}
|
|
public boolean isSelectedMode() {
|
return adapter.isSelectedMode();
|
}
|
|
|
/**
|
* 小黄条
|
*
|
* @param jsonObject
|
*/
|
@Override
|
public void onAppPageNotificationSuccess(JSONObject jsonObject) {
|
mPresenter.setAppPageNotificationSuccess(jsonObject, tv_notice_content, ll_notice, iv_close);
|
}
|
|
@Override
|
public void onAppPageNotificationFail(String errorInfo) {
|
|
}
|
|
/**
|
* 分享库数据 请求成功
|
*
|
* @param jsonObject
|
*/
|
@Override
|
public void onSelectioStoreHouseListSuccess(JSONObject jsonObject) {
|
count = mPresenter.setresult_list(jsonObject, page, wList, adapter, count, bottom, iv_loading, tv_loading, ll_delete
|
, ll_go_scan, ll_no_net, ll_request_failture, ll_content, tv_top_bar_right, goodsType);
|
if (goodsType == 1) {
|
this.setSelectedMode(ActivityResult ? false : storehouse_mode, goodsType);
|
} else if (goodsType == 2) {
|
this.setSelectedMode(ActivityResult ? false : storehouse_modeJD, goodsType);
|
} else {
|
this.setSelectedMode(ActivityResult ? false : storehouse_modePDD, goodsType);
|
}
|
isLoad = true;
|
rl_collect.setRefreshing(false);
|
tv_top_bar_right.setEnabled(true);//允许点击
|
ActivityResult = false;
|
}
|
|
/**
|
* 分享库数据 请求失败
|
*
|
* @param errorInfo
|
*/
|
@Override
|
public void onSelectioStoreHouseListFail(String errorInfo) {
|
mPresenter.setSelectioStoreHouseListFail(bottom, ll_delete
|
, ll_go_scan, ll_no_net, ll_request_failture, ll_content, tv_top_bar_right, wList);
|
isLoad = true;
|
rl_collect.setRefreshing(false);
|
tv_top_bar_right.setEnabled(true);
|
}
|
|
/**
|
* 删除成功
|
*
|
* @param jsonObject
|
*/
|
@Override
|
public void onDeleteSelectStoreHouseSuccess(JSONObject jsonObject) {
|
mPresenter.setDeleteSelectStoreHouseSuccess(jsonObject, wList, adapter, pd, ll_delete
|
, ll_go_scan, ll_no_net, ll_request_failture, ll_content, tv_top_bar_right, goodsType);
|
rl_collect.setRefreshing(false);
|
rl_collect.setEnabled(true);
|
if (goodsType == 1) {
|
storehouse_mode = false;
|
} else if (goodsType == 2) {
|
storehouse_modeJD = false;
|
} else {
|
storehouse_modePDD = false;
|
}
|
|
}
|
|
/**
|
* 删除商品请求失败
|
*
|
* @param errorInfo
|
*/
|
@Override
|
public void onDeleteSelectStoreHouseFail(String errorInfo) {
|
if (pd != null) {
|
pd.dismiss();
|
}
|
rl_collect.setRefreshing(false);
|
Toast.makeText(SelectionStoreHouseActivity31.this, "删除失败----" + errorInfo, Toast.LENGTH_LONG).show();
|
}
|
|
/**
|
* 主线程刷新 adapter
|
*/
|
public void SetnotifyDataSetChanged() {
|
adapter.notifyDataSetChanged();
|
// rl_collect.postDelayed(new Runnable() {
|
// @Override
|
// public void run() {
|
//
|
// }
|
// }, 50);
|
}
|
}
|