prodcuts and cart
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -37,7 +37,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package ch.pizzalink.android.activity;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomNavigationView;
|
||||
import android.support.design.widget.BottomSheetBehavior;
|
||||
import android.support.design.widget.BottomSheetDialog;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
@@ -22,6 +25,7 @@ import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.adapter.recycler.NavigationMenuRecyclerAdapter;
|
||||
import ch.pizzalink.android.api.ApiConstants;
|
||||
import ch.pizzalink.android.dialog.ProductPropertiesBottomSheetDialog;
|
||||
import ch.pizzalink.android.fragment.CartFragment;
|
||||
import ch.pizzalink.android.fragment.InfoFragment;
|
||||
import ch.pizzalink.android.fragment.HistoryFragment;
|
||||
@@ -276,6 +280,4 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package ch.pizzalink.android.adapter.recycler;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 08/10/2017.
|
||||
*/
|
||||
|
||||
public class ProductCheckboxOptionsRecyclerAdapter {
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package ch.pizzalink.android.adapter.recycler;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v7.widget.AppCompatRadioButton;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindDrawable;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.BaseActivity;
|
||||
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
||||
import ch.pizzalink.android.model.menu.MenuProductOptionModel;
|
||||
import ch.pizzalink.android.model.menu.MenuProductOptionValueModel;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 08/10/2017.
|
||||
*/
|
||||
|
||||
public class ProductRadioOptionsRecyclerAdapter extends RecyclerView.Adapter<ProductRadioOptionsRecyclerAdapter.ViewHolder> {
|
||||
|
||||
private ArrayList<MenuProductOptionValueModel> productOptionValueList;
|
||||
private RecyclerItemClickListener recyclerItemClickListener;
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
@BindView(R.id.productOptionRadioButton) AppCompatRadioButton productOptionRadioButton;
|
||||
|
||||
public ViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
||||
super(view);
|
||||
ButterKnife.bind(this, view);
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(recyclerItemClickListener != null)
|
||||
recyclerItemClickListener.onItemClick(view, getAdapterPosition());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public ProductRadioOptionsRecyclerAdapter(ArrayList<MenuProductOptionValueModel> productOptionValueList, RecyclerItemClickListener recyclerItemClickListener){
|
||||
this.productOptionValueList = productOptionValueList;
|
||||
this.recyclerItemClickListener = recyclerItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductRadioOptionsRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
|
||||
View root = LayoutInflater.from(BaseActivity.currentActivity).inflate(R.layout.row_radio_option, viewGroup, false);
|
||||
return new ProductRadioOptionsRecyclerAdapter.ViewHolder(root, recyclerItemClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ProductRadioOptionsRecyclerAdapter.ViewHolder holder, int position) {
|
||||
holder.productOptionRadioButton.setChecked(productOptionValueList.get(position).isSelected());
|
||||
holder.productOptionRadioButton.setText(productOptionValueList.get(position).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return productOptionValueList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package ch.pizzalink.android.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomSheetBehavior;
|
||||
import android.support.design.widget.BottomSheetDialog;
|
||||
import android.support.design.widget.BottomSheetDialogFragment;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindString;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.BaseActivity;
|
||||
import ch.pizzalink.android.adapter.recycler.ProductRadioOptionsRecyclerAdapter;
|
||||
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
||||
import ch.pizzalink.android.model.menu.MenuProductModel;
|
||||
import ch.pizzalink.android.model.menu.MenuProductOptionValueModel;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 08/10/2017.
|
||||
*/
|
||||
|
||||
public class ProductPropertiesBottomSheetDialog extends BottomSheetDialogFragment {
|
||||
|
||||
@BindView(R.id.productNameTextView) TextView productNameTextView;
|
||||
@BindView(R.id.productPriceTextView) TextView productPriceTextView;
|
||||
@BindView(R.id.radioRecyclerView) RecyclerView radioRecyclerView;
|
||||
@BindView(R.id.checkboxRecyclerView) RecyclerView checkboxRecyclerView;
|
||||
@BindView(R.id.increaseProductCountImageView) ImageView increaseProductCountImageView;
|
||||
@BindView(R.id.deccreaseProductCountImageView) ImageView deccreaseProductCountImageView;
|
||||
@BindView(R.id.productCountTextView) TextView productCountTextView;
|
||||
@BindView(R.id.addToCartButton) Button addToCartButton;
|
||||
|
||||
@BindString(R.string.chf) String chfText;
|
||||
|
||||
private int productCount = 1;
|
||||
|
||||
private BottomSheetBehavior mBehavior;
|
||||
private MenuProductModel menuProductModel;
|
||||
|
||||
private ArrayList<MenuProductOptionValueModel> menuProductOptionValueList = new ArrayList<>();
|
||||
private ProductRadioOptionsRecyclerAdapter productRadioOptionsRecyclerAdapter;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
|
||||
View view = View.inflate(getContext(), R.layout.layout_bottomsheet, null);
|
||||
ButterKnife.bind(this, view);
|
||||
initViews();
|
||||
dialog.setContentView(view);
|
||||
mBehavior = BottomSheetBehavior.from((View) view.getParent());
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
//mBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
|
||||
@OnClick({R.id.increaseProductCountImageView,
|
||||
R.id.deccreaseProductCountImageView,
|
||||
R.id.addToCartButton})
|
||||
public void onCLick(View view){
|
||||
switch (view.getId()){
|
||||
case R.id.increaseProductCountImageView:
|
||||
productCount++;
|
||||
productCountTextView.setText(String.valueOf(productCount));
|
||||
break;
|
||||
case R.id.deccreaseProductCountImageView:
|
||||
if(productCount == 1)
|
||||
break;
|
||||
productCount--;
|
||||
productCountTextView.setText(String.valueOf(productCount));
|
||||
break;
|
||||
case R.id.addToCartButton:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
setFields();
|
||||
if(menuProductModel.getProductOptionType() == MenuProductModel.ProductOptionType.RADIO)
|
||||
initRadioRecyclerView();
|
||||
/*
|
||||
else if(menuProductModel.getProductOptionType() == MenuProductModel.ProductOptionType.CHECKBOX)
|
||||
initCheckboxRecyclerView();
|
||||
*/
|
||||
}
|
||||
|
||||
public void setMenuProductModel(MenuProductModel menuProductModel){
|
||||
this.menuProductModel = menuProductModel;
|
||||
}
|
||||
|
||||
private void initRadioRecyclerView(){
|
||||
menuProductOptionValueList.addAll(menuProductModel.getProductOptionList().get(0).getOptionValueModelList());
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(BaseActivity.currentActivity, 3);
|
||||
radioRecyclerView.setLayoutManager(gridLayoutManager);
|
||||
productRadioOptionsRecyclerAdapter = new ProductRadioOptionsRecyclerAdapter(menuProductOptionValueList, new RecyclerItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
if(!menuProductOptionValueList.get(position).isSelected()){
|
||||
for(MenuProductOptionValueModel menuProductOptionValueModel : menuProductOptionValueList){
|
||||
menuProductOptionValueModel.setSelected(false);
|
||||
}
|
||||
menuProductOptionValueList.get(position).setSelected(true);
|
||||
productRadioOptionsRecyclerAdapter.notifyDataSetChanged();
|
||||
productPriceTextView.setText(chfText + " " + menuProductOptionValueList.get(position).getPrice());
|
||||
}
|
||||
}
|
||||
});
|
||||
radioRecyclerView.setAdapter(productRadioOptionsRecyclerAdapter);
|
||||
}
|
||||
|
||||
private void setFields(){
|
||||
productNameTextView.setText(menuProductModel.getName());
|
||||
productPriceTextView.setText(chfText + " " + menuProductModel.getPrice());
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void onItemClick(Item item) {
|
||||
mBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package ch.pizzalink.android.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.BottomSheetBehavior;
|
||||
import android.support.design.widget.BottomSheetDialog;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -13,10 +15,12 @@ import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.BaseActivity;
|
||||
import ch.pizzalink.android.activity.MainActivity;
|
||||
import ch.pizzalink.android.adapter.recycler.MenuProductRecyclerAdapter;
|
||||
import ch.pizzalink.android.api.ApiErrorUtils;
|
||||
import ch.pizzalink.android.api.ApiService;
|
||||
import ch.pizzalink.android.api.ResponseArray;
|
||||
import ch.pizzalink.android.dialog.ProductPropertiesBottomSheetDialog;
|
||||
import ch.pizzalink.android.fragment.order.OrderBaseFragment;
|
||||
import ch.pizzalink.android.helper.DialogHelper;
|
||||
import ch.pizzalink.android.helper.DisplayHelper;
|
||||
@@ -81,7 +85,7 @@ public class MenuFragment extends OrderBaseFragment {
|
||||
menuProductRecyclerAdapter = new MenuProductRecyclerAdapter(menuProductList, new RecyclerItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
|
||||
showBottomsheetDialog(menuProductList.get(position));
|
||||
}
|
||||
});
|
||||
menuProductRecyclerView.addItemDecoration(new GridSpacesItemDecoration(DisplayHelper.dpToPx(12)));
|
||||
@@ -118,6 +122,12 @@ public class MenuFragment extends OrderBaseFragment {
|
||||
menuProductRecyclerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void showBottomsheetDialog(MenuProductModel menuProductModel){
|
||||
ProductPropertiesBottomSheetDialog productPropertiesBottomSheetDialog = new ProductPropertiesBottomSheetDialog();
|
||||
productPropertiesBottomSheetDialog.setMenuProductModel(menuProductModel);
|
||||
productPropertiesBottomSheetDialog.show(getChildFragmentManager(), "dialog");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package ch.pizzalink.android.model.menu;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import ch.pizzalink.android.R;
|
||||
@@ -13,7 +14,7 @@ import ch.pizzalink.android.model.cart.CartProductOptionModel;
|
||||
* Created by cimenmus on 08/10/2017.
|
||||
*/
|
||||
|
||||
public class MenuProductModel {
|
||||
public class MenuProductModel implements Serializable {
|
||||
|
||||
@Expose @SerializedName("product_id") private String id;
|
||||
@Expose @SerializedName("thumb") private String imageURL;
|
||||
@@ -61,6 +62,21 @@ public class MenuProductModel {
|
||||
!description.equals(BaseActivity.currentActivity.getString(R.string.empty_description));
|
||||
}
|
||||
|
||||
public ProductOptionType getProductOptionType(){
|
||||
if(productOptionList == null || productOptionList.size() == 0)
|
||||
return ProductOptionType.NO_TYPE;
|
||||
else if(productOptionList.get(0).getType().toLowerCase().equals("radio"))
|
||||
return ProductOptionType.RADIO;
|
||||
else
|
||||
return ProductOptionType.CHECKBOX;
|
||||
}
|
||||
|
||||
public enum ProductOptionType{
|
||||
NO_TYPE,
|
||||
RADIO,
|
||||
CHECKBOX
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -3,13 +3,14 @@ package ch.pizzalink.android.model.menu;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 08/10/2017.
|
||||
*/
|
||||
|
||||
public class MenuProductOptionModel {
|
||||
public class MenuProductOptionModel implements Serializable {
|
||||
|
||||
@Expose @SerializedName("product_option_id")
|
||||
private String productOptionId;
|
||||
|
||||
@@ -3,13 +3,14 @@ package ch.pizzalink.android.model.menu;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 08/10/2017.
|
||||
*/
|
||||
|
||||
public class MenuProductOptionValueModel {
|
||||
public class MenuProductOptionValueModel implements Serializable{
|
||||
|
||||
@Expose @SerializedName("product_option_value_id") private String productOptionValueId;
|
||||
@Expose @SerializedName("option_value_id") private String optionValueId;
|
||||
@@ -17,6 +18,7 @@ public class MenuProductOptionValueModel {
|
||||
private String name;
|
||||
private String price;
|
||||
private String price_prefix;
|
||||
private boolean isSelected;
|
||||
|
||||
private void checkNull(){
|
||||
|
||||
@@ -92,4 +94,12 @@ public class MenuProductOptionValueModel {
|
||||
public void setPrice_prefix(String price_prefix) {
|
||||
this.price_prefix = price_prefix;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return isSelected;
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
isSelected = selected;
|
||||
}
|
||||
}
|
||||
|
||||
8
app/src/main/res/drawable/shadow.xml
Normal file
8
app/src/main/res/drawable/shadow.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#20000000"
|
||||
android:startColor="@android:color/transparent" />
|
||||
</shape>
|
||||
220
app/src/main/res/layout/layout_bottomsheet.xml
Normal file
220
app/src/main/res/layout/layout_bottomsheet.xml
Normal file
@@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productNameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:text="Pizza Formaggio"
|
||||
android:padding="16dp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productPriceTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:text="CHF 25.00"
|
||||
android:textSize="16sp"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/radioRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/checkboxRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ProductCountLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/increaseProductCountImageView"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_increase"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginEnd="4dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productCountTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/black"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/deccreaseProductCountImageView"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:padding="8dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_decrease"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/addToCartButtonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<View
|
||||
android:id="@+id/fakeShadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/shadow" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/productNameLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@+id/fakeShadow">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productNameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:text="Pizza Formaggio"
|
||||
android:padding="16dp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/productPriceTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:text="CHF 25.00"
|
||||
android:textSize="16sp"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@+id/productNameLayout"
|
||||
android:layout_above="@+id/addToCartButtonLayout">
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/addToCartButtonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
-->
|
||||
17
app/src/main/res/layout/row_checkbox_option.xml
Normal file
17
app/src/main/res/layout/row_checkbox_option.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:padding="12dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatCheckBox
|
||||
android:id="@+id/productOptionCheckBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:text="Klein"/>
|
||||
|
||||
</LinearLayout>
|
||||
17
app/src/main/res/layout/row_radio_option.xml
Normal file
17
app/src/main/res/layout/row_radio_option.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:padding="12dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
android:id="@+id/productOptionRadioButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Klein"
|
||||
android:clickable="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -112,6 +112,7 @@
|
||||
|
||||
<string name="chf">CHF</string>
|
||||
<string name="empty_description">..</string>
|
||||
<string name="add_to_cart">SEPETE EKLE</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user