coupod code area updatef

This commit is contained in:
2019-02-06 23:43:02 +03:00
parent ec2b85adaa
commit 40b1dfaad7
4 changed files with 231 additions and 11 deletions

32
.idea/assetWizardSettings.xml generated Normal file
View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WizardSettings">
<option name="children">
<map>
<entry key="vectorWizard">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="vectorAssetStep">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="assetSourceType" value="FILE" />
<entry key="outputName" value="ic_coupon" />
<entry key="sourceFile" value="$USER_HOME$/Downloads/coupon.svg" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</component>
</project>

View File

@@ -6,6 +6,7 @@ import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import com.google.android.gms.common.api.Api;
@@ -44,7 +45,7 @@ import retrofit2.Response;
public class PaymentMethodFragment extends CreateOrderBaseFragment {
@BindView(R.id.paymentMethodsRecyclerView) RecyclerView paymentMethodsRecyclerView;
@BindView(R.id.couponCodePizzalinkEditText) AppEditText couponCodeAppEditText;
@BindView(R.id.couponCodeEditText) EditText couponCodeEditText;
@BindString(R.string.app_name) String appName;
@BindString(R.string.alert_choose_payment_method) String choosePaymentMethodText;
@@ -95,13 +96,13 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
break;
}
if(couponCodeAppEditText.isEmpty()){
if(couponCodeEditText.getText().toString().isEmpty()){
SessionHelper.clearSelectedCoupon();
createOrderActivity.setSelectedPaymentMethod(selectedPaymentMethod);
createOrderActivity.onNextClicked(FRAGMENT_NAME);
}
else {
createOrderActivity.setCouponCode(couponCodeAppEditText.getText());
createOrderActivity.setCouponCode(couponCodeEditText.getText().toString());
checkCoupon();
}
@@ -114,7 +115,7 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
private void initViews(){
CreateOrderActivity createOrderActivity = (CreateOrderActivity) BaseActivity.currentActivity;
if(createOrderActivity.getCouponCode() != null){
couponCodeAppEditText.setText(createOrderActivity.getCouponCode());
couponCodeEditText.setText(createOrderActivity.getCouponCode());
}
initRecyclerView();
}
@@ -237,7 +238,7 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
Call<ResponseObject<CheckCouponModel>> call =
ApiService.apiInterface.checkCoupon(
"/" + SessionHelper.getSelectedStore().getStoreName() + ApiEndPoints.API_CHECK_COUPON + SessionHelper.getCustomerToken().getToken(),
couponCodeAppEditText.getText());
couponCodeEditText.getText().toString());
call.enqueue(new Callback<ResponseObject<CheckCouponModel>>() {
@Override
public void onResponse(Call<ResponseObject<CheckCouponModel>> call, Response<ResponseObject<CheckCouponModel>> response) {

View File

@@ -0,0 +1,6 @@
<vector android:height="24dp" android:viewportHeight="512"
android:viewportWidth="512" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M407,301c-8.276,0 -15,6.724 -15,15s6.724,15 15,15s15,-6.724 15,-15S415.276,301 407,301z"/>
<path android:fillColor="#FF000000" android:pathData="M497,91H151.245v45c0,8.291 -6.709,15 -15,15s-15,-6.709 -15,-15V91H15c-8.291,0 -15,6.709 -15,15v90c0,8.291 6.709,15 15,15c24.814,0 45,20.186 45,45c0,24.814 -20.186,45 -45,45c-8.291,0 -15,6.709 -15,15v90c0,8.291 6.709,15 15,15h105v-45c0,-8.291 6.709,-15 15,-15s15,6.709 15,15v45h347c8.291,0 15,-6.709 15,-15V106C512,97.709 505.291,91 497,91zM150,316c0,8.291 -6.709,15 -15,15s-15,-6.709 -15,-15v-30c0,-8.291 6.709,-15 15,-15s15,6.709 15,15V316zM150,226c0,8.291 -6.709,15 -15,15s-15,-6.709 -15,-15v-30c0,-8.291 6.709,-15 15,-15s15,6.709 15,15V226zM242,196c0,-24.814 20.186,-45 45,-45c24.814,0 45,20.186 45,45c0,24.814 -20.186,45 -45,45C262.186,241 242,220.814 242,196zM278.68,358.48c-6.899,-4.6 -8.76,-13.901 -4.16,-20.801l120,-180c4.585,-6.899 13.887,-8.745 20.801,-4.16c6.899,4.6 8.76,13.901 4.16,20.801l-120,180C294.956,361.117 285.689,363.126 278.68,358.48zM407,361c-24.814,0 -45,-20.186 -45,-45c0,-24.814 20.186,-45 45,-45c24.814,0 45,20.186 45,45C452,340.814 431.814,361 407,361z"/>
<path android:fillColor="#FF000000" android:pathData="M287,181c-8.276,0 -15,6.724 -15,15s6.724,15 15,15s15,-6.724 15,-15S295.276,181 287,181z"/>
</vector>

View File

@@ -15,13 +15,88 @@
android:orientation="vertical"
android:layout_above="@+id/ordersBottomLayout">
<ch.pizzapp.android.view.AppEditText
android:id="@+id/couponCodePizzalinkEditText"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/couponCodeLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/red"
android:layout_marginTop="12dp"
android:layout_marginBottom="4dp"
fontPath="fonts/Quicksand-Bold.ttf"
android:text="@string/coupon_code"/>
<ImageView
android:id="@+id/couponCodeImageView"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_coupon"
android:layout_gravity="center_vertical"
android:layout_below="@+id/couponCodeLabelTextView"
android:layout_alignBottom="@+id/couponCodeEditTextLayout"/>
<RelativeLayout
android:id="@+id/couponCodeEditTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/couponCodeLabelTextView"
android:layout_toRightOf="@+id/couponCodeImageView"
android:layout_toEndOf="@+id/couponCodeImageView"
android:layout_alignRight="@+id/couponCodeLabelTextView"
android:layout_alignEnd="@+id/couponCodeLabelTextView">
<EditText
android:id="@+id/couponCodeEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/navy"
android:textSize="16sp"
fontPath="fonts/Quicksand-Bold.ttf"
android:textColorHint="@color/white"
android:layout_centerVertical="true"
android:background="@android:color/transparent"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"/>
<View
android:id="@+id/bottomLineLayout"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/navy"
android:layout_marginTop="2dp"
android:layout_below="@+id/couponCodeEditText"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:edittextTheme="navy"
app:inputType="name"
app:hint="@string/coupon_code"/>
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp">
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
@@ -47,4 +122,110 @@
<include layout="@layout/layout_orders_bottom"/>
</RelativeLayout>
</RelativeLayout>
<!--
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:ignore="MissingPrefix">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_above="@+id/ordersBottomLayout">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/red"
android:layout_marginTop="12dp"
android:layout_marginBottom="4dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
fontPath="fonts/Quicksand-Bold.ttf"
android:text="@string/coupon_code"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">
<ImageView
android:layout_width="28dp"
android:layout_height="28dp"
android:src="@drawable/ic_coupon"
android:layout_gravity="center_vertical"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/couponCodeEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/navy"
android:text="Test"
android:textSize="16sp"
fontPath="fonts/Quicksand-Bold.ttf"
android:textColorHint="@color/white"
android:layout_centerVertical="true"
android:background="@android:color/transparent"
/>
</RelativeLayout>
<View
android:id="@+id/bottomLineLayout"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/navy"
android:layout_marginTop="2dp"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fontPath="fonts/Quicksand-Bold.ttf"
android:textColor="@color/black"
android:text="@string/payment_method"
android:layout_marginTop="24dp"
android:layout_marginBottom="12dp"
android:paddingLeft="20dp"
android:paddingStart="20dp"
android:paddingRight="20dp"
android:paddingEnd="20dp"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/paymentMethodsRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" />
</LinearLayout>
<include layout="@layout/layout_orders_bottom"/>
</RelativeLayout>
-->