add to cart dialog
This commit is contained in:
@@ -5,6 +5,7 @@ import android.support.v7.widget.RecyclerView;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ import butterknife.BindView;
|
|||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import ch.pizzalink.android.R;
|
import ch.pizzalink.android.R;
|
||||||
import ch.pizzalink.android.activity.BaseActivity;
|
import ch.pizzalink.android.activity.BaseActivity;
|
||||||
|
import ch.pizzalink.android.helper.PriceHelper;
|
||||||
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
||||||
import ch.pizzalink.android.model.menu.MenuProductOptionValueModel;
|
import ch.pizzalink.android.model.menu.MenuProductOptionValueModel;
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@ public class ProductCheckboxOptionsRecyclerAdapter extends RecyclerView.Adapter<
|
|||||||
public static class ViewHolder extends RecyclerView.ViewHolder{
|
public static class ViewHolder extends RecyclerView.ViewHolder{
|
||||||
|
|
||||||
@BindView(R.id.productOptionCheckBox) AppCompatCheckBox productOptionCheckBox;
|
@BindView(R.id.productOptionCheckBox) AppCompatCheckBox productOptionCheckBox;
|
||||||
|
@BindView(R.id.optionPriceDescriptionTextView) TextView optionPriceDescriptionTextView;
|
||||||
|
|
||||||
public ViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
public ViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
||||||
super(view);
|
super(view);
|
||||||
@@ -48,7 +51,7 @@ public class ProductCheckboxOptionsRecyclerAdapter extends RecyclerView.Adapter<
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductCheckboxOptionsRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
|
public ProductCheckboxOptionsRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
|
||||||
View root = LayoutInflater.from(BaseActivity.currentActivity).inflate(R.layout.row_checkbox_option, viewGroup, false);
|
View root = LayoutInflater.from(BaseActivity.currentActivity).inflate(R.layout.row_option_checkbox, viewGroup, false);
|
||||||
return new ProductCheckboxOptionsRecyclerAdapter.ViewHolder(root, recyclerItemClickListener);
|
return new ProductCheckboxOptionsRecyclerAdapter.ViewHolder(root, recyclerItemClickListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,6 +59,7 @@ public class ProductCheckboxOptionsRecyclerAdapter extends RecyclerView.Adapter<
|
|||||||
public void onBindViewHolder(ProductCheckboxOptionsRecyclerAdapter.ViewHolder holder, int position) {
|
public void onBindViewHolder(ProductCheckboxOptionsRecyclerAdapter.ViewHolder holder, int position) {
|
||||||
holder.productOptionCheckBox.setChecked(productOptionValueList.get(position).isSelected());
|
holder.productOptionCheckBox.setChecked(productOptionValueList.get(position).isSelected());
|
||||||
holder.productOptionCheckBox.setText(productOptionValueList.get(position).getName());
|
holder.productOptionCheckBox.setText(productOptionValueList.get(position).getName());
|
||||||
|
holder.optionPriceDescriptionTextView.setText(PriceHelper.getProductOptionPriceText(productOptionValueList.get(position)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
package ch.pizzalink.android.adapter.recycler;
|
package ch.pizzalink.android.adapter.recycler;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.support.v7.widget.AppCompatRadioButton;
|
import android.support.v7.widget.AppCompatRadioButton;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import butterknife.BindDrawable;
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import ch.pizzalink.android.R;
|
import ch.pizzalink.android.R;
|
||||||
import ch.pizzalink.android.activity.BaseActivity;
|
import ch.pizzalink.android.activity.BaseActivity;
|
||||||
|
import ch.pizzalink.android.helper.PriceHelper;
|
||||||
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
||||||
import ch.pizzalink.android.model.menu.MenuProductOptionModel;
|
|
||||||
import ch.pizzalink.android.model.menu.MenuProductOptionValueModel;
|
import ch.pizzalink.android.model.menu.MenuProductOptionValueModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,6 +29,7 @@ public class ProductRadioOptionsRecyclerAdapter extends RecyclerView.Adapter<Pro
|
|||||||
public static class ViewHolder extends RecyclerView.ViewHolder{
|
public static class ViewHolder extends RecyclerView.ViewHolder{
|
||||||
|
|
||||||
@BindView(R.id.productOptionRadioButton) AppCompatRadioButton productOptionRadioButton;
|
@BindView(R.id.productOptionRadioButton) AppCompatRadioButton productOptionRadioButton;
|
||||||
|
@BindView(R.id.optionPriceDescriptionTextView) TextView optionPriceDescriptionTextView;
|
||||||
|
|
||||||
public ViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
public ViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
||||||
super(view);
|
super(view);
|
||||||
@@ -53,7 +51,7 @@ public class ProductRadioOptionsRecyclerAdapter extends RecyclerView.Adapter<Pro
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductRadioOptionsRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
|
public ProductRadioOptionsRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
|
||||||
View root = LayoutInflater.from(BaseActivity.currentActivity).inflate(R.layout.row_radio_option, viewGroup, false);
|
View root = LayoutInflater.from(BaseActivity.currentActivity).inflate(R.layout.row_option_radio, viewGroup, false);
|
||||||
return new ProductRadioOptionsRecyclerAdapter.ViewHolder(root, recyclerItemClickListener);
|
return new ProductRadioOptionsRecyclerAdapter.ViewHolder(root, recyclerItemClickListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +59,8 @@ public class ProductRadioOptionsRecyclerAdapter extends RecyclerView.Adapter<Pro
|
|||||||
public void onBindViewHolder(ProductRadioOptionsRecyclerAdapter.ViewHolder holder, int position) {
|
public void onBindViewHolder(ProductRadioOptionsRecyclerAdapter.ViewHolder holder, int position) {
|
||||||
holder.productOptionRadioButton.setChecked(productOptionValueList.get(position).isSelected());
|
holder.productOptionRadioButton.setChecked(productOptionValueList.get(position).isSelected());
|
||||||
holder.productOptionRadioButton.setText(productOptionValueList.get(position).getName());
|
holder.productOptionRadioButton.setText(productOptionValueList.get(position).getName());
|
||||||
|
holder.optionPriceDescriptionTextView.setText(PriceHelper.getProductOptionPriceText(productOptionValueList.get(position)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package ch.pizzalink.android.api;
|
package ch.pizzalink.android.api;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import ch.pizzalink.android.model.AddProductToBasketResponseModel;
|
import ch.pizzalink.android.model.AddProductToBasketResponseModel;
|
||||||
@@ -14,6 +15,7 @@ import retrofit2.http.Field;
|
|||||||
import retrofit2.http.FieldMap;
|
import retrofit2.http.FieldMap;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Header;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
@@ -76,6 +78,28 @@ public interface ApiInterface {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"product_id": "56",
|
||||||
|
"quantity": "1",
|
||||||
|
"token": "wXTVshBk2TU4XJmb23wa320zOBRodw4K",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"optionId" : "232",
|
||||||
|
"optionValue" : "34"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionId" : "232",
|
||||||
|
"optionValue" : "33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionId" : "231",
|
||||||
|
"optionValue" : "31"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import ch.pizzalink.android.api.ApiErrorUtils;
|
|||||||
import ch.pizzalink.android.api.ApiService;
|
import ch.pizzalink.android.api.ApiService;
|
||||||
import ch.pizzalink.android.api.ResponseObject;
|
import ch.pizzalink.android.api.ResponseObject;
|
||||||
import ch.pizzalink.android.helper.DialogHelper;
|
import ch.pizzalink.android.helper.DialogHelper;
|
||||||
|
import ch.pizzalink.android.helper.ImageLoadHelper;
|
||||||
import ch.pizzalink.android.helper.PriceHelper;
|
import ch.pizzalink.android.helper.PriceHelper;
|
||||||
import ch.pizzalink.android.helper.SessionHelper;
|
import ch.pizzalink.android.helper.SessionHelper;
|
||||||
import ch.pizzalink.android.helper.SharedPrefsHelper;
|
import ch.pizzalink.android.helper.SharedPrefsHelper;
|
||||||
@@ -46,8 +47,10 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragment {
|
public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
|
|
||||||
|
@BindView(R.id.productImageView) ImageView productImageView;
|
||||||
@BindView(R.id.productNameTextView) TextView productNameTextView;
|
@BindView(R.id.productNameTextView) TextView productNameTextView;
|
||||||
@BindView(R.id.productPriceTextView) TextView productPriceTextView;
|
@BindView(R.id.productPriceTextView) TextView productPriceTextView;
|
||||||
|
@BindView(R.id.addToCartButton) Button addToCartButton;
|
||||||
@BindView(R.id.radioRecyclerHeaderTextView) TextView radioRecyclerHeaderTextView;
|
@BindView(R.id.radioRecyclerHeaderTextView) TextView radioRecyclerHeaderTextView;
|
||||||
@BindView(R.id.radioRecyclerView) RecyclerView radioRecyclerView;
|
@BindView(R.id.radioRecyclerView) RecyclerView radioRecyclerView;
|
||||||
@BindView(R.id.checkboxRecyclerHeaderTextView) TextView checkboxRecyclerHeaderTextView;
|
@BindView(R.id.checkboxRecyclerHeaderTextView) TextView checkboxRecyclerHeaderTextView;
|
||||||
@@ -55,7 +58,6 @@ public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragmen
|
|||||||
@BindView(R.id.increaseProductCountImageView) ImageView increaseProductCountImageView;
|
@BindView(R.id.increaseProductCountImageView) ImageView increaseProductCountImageView;
|
||||||
@BindView(R.id.deccreaseProductCountImageView) ImageView deccreaseProductCountImageView;
|
@BindView(R.id.deccreaseProductCountImageView) ImageView deccreaseProductCountImageView;
|
||||||
@BindView(R.id.productCountTextView) TextView productCountTextView;
|
@BindView(R.id.productCountTextView) TextView productCountTextView;
|
||||||
@BindView(R.id.addToCartButton) Button addToCartButton;
|
|
||||||
|
|
||||||
private int productCount = 1;
|
private int productCount = 1;
|
||||||
|
|
||||||
@@ -82,7 +84,7 @@ public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragmen
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
//mBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
mBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick({R.id.increaseProductCountImageView,
|
@OnClick({R.id.increaseProductCountImageView,
|
||||||
@@ -147,7 +149,7 @@ public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragmen
|
|||||||
|
|
||||||
private void initRadioRecyclerView(){
|
private void initRadioRecyclerView(){
|
||||||
radioRecyclerView.setNestedScrollingEnabled(false);
|
radioRecyclerView.setNestedScrollingEnabled(false);
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(BaseActivity.currentActivity, 3);
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(BaseActivity.currentActivity, 1);
|
||||||
radioRecyclerView.setLayoutManager(gridLayoutManager);
|
radioRecyclerView.setLayoutManager(gridLayoutManager);
|
||||||
productRadioOptionsRecyclerAdapter = new ProductRadioOptionsRecyclerAdapter(productRadioOptionValueList, new RecyclerItemClickListener() {
|
productRadioOptionsRecyclerAdapter = new ProductRadioOptionsRecyclerAdapter(productRadioOptionValueList, new RecyclerItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -168,7 +170,7 @@ public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragmen
|
|||||||
|
|
||||||
private void initCheckboxRecyclerView(){
|
private void initCheckboxRecyclerView(){
|
||||||
checkboxRecyclerView.setNestedScrollingEnabled(false);
|
checkboxRecyclerView.setNestedScrollingEnabled(false);
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(BaseActivity.currentActivity, 3);
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(BaseActivity.currentActivity, 1);
|
||||||
checkboxRecyclerView.setLayoutManager(gridLayoutManager);
|
checkboxRecyclerView.setLayoutManager(gridLayoutManager);
|
||||||
productCheckboxOptionsRecyclerAdapter = new ProductCheckboxOptionsRecyclerAdapter(productCheckboxOptionValueList, new RecyclerItemClickListener() {
|
productCheckboxOptionsRecyclerAdapter = new ProductCheckboxOptionsRecyclerAdapter(productCheckboxOptionValueList, new RecyclerItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -185,6 +187,7 @@ public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragmen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setFields(){
|
private void setFields(){
|
||||||
|
ImageLoadHelper.loadImage(productImageView, menuProductModel.getImageURL());
|
||||||
productNameTextView.setText(menuProductModel.getName());
|
productNameTextView.setText(menuProductModel.getName());
|
||||||
productPriceTextView.setText(PriceHelper.getPriceWithCurreny(menuProductModel.getPrice()));
|
productPriceTextView.setText(PriceHelper.getPriceWithCurreny(menuProductModel.getPrice()));
|
||||||
productPriceTextView.setText(PriceHelper.getPriceWithCurreny(menuProductModel.getPrice()));
|
productPriceTextView.setText(PriceHelper.getPriceWithCurreny(menuProductModel.getPrice()));
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class PriceHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String calculatePriceAfterCountChanged(String oldPriceString, int oldCount, int newCount){
|
public static String calculatePriceAfterCountChanged(String oldPriceString, int oldCount, int newCount){
|
||||||
Double oldPrice = Double.valueOf(removeCurrencyFromPrice(oldPriceString));
|
Double oldPrice = stringToDouble(removeCurrencyFromPrice(oldPriceString));
|
||||||
Double productOldPrice = oldPrice / oldCount;
|
Double productOldPrice = oldPrice / oldCount;
|
||||||
Double productNewPrice = productOldPrice * newCount;
|
Double productNewPrice = productOldPrice * newCount;
|
||||||
return getPriceWithCurreny(productNewPrice);
|
return getPriceWithCurreny(productNewPrice);
|
||||||
@@ -41,14 +41,14 @@ public class PriceHelper {
|
|||||||
MenuProductModel menuProductModel,
|
MenuProductModel menuProductModel,
|
||||||
MenuProductOptionValueModel menuProductOptionValueModel){
|
MenuProductOptionValueModel menuProductOptionValueModel){
|
||||||
|
|
||||||
Double productPrice = Double.valueOf(menuProductModel.getPrice());
|
Double productPrice = stringToDouble(menuProductModel.getPrice());
|
||||||
|
|
||||||
switch (menuProductOptionValueModel.getPrice_prefix()){
|
switch (menuProductOptionValueModel.getPrice_prefix()){
|
||||||
case "+":
|
case "+":
|
||||||
productPrice += Double.valueOf(menuProductOptionValueModel.getPrice());
|
productPrice += stringToDouble(menuProductOptionValueModel.getPrice());
|
||||||
break;
|
break;
|
||||||
case "-":
|
case "-":
|
||||||
productPrice -= Double.valueOf(menuProductOptionValueModel.getPrice());
|
productPrice -= stringToDouble(menuProductOptionValueModel.getPrice());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,16 +60,16 @@ public class PriceHelper {
|
|||||||
MenuProductModel menuProductModel,
|
MenuProductModel menuProductModel,
|
||||||
ArrayList<MenuProductOptionValueModel> menuProductOptionValueModelList){
|
ArrayList<MenuProductOptionValueModel> menuProductOptionValueModelList){
|
||||||
|
|
||||||
Double productPrice = Double.valueOf(menuProductModel.getPrice());
|
Double productPrice = stringToDouble(menuProductModel.getPrice());
|
||||||
|
|
||||||
for(MenuProductOptionValueModel menuProductOptionValueModel : menuProductOptionValueModelList){
|
for(MenuProductOptionValueModel menuProductOptionValueModel : menuProductOptionValueModelList){
|
||||||
if(menuProductOptionValueModel.isSelected()){
|
if(menuProductOptionValueModel.isSelected()){
|
||||||
switch (menuProductOptionValueModel.getPrice_prefix()){
|
switch (menuProductOptionValueModel.getPrice_prefix()){
|
||||||
case "+":
|
case "+":
|
||||||
productPrice += Double.valueOf(menuProductOptionValueModel.getPrice());
|
productPrice += stringToDouble(menuProductOptionValueModel.getPrice());
|
||||||
break;
|
break;
|
||||||
case "-":
|
case "-":
|
||||||
productPrice -= Double.valueOf(menuProductOptionValueModel.getPrice());
|
productPrice -= stringToDouble(menuProductOptionValueModel.getPrice());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,5 +79,20 @@ public class PriceHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getProductOptionPriceText(MenuProductOptionValueModel productOptionValueModel){
|
||||||
|
return new StringBuilder()
|
||||||
|
//.append(productOptionValueModel.getPrice_prefix())
|
||||||
|
.append(" ")
|
||||||
|
.append(BaseActivity.currentActivity.getString(R.string.chf))
|
||||||
|
.append(" ")
|
||||||
|
.append(productOptionValueModel.getPrice())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Double stringToDouble(String string){
|
||||||
|
Double dbl = Double.valueOf(string);
|
||||||
|
return Math.floor(dbl * 100) / 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class MenuProductOptionValueModel implements Serializable{
|
|||||||
price = "";
|
price = "";
|
||||||
|
|
||||||
if(price_prefix == null)
|
if(price_prefix == null)
|
||||||
price_prefix = "";
|
price_prefix = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkNull(ArrayList<MenuProductOptionValueModel> productOptionValueList){
|
public static void checkNull(ArrayList<MenuProductOptionValueModel> productOptionValueList){
|
||||||
|
|||||||
@@ -23,79 +23,89 @@
|
|||||||
android:id="@+id/cartRecyclerView"
|
android:id="@+id/cartRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_above="@+id/cartDividerSpace"
|
android:layout_above="@+id/cartInfoLayout"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<android.support.v4.widget.Space
|
|
||||||
android:id="@+id/cartDividerSpace"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="12dp"
|
|
||||||
android:background="@color/red"
|
|
||||||
android:layout_above="@+id/cartInfoLayout"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/cartInfoLayout"
|
android:id="@+id/cartInfoLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp"
|
|
||||||
android:paddingLeft="24dp"
|
|
||||||
android:paddingStart="24dp"
|
|
||||||
android:paddingRight="24dp"
|
|
||||||
android:paddingEnd="24dp"
|
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<View
|
||||||
android:id="@+id/cartTotalLabelTextView"
|
android:id="@+id/cartDividerSpace"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="2dp"
|
||||||
android:textAllCaps="true"
|
android:background="@drawable/shadow" />
|
||||||
android:textColor="@color/black"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:text="TOTAL"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/cartProductTotalTextView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CHF 50.00"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:paddingStart="24dp"
|
||||||
|
android:paddingRight="24dp"
|
||||||
|
android:paddingEnd="24dp"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/clearCartButton"
|
android:id="@+id/cartTotalLabelTextView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:textAllCaps="true"
|
||||||
android:layout_marginRight="6dp"
|
android:textColor="@color/black"
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:text="@string/clear_cart"
|
android:text="TOTAL"/>
|
||||||
style="@style/PizzalinkButtonWithoutMargin"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/continueCartButton"
|
android:id="@+id/cartProductTotalTextView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CHF 50.00"
|
||||||
|
android:textSize="18sp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginLeft="6dp"
|
android:textColor="@color/black"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:text="@string/continue_cart"
|
android:textStyle="bold"/>
|
||||||
style="@style/PizzalinkButtonWithoutMargin"
|
|
||||||
android:layout_weight="1"/>
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/clearCartButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginRight="6dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:text="@string/clear_cart"
|
||||||
|
style="@style/PizzalinkButtonWithoutMargin"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/continueCartButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginLeft="6dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:text="@string/continue_cart"
|
||||||
|
style="@style/PizzalinkButtonWithoutMargin"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -6,31 +6,90 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@color/white">
|
android:background="@color/white">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/productNameTextView"
|
android:layout_width="36dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="36dp"
|
||||||
android:layout_height="match_parent"
|
android:padding="12dp"
|
||||||
android:textColor="@android:color/black"
|
android:src="@drawable/ic_back"
|
||||||
android:textSize="18sp"
|
android:visibility="gone"/>
|
||||||
android:text="Pizza Formaggio"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:gravity="center"/>
|
|
||||||
|
|
||||||
<TextView
|
<RelativeLayout
|
||||||
android:id="@+id/productPriceTextView"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@android:color/black"
|
android:padding="12dp">
|
||||||
android:text="CHF 25.00"
|
|
||||||
android:textSize="16sp"
|
<ImageView
|
||||||
android:paddingBottom="16dp"
|
android:id="@+id/productImageView"
|
||||||
android:paddingLeft="16dp"
|
android:layout_width="144dp"
|
||||||
android:paddingStart="16dp"
|
android:layout_height="144dp"
|
||||||
android:paddingRight="16dp"
|
android:layout_gravity="center_horizontal" />
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:textStyle="bold"
|
<LinearLayout
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="144dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_toRightOf="@+id/productImageView"
|
||||||
|
android:layout_toEndOf="@+id/productImageView">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/productNameTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/navigation_drawer_background"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:text="Pizza Formaggio"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_centerVertical="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/productPriceTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/navigation_drawer_background"
|
||||||
|
android:text="CHF 25.00"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:paddingLeft="12dp"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingRight="12dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_centerVertical="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/addToCartButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginLeft="12dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:text="@string/add_to_cart"
|
||||||
|
style="@style/PizzalinkButtonWithoutMargin" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@drawable/shadow"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -56,7 +115,9 @@
|
|||||||
android:paddingLeft="12dp"
|
android:paddingLeft="12dp"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingRight="12dp"
|
android:paddingRight="12dp"
|
||||||
android:paddingEnd="12dp"/>
|
android:paddingEnd="12dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/navigation_drawer_background"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ProductCountLayout"
|
android:id="@+id/ProductCountLayout"
|
||||||
@@ -67,9 +128,9 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/increaseProductCountImageView"
|
android:id="@+id/increaseProductCountImageView"
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:padding="8dp"
|
android:padding="4dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:src="@drawable/ic_increase"
|
android:src="@drawable/ic_increase"
|
||||||
android:layout_marginRight="4dp"
|
android:layout_marginRight="4dp"
|
||||||
@@ -81,15 +142,14 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="1"
|
android:text="1"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textColor="@color/black"/>
|
android:textColor="@color/black"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/deccreaseProductCountImageView"
|
android:id="@+id/deccreaseProductCountImageView"
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:padding="8dp"
|
android:padding="4dp"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -97,6 +157,10 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@drawable/shadow"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/radioRecyclerHeaderTextView"
|
android:id="@+id/radioRecyclerHeaderTextView"
|
||||||
@@ -104,7 +168,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"
|
||||||
|
android:text="Size"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/navigation_drawer_background"/>
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/radioRecyclerView"
|
android:id="@+id/radioRecyclerView"
|
||||||
@@ -112,13 +179,20 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@drawable/shadow"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/checkboxRecyclerHeaderTextView"
|
android:id="@+id/checkboxRecyclerHeaderTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/navigation_drawer_background"/>
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/checkboxRecyclerView"
|
android:id="@+id/checkboxRecyclerView"
|
||||||
@@ -133,20 +207,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/addToCartButtonLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/addToCartButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:text="@string/add_to_cart"
|
|
||||||
style="@style/PizzalinkButtonWithoutMargin" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -14,4 +14,19 @@
|
|||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:text="Klein"/>
|
android:text="Klein"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<RelativeLayout
|
||||||
|
android:layout_width="84dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/optionPriceDescriptionTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CHF 14.00"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -14,4 +14,19 @@
|
|||||||
android:text="Klein"
|
android:text="Klein"
|
||||||
android:clickable="false"/>
|
android:clickable="false"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<RelativeLayout
|
||||||
|
android:layout_width="84dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/optionPriceDescriptionTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CHF 14.00"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
Reference in New Issue
Block a user