create order
This commit is contained in:
@@ -20,6 +20,10 @@ import ch.pizzalink.android.fragment.order.PaymentMethodFragment;
|
||||
import ch.pizzalink.android.fragment.order.ShippingAddressFragment;
|
||||
import ch.pizzalink.android.fragment.order.ShippingMethodFragment;
|
||||
import ch.pizzalink.android.helper.SharedPrefsHelper;
|
||||
import ch.pizzalink.android.model.AddressModel;
|
||||
import ch.pizzalink.android.model.PaymentMethodModel;
|
||||
import ch.pizzalink.android.model.ShippingMethodModel;
|
||||
import ch.pizzalink.android.model.cart.CartInfoModel;
|
||||
import ch.pizzalink.android.view.NoSwipeViewPager;
|
||||
import ch.pizzalink.android.view.PizzalinkToolbar;
|
||||
|
||||
@@ -30,14 +34,24 @@ public class OrderActivity extends BaseActivity {
|
||||
|
||||
private FragmentManager fragmentManager;
|
||||
|
||||
private CartInfoModel cartInfoModel;
|
||||
private ShippingMethodModel selectedShippingMethod;
|
||||
private AddressModel selectedShippingAddress;
|
||||
private PaymentMethodModel selectedPaymentMethod;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_order);
|
||||
ButterKnife.bind(this);
|
||||
getDataFromIntent();
|
||||
initViews();
|
||||
}
|
||||
|
||||
private void getDataFromIntent(){
|
||||
cartInfoModel = (CartInfoModel) getIntent().getSerializableExtra("cartInfoModel");
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
orderToolbar.setBackIconClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -129,27 +143,31 @@ public class OrderActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public void setShippingInfo(){
|
||||
|
||||
public CartInfoModel getCartInfo(){
|
||||
return cartInfoModel;
|
||||
}
|
||||
|
||||
public void getShippingMethodTitle(){
|
||||
|
||||
public ShippingMethodModel getSelectedShippingMethod(){
|
||||
return selectedShippingMethod;
|
||||
}
|
||||
|
||||
public void getShippingMethodCode(){
|
||||
|
||||
public void setSelectedShippingMethod(ShippingMethodModel selectedShippingMethod){
|
||||
this.selectedShippingMethod = selectedShippingMethod;
|
||||
}
|
||||
|
||||
public void setPaymentInfo(){
|
||||
|
||||
public AddressModel getSelectedShippingAddress(){
|
||||
return selectedShippingAddress;
|
||||
}
|
||||
|
||||
public void getPaymentMethodTitle(){
|
||||
|
||||
public void setSelectedShippingAddress(AddressModel selectedShippingAddress){
|
||||
this.selectedShippingAddress = selectedShippingAddress;
|
||||
}
|
||||
|
||||
public void getPaymentMethodCode(){
|
||||
public PaymentMethodModel getSelectedPaymentMethod(){
|
||||
return selectedPaymentMethod;
|
||||
}
|
||||
|
||||
public void setSelectedPaymentMethod(PaymentMethodModel selectedPaymentMethod){
|
||||
this.selectedPaymentMethod = selectedPaymentMethod;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,19 +32,10 @@ public class OrderHistoryRecyclerAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
@BindView(R.id.orderDateTextView) TextView orderDateTextView;
|
||||
@BindView(R.id.orderTotalTextView) TextView orderTotalTextView;
|
||||
@BindView(R.id.orderStatusTextView) TextView orderStatusTextView;
|
||||
@BindView(R.id.cancelOrderImageView) ImageView cancelOrderImageView;
|
||||
|
||||
public OrderViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
||||
super(view);
|
||||
ButterKnife.bind(this, view);
|
||||
cancelOrderImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(recyclerItemClickListener != null)
|
||||
recyclerItemClickListener.onItemClick(cancelOrderImageView, getAdapterPosition());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ public class ApiEndPoints {
|
||||
public static final String API_GET_SHIPPING_METHODS = PREFIX + "getShippingMethodsArray" + SUFFIX;
|
||||
public static final String API_GET_CUSTOMER_ADDRESSES = PREFIX + "getAddresses" + SUFFIX;
|
||||
public static final String API_GET_PAYMENT_METHODS = PREFIX + "getPaymentMethodsArray" + SUFFIX;
|
||||
public static final String API_CREATE_ORDER = PREFIX + "addOrder" + SUFFIX + "&token=";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -91,4 +91,8 @@ public interface ApiInterface {
|
||||
@GET(ApiEndPoints.API_GET_PAYMENT_METHODS)
|
||||
Call<ResponseObject<PaymentMethodsResponseModel>> getPaymentMethods(@Query("token") String token);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST
|
||||
Call<ResponseObject<Integer>> createOrder(@Url String url, @FieldMap HashMap<String, Object> body);
|
||||
|
||||
}
|
||||
|
||||
@@ -266,7 +266,9 @@ public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragmen
|
||||
private void addProductToCart(){
|
||||
DialogHelper.showLoadingDialog();
|
||||
Call<ResponseObject<AddProductToBasketResponseModel>> call =
|
||||
ApiService.apiInterface.addProductsToBasket(ApiEndPoints.API_ADD_PRODUCTS_TO_BASKET + SessionHelper.getCustomerToken().getToken(), getAddToCartRequestParams());
|
||||
ApiService.apiInterface.addProductsToBasket(
|
||||
ApiEndPoints.API_ADD_PRODUCTS_TO_BASKET + SessionHelper.getCustomerToken().getToken(),
|
||||
getAddToCartRequestParams());
|
||||
call.enqueue(new Callback<ResponseObject<AddProductToBasketResponseModel>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseObject<AddProductToBasketResponseModel>> call, Response<ResponseObject<AddProductToBasketResponseModel>> response) {
|
||||
|
||||
@@ -66,6 +66,7 @@ public class CartFragment extends BaseFragment {
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "cartFragment";
|
||||
|
||||
private CartInfoModel cartInfoModel;
|
||||
private ArrayList<CartProductModel> cartProductList = new ArrayList<>();
|
||||
private CartRecyclerAdapter cartRecyclerAdapter;
|
||||
|
||||
@@ -107,7 +108,9 @@ public class CartFragment extends BaseFragment {
|
||||
});
|
||||
break;
|
||||
case R.id.continueCartButton:
|
||||
startActivity(new Intent(BaseActivity.currentActivity, OrderActivity.class));
|
||||
Intent continueCartIntent = new Intent(BaseActivity.currentActivity, OrderActivity.class);
|
||||
continueCartIntent.putExtra("cartInfoModel", cartInfoModel);
|
||||
startActivity(continueCartIntent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -128,8 +131,9 @@ public class CartFragment extends BaseFragment {
|
||||
if(response.isSuccessful() &&
|
||||
response.body().getData() != null &&
|
||||
response.body().isSuccess()){
|
||||
setCartTotalFields(response.body().getData().getTotals().get(0));
|
||||
fillAndNotifyAdapter(response.body().getData().getProducts());
|
||||
cartInfoModel = response.body().getData();
|
||||
setCartTotalFields();
|
||||
fillAndNotifyAdapter();
|
||||
}
|
||||
else
|
||||
ApiErrorUtils.parseError(response);
|
||||
@@ -172,17 +176,17 @@ public class CartFragment extends BaseFragment {
|
||||
});
|
||||
}
|
||||
|
||||
private void fillAndNotifyAdapter(ArrayList<CartProductModel> cartList){
|
||||
CartProductModel.checkNull(cartList);
|
||||
private void fillAndNotifyAdapter(){
|
||||
CartProductModel.checkNull(cartInfoModel.getProducts());
|
||||
cartProductList.clear();
|
||||
cartProductList.addAll(cartList);
|
||||
cartProductList.addAll(cartInfoModel.getProducts());
|
||||
cartRecyclerAdapter.notifyDataSetChanged();
|
||||
setCartLayoutsVisibility();
|
||||
}
|
||||
|
||||
private void setCartTotalFields(CartTotalModel cartTotalModel){
|
||||
cartTotalLabelTextView.setText(cartTotalModel.getTitle());
|
||||
cartProductTotalTextView.setText(cartTotalModel.getText());
|
||||
private void setCartTotalFields(){
|
||||
cartTotalLabelTextView.setText(cartInfoModel.getTotals().get(0).getTitle());
|
||||
cartProductTotalTextView.setText(cartInfoModel.getTotals().get(0).getText());
|
||||
}
|
||||
|
||||
private void initRecyclerView(){
|
||||
|
||||
@@ -11,6 +11,7 @@ import butterknife.OnClick;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.OrderActivity;
|
||||
import ch.pizzalink.android.fragment.BaseFragment;
|
||||
import ch.pizzalink.android.helper.SharedPrefsHelper;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 17/10/2017.
|
||||
@@ -22,8 +23,6 @@ public class OrderResultFragment extends OrderBaseFragment {
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "orderResultFragment";
|
||||
|
||||
private boolean isOrderSuccessed;
|
||||
|
||||
public OrderResultFragment() {}
|
||||
|
||||
public static OrderResultFragment newInstance() {
|
||||
@@ -43,23 +42,14 @@ public class OrderResultFragment extends OrderBaseFragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
@OnClick({R.id.previousTextView, R.id.nextTextView})
|
||||
protected void onClick(View view){
|
||||
@OnClick( R.id.nextTextView)
|
||||
protected void onClick(){
|
||||
OrderActivity orderActivity = (OrderActivity) getActivity();
|
||||
switch (view.getId()){
|
||||
case R.id.previousTextView:
|
||||
orderActivity.onPreviousClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
case R.id.nextTextView:
|
||||
if(isOrderSuccessed){
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
break;
|
||||
}
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
isOrderSuccessed = true;
|
||||
SharedPrefsHelper.setCartItemCount(0);
|
||||
previousTextView.setVisibility(View.GONE);
|
||||
nextTextView.setText(doneOrderText);
|
||||
}
|
||||
|
||||
@@ -4,13 +4,26 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import butterknife.BindString;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.OrderActivity;
|
||||
import ch.pizzalink.android.fragment.BaseFragment;
|
||||
import ch.pizzalink.android.api.ApiEndPoints;
|
||||
import ch.pizzalink.android.api.ApiErrorUtils;
|
||||
import ch.pizzalink.android.api.ApiService;
|
||||
import ch.pizzalink.android.api.ResponseObject;
|
||||
import ch.pizzalink.android.helper.DialogHelper;
|
||||
import ch.pizzalink.android.helper.SessionHelper;
|
||||
import ch.pizzalink.android.helper.SharedPrefsHelper;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 17/10/2017.
|
||||
@@ -18,9 +31,16 @@ import ch.pizzalink.android.fragment.BaseFragment;
|
||||
|
||||
public class OrderSummaryFragment extends OrderBaseFragment {
|
||||
|
||||
@BindView(R.id.orderPersonFullnameTextView) TextView orderPersonFullnameTextView;
|
||||
@BindView(R.id.orderShippingMethodTextView) TextView orderShippingMethodTextView;
|
||||
@BindView(R.id.orderShippingAddressTextView) TextView orderShippingAddressTextView;
|
||||
@BindView(R.id.orderPaymentMethodTextView) TextView orderPaymentMethodTextView;
|
||||
@BindView(R.id.orderTotalTextView) TextView orderTotalTextView;
|
||||
|
||||
@BindString(R.string.confirm_order) String confirmOrderText;
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "orderSummaryFragment";
|
||||
private OrderActivity orderActivity;
|
||||
|
||||
public OrderSummaryFragment() {}
|
||||
|
||||
@@ -41,13 +61,68 @@ public class OrderSummaryFragment extends OrderBaseFragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
@OnClick(R.id.nextTextView)
|
||||
protected void onClick(){
|
||||
@OnClick({R.id.previousTextView, R.id.nextTextView})
|
||||
protected void onClick(View view){
|
||||
OrderActivity orderActivity = (OrderActivity) getActivity();
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
switch (view.getId()){
|
||||
case R.id.previousTextView:
|
||||
orderActivity.onPreviousClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
case R.id.nextTextView:
|
||||
//orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
createOrder();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
|
||||
nextTextView.setText(confirmOrderText);
|
||||
|
||||
orderActivity = (OrderActivity) getActivity();
|
||||
|
||||
orderPersonFullnameTextView.setText(SessionHelper.getUser().getFullname());
|
||||
orderShippingMethodTextView.setText(orderActivity.getSelectedShippingMethod().getTitle());
|
||||
orderShippingAddressTextView.setText(orderActivity.getSelectedShippingAddress().getAddress());
|
||||
orderPaymentMethodTextView.setText(orderActivity.getSelectedPaymentMethod().getTitle());
|
||||
orderTotalTextView.setText(orderActivity.getCartInfo().getTotals().get(0).getText());
|
||||
}
|
||||
|
||||
private void createOrder(){
|
||||
DialogHelper.showLoadingDialog();
|
||||
Call<ResponseObject<Integer>> call = ApiService.apiInterface.createOrder(
|
||||
ApiEndPoints.API_CREATE_ORDER + SessionHelper.getCustomerToken().getToken(), getCreateOrderParams());
|
||||
call.enqueue(new Callback<ResponseObject<Integer>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseObject<Integer>> call, Response<ResponseObject<Integer>> response) {
|
||||
DialogHelper.hideLoadingDialog();
|
||||
if(response.isSuccessful() && response.body().isSuccess()){
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
else{
|
||||
//orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
ApiErrorUtils.parseError(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ResponseObject<Integer>> call, Throwable t) {
|
||||
DialogHelper.hideLoadingDialog();
|
||||
DialogHelper.showFailedDialog();
|
||||
//orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private HashMap<String, Object> getCreateOrderParams(){
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("customer_id", SessionHelper.getUser().getId());
|
||||
params.put("shipping_method_title", orderActivity.getSelectedShippingMethod().getTitle());
|
||||
params.put("shipping_method_code", orderActivity.getSelectedShippingMethod().getCode());
|
||||
params.put("address_id", orderActivity.getSelectedShippingAddress().getId());
|
||||
params.put("payment_method_title", orderActivity.getSelectedPaymentMethod().getTitle());
|
||||
params.put("payment_method_code", orderActivity.getSelectedPaymentMethod().getCode());
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PaymentMethodFragment extends OrderBaseFragment {
|
||||
private ArrayList<PaymentMethodModel> paymentMethodList = new ArrayList<>();
|
||||
private PaymentMethodsRecyclerAdapter paymentMethodsRecyclerAdapter;
|
||||
|
||||
private boolean isPaymentMethodSelected;
|
||||
private PaymentMethodModel selectedPaymentMethod;
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "paymentMethodFragment";
|
||||
|
||||
@@ -76,12 +76,13 @@ public class PaymentMethodFragment extends OrderBaseFragment {
|
||||
orderActivity.onPreviousClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
case R.id.nextTextView:
|
||||
if(isPaymentMethodSelected){
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
else {
|
||||
|
||||
if(selectedPaymentMethod == null){
|
||||
DialogHelper.showAlertDialog(BaseActivity.currentActivity, choosePaymentMethodText);
|
||||
break;
|
||||
}
|
||||
orderActivity.setSelectedPaymentMethod(selectedPaymentMethod);
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +124,7 @@ public class PaymentMethodFragment extends OrderBaseFragment {
|
||||
paymentMethodList.addAll(paymentMethodModels);
|
||||
if(paymentMethodList.size() != 0){
|
||||
paymentMethodList.get(0).setSelected(true);
|
||||
isPaymentMethodSelected = true;
|
||||
selectedPaymentMethod = paymentMethodList.get(0);
|
||||
}
|
||||
paymentMethodsRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@@ -136,7 +137,7 @@ public class PaymentMethodFragment extends OrderBaseFragment {
|
||||
paymentMethodModel.setSelected(false);
|
||||
}
|
||||
paymentMethodList.get(position).setSelected(true);
|
||||
isPaymentMethodSelected = true;
|
||||
selectedPaymentMethod = paymentMethodList.get(position);
|
||||
paymentMethodsRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ShippingAddressFragment extends OrderBaseFragment {
|
||||
private ArrayList<AddressModel> addressList = new ArrayList<>();
|
||||
private ShippingAddressesRecyclerAdapter shippingAddressesRecyclerAdapter;
|
||||
|
||||
private boolean isShippingAddressSelected;
|
||||
private AddressModel selectedAddress;
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "shippingAddressMethod";
|
||||
|
||||
@@ -74,12 +74,14 @@ public class ShippingAddressFragment extends OrderBaseFragment {
|
||||
orderActivity.onPreviousClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
case R.id.nextTextView:
|
||||
if(isShippingAddressSelected){
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
else {
|
||||
|
||||
if(selectedAddress == null){
|
||||
DialogHelper.showAlertDialog(BaseActivity.currentActivity, chooseShippingAddressText);
|
||||
return;
|
||||
}
|
||||
|
||||
orderActivity.setSelectedShippingAddress(selectedAddress);
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +122,7 @@ public class ShippingAddressFragment extends OrderBaseFragment {
|
||||
addressList.addAll(addressModels);
|
||||
if(addressList.size() != 0){
|
||||
addressList.get(0).setSelected(true);
|
||||
isShippingAddressSelected = true;
|
||||
selectedAddress = addressList.get(0);
|
||||
}
|
||||
shippingAddressesRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@@ -133,7 +135,7 @@ public class ShippingAddressFragment extends OrderBaseFragment {
|
||||
addressModel.setSelected(false);
|
||||
}
|
||||
addressList.get(position).setSelected(true);
|
||||
isShippingAddressSelected = true;
|
||||
selectedAddress = addressList.get(position);
|
||||
shippingAddressesRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ShippingMethodFragment extends OrderBaseFragment {
|
||||
private ArrayList<ShippingMethodModel> shippingMethodList = new ArrayList<>();
|
||||
private ShippingMethodsRecyclerAdapter shippingMethodsRecyclerAdapter;
|
||||
|
||||
private boolean isShippingMethodSelected;
|
||||
private ShippingMethodModel selectedShippingMethodModel;
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "shippingMethodFragment";
|
||||
|
||||
@@ -71,13 +71,15 @@ public class ShippingMethodFragment extends OrderBaseFragment {
|
||||
|
||||
@OnClick(R.id.nextTextView)
|
||||
protected void onClick(){
|
||||
if(isShippingMethodSelected){
|
||||
OrderActivity orderActivity = (OrderActivity) getActivity();
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
else {
|
||||
|
||||
if(selectedShippingMethodModel == null){
|
||||
DialogHelper.showAlertDialog(BaseActivity.currentActivity, chooseShippingMethodText);
|
||||
return;
|
||||
}
|
||||
|
||||
OrderActivity orderActivity = (OrderActivity) getActivity();
|
||||
orderActivity.setSelectedShippingMethod(selectedShippingMethodModel);
|
||||
orderActivity.onNextClicked(FRAGMENT_NAME);
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
@@ -117,7 +119,7 @@ public class ShippingMethodFragment extends OrderBaseFragment {
|
||||
shippingMethodList.addAll(shippingMethodModels);
|
||||
if(shippingMethodList.size() != 0){
|
||||
shippingMethodList.get(0).setSelected(true);
|
||||
isShippingMethodSelected = true;
|
||||
selectedShippingMethodModel = shippingMethodList.get(0);
|
||||
}
|
||||
shippingMethodsRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@@ -130,7 +132,7 @@ public class ShippingMethodFragment extends OrderBaseFragment {
|
||||
shippingMethodModel.setSelected(false);
|
||||
}
|
||||
shippingMethodList.get(position).setSelected(true);
|
||||
isShippingMethodSelected = true;
|
||||
selectedShippingMethodModel = shippingMethodList.get(position);
|
||||
shippingMethodsRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,6 +37,10 @@ public class UserModel {
|
||||
token.checkNull();
|
||||
}
|
||||
|
||||
public String getFullname(){
|
||||
return firstname + " " + lastname;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package ch.pizzalink.android.model.cart;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 05/10/2017.
|
||||
*/
|
||||
|
||||
public class CartInfoModel {
|
||||
public class CartInfoModel implements Serializable {
|
||||
|
||||
private ArrayList<CartProductModel> products;
|
||||
private ArrayList<CartTotalModel> totals;
|
||||
|
||||
@@ -3,13 +3,14 @@ package ch.pizzalink.android.model.cart;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 05/10/2017.
|
||||
*/
|
||||
|
||||
public class CartProductModel {
|
||||
public class CartProductModel implements Serializable {
|
||||
|
||||
@Expose @SerializedName("cart_id") private String cartId;
|
||||
@Expose @SerializedName("product_id") private String productId;
|
||||
|
||||
@@ -3,11 +3,13 @@ package ch.pizzalink.android.model.cart;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 05/10/2017.
|
||||
*/
|
||||
|
||||
public class CartProductOptionModel {
|
||||
public class CartProductOptionModel implements Serializable {
|
||||
|
||||
@Expose @SerializedName("product_option_id") private String id;
|
||||
@Expose @SerializedName("product_option_value_id") private String valueId;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package ch.pizzalink.android.model.cart;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 05/10/2017.
|
||||
*/
|
||||
|
||||
public class CartTotalModel {
|
||||
public class CartTotalModel implements Serializable {
|
||||
|
||||
private String title;
|
||||
private String text;
|
||||
|
||||
@@ -6,12 +6,21 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Order Result"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_above="@+id/ordersBottomLayout"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/ordersBottomLayout">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/order_successed"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/layout_orders_bottom"/>
|
||||
|
||||
|
||||
@@ -6,12 +6,164 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Order Summary"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_above="@+id/ordersBottomLayout"/>
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_above="@id/ordersBottomLayout">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/order_person_fullname"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/heater"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderPersonFullnameTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Aytaç Cici"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/order_shipping_method"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/heater"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderShippingMethodTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selber Abholen"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/order_shipping_address"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/heater"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderShippingAddressTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Aytaç Cici A Street B. Avanue 1004 ABC Schweiz"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/order_payment_method"
|
||||
android:textColor="@color/heater"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderPaymentMethodTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Kreditkarten-Kartenzahlung"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/order_total"
|
||||
android:textColor="@color/heater"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderTotalTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="CHF 30.00"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<include layout="@layout/layout_orders_bottom"/>
|
||||
|
||||
|
||||
@@ -18,37 +18,15 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderDateTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="5 Oct. 2017 "
|
||||
android:textColor="@color/black"
|
||||
android:padding="8dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_centerVertical="true"
|
||||
android:textSize="16sp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toLeftOf="@+id/cancelOrderImageView"
|
||||
android:layout_toStartOf="@+id/cancelOrderImageView"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cancelOrderImageView"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_cancel_2"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/orderDateTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="5 Oct. 2017 "
|
||||
android:textColor="@color/black"
|
||||
android:padding="8dp"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderTotalTextView"
|
||||
|
||||
@@ -37,4 +37,8 @@
|
||||
|
||||
<color name="background_splash">#F4F4F4</color>
|
||||
|
||||
|
||||
<color name="heater">#ABB6C2</color>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -140,6 +140,18 @@
|
||||
<string name="confirm_order">APPROVE</string>
|
||||
<string name="done_order">DONE</string>
|
||||
|
||||
<!-- OrderSummaryFragment-->
|
||||
<string name="order_person_fullname">TO</string>
|
||||
<string name="order_shipping_method">SHIPPING METHOD</string>
|
||||
<string name="order_shipping_address">SHIPPING ADDRESS</string>
|
||||
<string name="order_payment_method">PAYMENT METHOD</string>
|
||||
<string name="order_total">TOTAL</string>
|
||||
<!-- OrderSummaryFragment-->
|
||||
|
||||
<!-- OrderResultFragment-->
|
||||
<string name="order_successed">Siparişiniz başarı ile alınmıştır. Siparişinizin detaylarını sipariş geçmişinden görebilir ve siparişinizi takip edebilirsiniz.</string>
|
||||
<!-- OrderSummaryFragment-->
|
||||
|
||||
<string-array name="stepperLabels">
|
||||
<item>Shipping Method</item>
|
||||
<item>Shipping Address</item>
|
||||
|
||||
Reference in New Issue
Block a user