get orders fix

This commit is contained in:
2017-10-05 21:22:21 +03:00
parent 389461f1a2
commit 8edec08d3e
5 changed files with 9 additions and 6 deletions

View File

@@ -48,8 +48,8 @@ public interface ApiInterface {
@POST(ApiEndPoints.API_LOGOUT) @POST(ApiEndPoints.API_LOGOUT)
Call<BaseResponseModel> logout(@Field("token") String customerToken); Call<BaseResponseModel> logout(@Field("token") String customerToken);
@POST(ApiEndPoints.API_GET_ORDER_HISTORY) @GET(ApiEndPoints.API_GET_ORDER_HISTORY)
Call<OrderHistoryResponseModel> getOrderHistory(@Body HashMap<String, Object> body); Call<OrderHistoryResponseModel> getOrderHistory(@Query("token") String token);
/* /*

View File

@@ -81,11 +81,12 @@ public class HistoryFragment extends BaseFragment {
orderHistoryRecyclerView.setAdapter(orderHistoryRecyclerAdapter); orderHistoryRecyclerView.setAdapter(orderHistoryRecyclerAdapter);
} }
// "cP1sbSmwc6GEE7fCy6du7KqRbkR7bY1q"
private void getOrderHistory(){ private void getOrderHistory(){
DialogHelper.showLoadingDialog(); DialogHelper.showLoadingDialog();
HashMap<String, Object> params = new HashMap<>(); HashMap<String, Object> params = new HashMap<>();
params.put("token", SessionHelper.getCustomerToken().getToken()); params.put("token", SessionHelper.getCustomerToken().getToken());
Call<OrderHistoryResponseModel> call = ApiService.apiInterface.getOrderHistory(params); Call<OrderHistoryResponseModel> call = ApiService.apiInterface.getOrderHistory(SessionHelper.getCustomerToken().getToken());
call.enqueue(new Callback<OrderHistoryResponseModel>() { call.enqueue(new Callback<OrderHistoryResponseModel>() {
@Override @Override
public void onResponse(Call<OrderHistoryResponseModel> call, Response<OrderHistoryResponseModel> response) { public void onResponse(Call<OrderHistoryResponseModel> call, Response<OrderHistoryResponseModel> response) {

View File

@@ -69,7 +69,7 @@ public class DialogHelper {
if(loadingDialog != null && loadingDialog.isShowing()) if(loadingDialog != null && loadingDialog.isShowing())
return; return;
loadingDialog = new MaterialDialog.Builder(BaseActivity.currentActivity) loadingDialog = new MaterialDialog.Builder(BaseActivity.currentActivity)
.content("Content") .content(BaseActivity.currentActivity.getString(R.string.loading))
.cancelable(false) .cancelable(false)
.progress(true, 0) .progress(true, 0)
.progressIndeterminateStyle(true) .progressIndeterminateStyle(true)

View File

@@ -3,7 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/actvity_default_background_color_1">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@@ -3,4 +3,5 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/orderHistoryRecyclerView" android:id="@+id/orderHistoryRecyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"
android:background="@color/actvity_default_background_color_1"/>