| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | import com.wpc.library.okhttp.OkHttpUtils; |
| | | import com.wpc.library.util.NetUtils; |
| | | import com.tejia.lijin.app.BasicTextHttpResponseHandler; |
| | |
| | | if (last == total - 1 && mlist.size() < count && isLoad) { |
| | | page++; |
| | | isLoad = false; |
| | | tv_loading.setText("正在加载更多数据"); |
| | | tv_loading.setText(getResources().getString(R.string.loading_more_text)); |
| | | iv_loading.setVisibility(View.VISIBLE); |
| | | getHistory(); |
| | | } |
| | |
| | | |
| | | private void getHistory() { |
| | | SharedPreferences sp = getSharedPreferences("user", MODE_PRIVATE); |
| | | ShoppingApi.getHistory(this, page + "", (sp.getBoolean("isLogin", false) ? sp.getString("uid", "0") : null), "2", new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getHistory(this, page + "", UserUtil.getUid(ShoppingApplication.application), "2", new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | |
| | | */ |
| | | private void deleteHistory(String sid) { |
| | | SharedPreferences sp = getSharedPreferences("user", MODE_PRIVATE); |
| | | ShoppingApi.deleteHistory(this, sid, (sp.getBoolean("isLogin", false) ? sp.getString("uid", "0") : null), new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.deleteHistory(this, sid, UserUtil.getUid(ShoppingApplication.application), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optInt("code") == 0) { |