Commit 0c509091 authored by Ahmad Abi Mulya's avatar Ahmad Abi Mulya

fix payment layout

parent d14de730
...@@ -12,6 +12,9 @@ import android.os.Bundle; ...@@ -12,6 +12,9 @@ import android.os.Bundle;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
import com.example.yourcashiertest.R; import com.example.yourcashiertest.R;
import com.example.yourcashiertest.databinding.ActivityPaymentBinding; import com.example.yourcashiertest.databinding.ActivityPaymentBinding;
...@@ -38,15 +41,16 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -38,15 +41,16 @@ public class PaymentActivity extends AppCompatActivity {
amount = getIntent().getIntExtra(CartActivity.PRICE, 0); amount = getIntent().getIntExtra(CartActivity.PRICE, 0);
binding.setAmount(Convert.changeToCurrency(amount)); binding.setAmount(Convert.changeToCurrency(amount));
binding.cvCash.setOnTouchListener((view, event) -> { // binding.cbCash.setOnTouchListener((view, event) -> {
changeCvColor(event, binding.cvCash); // changeCvColor(event, binding.cvCash);
return true; // return true;
}); // });
//
// binding.cbCard.setOnTouchListener((view, event) -> {
// changeCvColor(event, binding.cvCard);
// return true;
// });
binding.cvCard.setOnTouchListener((view, event) -> {
changeCvColor(event, binding.cvCard);
return true;
});
} }
...@@ -59,27 +63,27 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -59,27 +63,27 @@ public class PaymentActivity extends AppCompatActivity {
} }
public void changeCvColor(MotionEvent event, CardView cv){ // public void changeCvColor(MotionEvent event, CardView cv){
if (change) { // if (change) {
change = false; // change = false;
switch (event.getAction()) { // switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: // case MotionEvent.ACTION_DOWN:
cv.setCardBackgroundColor(getResources().getColor(R.color.colorPrimary)); // cv.setCardBackgroundColor(getResources().getColor(R.color.choose_payment));
break; // break;
case MotionEvent.ACTION_UP: // case MotionEvent.ACTION_UP:
cv.setCardBackgroundColor(getResources().getColor(R.color.white)); // cv.setCardBackgroundColor(getResources().getColor(R.color.white));
} // }
} else { // } else {
change = true; // change = true;
switch (event.getAction()) { // switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: // case MotionEvent.ACTION_DOWN:
cv.setCardBackgroundColor(getResources().getColor(R.color.white)); // cv.setCardBackgroundColor(getResources().getColor(R.color.white));
break; // break;
case MotionEvent.ACTION_UP: // case MotionEvent.ACTION_UP:
cv.setCardBackgroundColor(getResources().getColor(R.color.colorPrimary)); // cv.setCardBackgroundColor(getResources().getColor(R.color.choose_payment));
} // }
} // }
} // }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
......
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
android:viewportWidth="567.1704" android:width="561dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:viewportWidth="567.1704" android:width="561dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3f3d56" android:pathData="M13.551,186.032l475.239,-138.465l12.588,43.204l-475.239,138.465z"/> <path android:fillColor="#3f3d56" android:pathData="M13.551,186.032l475.239,-138.465l12.588,43.204l-475.239,138.465z"/>
<path android:fillColor="#3f3d56" android:pathData="M70.329,384.481 L0.283,144.068a7,7 0,0 1,4.763 -8.679L468.764,0.281a7.006,7.006 0,0 1,8.679 4.762l62.056,212.989 -1.92,0.56L475.522,5.603a5.009,5.009 0,0 0,-6.199 -3.402L5.605,137.309a5,5 0,0 0,-3.402 6.199l70.047,240.413Z"/> <path android:fillColor="#3f3d56" android:pathData="M70.329,384.481 L0.283,144.068a7,7 0,0 1,4.763 -8.679L468.764,0.281a7.006,7.006 0,0 1,8.679 4.762l62.056,212.989 -1.92,0.56L475.522,5.603a5.009,5.009 0,0 0,-6.199 -3.402L5.605,137.309a5,5 0,0 0,-3.402 6.199l70.047,240.413Z"/>
<path android:fillColor="#E0A240" android:pathData="M436.862,219.022a6.512,6.512 0,0 1,-6.243 -4.683l-11.749,-40.323a6.507,6.507 0,0 1,4.422 -8.059l40.323,-11.749a6.507,6.507 0,0 1,8.059 4.423L483.423,198.955a6.507,6.507 0,0 1,-4.422 8.059l-40.323,11.749A6.479,6.479 0,0 1,436.862 219.022Z"/> <path android:fillColor="#40e0d0" android:pathData="M436.862,219.022a6.512,6.512 0,0 1,-6.243 -4.683l-11.749,-40.323a6.507,6.507 0,0 1,4.422 -8.059l40.323,-11.749a6.507,6.507 0,0 1,8.059 4.423L483.423,198.955a6.507,6.507 0,0 1,-4.422 8.059l-40.323,11.749A6.479,6.479 0,0 1,436.862 219.022Z"/>
<path android:fillColor="#E0A240" android:pathData="M69.246,144.812a11.691,11.691 0,0 0,-0.43 -1.22,12 12,0 0,0 -22.91,6.67 11.38,11.38 0,0 0,0.29 1.26,12.019 12.019,0 0,0 11.53,8.64 11.749,11.749 0,0 0,3.35 -0.48A12.013,12.013 0,0 0,69.246 144.812ZM60.516,157.762a10.013,10.013 0,0 1,-12.4 -6.8,11.435 11.435,0 0,1 -0.28,-1.26 9.997,9.997 0,0 1,19.04 -5.54,8.338 8.338,0 0,1 0.45,1.21A10.004,10.004 0,0 1,60.516 157.762Z"/> <path android:fillColor="#40e0d0" android:pathData="M69.246,144.812a11.691,11.691 0,0 0,-0.43 -1.22,12 12,0 0,0 -22.91,6.67 11.38,11.38 0,0 0,0.29 1.26,12.019 12.019,0 0,0 11.53,8.64 11.749,11.749 0,0 0,3.35 -0.48A12.013,12.013 0,0 0,69.246 144.812ZM60.516,157.762a10.013,10.013 0,0 1,-12.4 -6.8,11.435 11.435,0 0,1 -0.28,-1.26 9.997,9.997 0,0 1,19.04 -5.54,8.338 8.338,0 0,1 0.45,1.21A10.004,10.004 0,0 1,60.516 157.762Z"/>
<path android:fillColor="#E0A240" android:pathData="M39.814,153.382a11.002,11.002 0,0 1,4.208 -12.057,11 11,0 1,0 5.818,19.967A11.002,11.002 0,0 1,39.814 153.382Z"/> <path android:fillColor="#40e0d0" android:pathData="M39.814,153.382a11.002,11.002 0,0 1,4.208 -12.057,11 11,0 1,0 5.818,19.967A11.002,11.002 0,0 1,39.814 153.382Z"/>
<path android:fillColor="#ccc" android:pathData="M350.676,202.942a6.042,6.042 0,0 0,-7.45 -4.2L276.836,217.312l-7.15,2h44.9l7.15,-2 24.75,-6.92A6.049,6.049 0,0 0,350.676 202.942Z"/> <path android:fillColor="#ccc" android:pathData="M350.676,202.942a6.042,6.042 0,0 0,-7.45 -4.2L276.836,217.312l-7.15,2h44.9l7.15,-2 24.75,-6.92A6.049,6.049 0,0 0,350.676 202.942Z"/>
<path android:fillColor="#ccc" android:pathData="M303.706,189.072a6.045,6.045 0,0 0,-7.45 -4.19l-99.62,27.86a6.068,6.068 0,0 0,-4.37 6.57h25.79l7.16,-2 74.3,-20.78A6.055,6.055 0,0 0,303.706 189.072Z"/> <path android:fillColor="#ccc" android:pathData="M303.706,189.072a6.045,6.045 0,0 0,-7.45 -4.19l-99.62,27.86a6.068,6.068 0,0 0,-4.37 6.57h25.79l7.16,-2 74.3,-20.78A6.055,6.055 0,0 0,303.706 189.072Z"/>
<path android:fillColor="#3f3d56" android:pathData="M560.17,217.31L77.17,217.31a7.008,7.008 0,0 0,-7 7v286a7.008,7.008 0,0 0,7 7L560.17,517.31a7.008,7.008 0,0 0,7 -7v-286A7.008,7.008 0,0 0,560.17 217.31ZM565.17,510.31a5.002,5.002 0,0 1,-5 5L77.17,515.31a5.002,5.002 0,0 1,-5 -5v-286a5.002,5.002 0,0 1,5 -5L560.17,219.31a5.002,5.002 0,0 1,5 5Z"/> <path android:fillColor="#3f3d56" android:pathData="M560.17,217.31L77.17,217.31a7.008,7.008 0,0 0,-7 7v286a7.008,7.008 0,0 0,7 7L560.17,517.31a7.008,7.008 0,0 0,7 -7v-286A7.008,7.008 0,0 0,560.17 217.31ZM565.17,510.31a5.002,5.002 0,0 1,-5 5L77.17,515.31a5.002,5.002 0,0 1,-5 -5v-286a5.002,5.002 0,0 1,5 -5L560.17,219.31a5.002,5.002 0,0 1,5 5Z"/>
<path android:fillColor="#E0A240" android:pathData="M124.166,256.312a12,12 0,1 1,12 -12A12.014,12.014 0,0 1,124.166 256.312ZM124.166,234.312a10,10 0,1 0,10 10A10.011,10.011 0,0 0,124.166 234.312Z"/> <path android:fillColor="#40e0d0" android:pathData="M124.166,256.312a12,12 0,1 1,12 -12A12.014,12.014 0,0 1,124.166 256.312ZM124.166,234.312a10,10 0,1 0,10 10A10.011,10.011 0,0 0,124.166 234.312Z"/>
<path android:fillColor="#E0A240" android:pathData="M105.514,244.312a11.002,11.002 0,0 1,7.413 -10.399,11 11,0 1,0 0,20.797A11.002,11.002 0,0 1,105.514 244.312Z"/> <path android:fillColor="#40e0d0" android:pathData="M105.514,244.312a11.002,11.002 0,0 1,7.413 -10.399,11 11,0 1,0 0,20.797A11.002,11.002 0,0 1,105.514 244.312Z"/>
<path android:fillColor="#E0A240" android:pathData="M172.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,172.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M172.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,172.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M196.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,196.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M196.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,196.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M220.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,220.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M220.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,220.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M257.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,257.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M257.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,257.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M281.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,281.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M281.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,281.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M305.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,305.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M305.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,305.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M342.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,342.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M342.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,342.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M366.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,366.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M366.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,366.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M390.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,390.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M390.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,390.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M427.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,427.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M427.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,427.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M451.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,451.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M451.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,451.81 386.09Z"/>
<path android:fillColor="#E0A240" android:pathData="M475.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,475.81 386.09Z"/> <path android:fillColor="#40e0d0" android:pathData="M475.81,386.09a9.01,9.01 0,0 1,-9 -9v-27a9,9 0,0 1,18 0v27A9.01,9.01 0,0 1,475.81 386.09Z"/>
<path android:fillColor="#e6e6e6" android:pathData="M233.828,486.257L104.388,486.257a6.047,6.047 0,1 1,0 -12.095L233.828,474.162a6.047,6.047 0,1 1,0 12.095Z"/> <path android:fillColor="#e6e6e6" android:pathData="M233.828,486.257L104.388,486.257a6.047,6.047 0,1 1,0 -12.095L233.828,474.162a6.047,6.047 0,1 1,0 12.095Z"/>
<path android:fillColor="#e6e6e6" android:pathData="M192.328,460.257L145.888,460.257a6.047,6.047 0,1 1,0 -12.095h46.44a6.047,6.047 0,1 1,0 12.095Z"/> <path android:fillColor="#e6e6e6" android:pathData="M192.328,460.257L145.888,460.257a6.047,6.047 0,1 1,0 -12.095h46.44a6.047,6.047 0,1 1,0 12.095Z"/>
<path android:fillColor="#3f3d56" android:pathData="M71.81,277.09h493v2h-493z"/> <path android:fillColor="#3f3d56" android:pathData="M71.81,277.09h493v2h-493z"/>
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPayment" app:layout_constraintTop_toBottomOf="@id/tvPayment"
app:layout_constraintVertical_bias="0.0" /> app:layout_constraintVertical_bias="0.0" />
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/cvCash" android:id="@+id/cvCash"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -57,37 +56,32 @@ ...@@ -57,37 +56,32 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="100dp"
android:paddingVertical="5dp">
<ImageView <ImageView
android:id="@+id/iv_cash" android:id="@+id/iv_cash"
android:layout_width="200dp" android:layout_width="200dp"
android:layout_height="wrap_content" android:layout_height="0dp"
android:src="@drawable/ic_undraw_wallet" android:src="@drawable/ic_undraw_wallet"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.8" /> app:layout_constraintVertical_bias="0.466"
tools:layout_editor_absoluteX="117dp" />
<TextView <CheckBox
android:id="@+id/cash" android:id="@+id/cbCash"
android:layout_width="138dp" android:layout_width="wrap_content"
android:layout_height="33dp" android:layout_height="wrap_content"
android:gravity="center" android:layout_marginEnd="20dp"
android:text="@string/cash" android:buttonTint="@color/black"
android:textAppearance="@style/cash" android:text="Cash"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.324"
app:layout_constraintStart_toEndOf="@+id/iv_cash"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.507" /> app:layout_constraintBottom_toBottomOf="parent"/>
>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
...@@ -103,33 +97,30 @@ ...@@ -103,33 +97,30 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:paddingVertical="5dp">
<ImageView <ImageView
android:id="@+id/iv_card" android:id="@+id/iv_card"
android:layout_width="200dp" android:layout_width="200dp"
android:layout_height="wrap_content" android:layout_height="0dp"
android:src="@drawable/ic_undraw_credit_card" android:src="@drawable/ic_undraw_credit_card"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.8" /> app:layout_constraintVertical_bias="0.466"
tools:layout_editor_absoluteX="117dp" />
<TextView <CheckBox
android:id="@+id/card" android:id="@+id/cbCard"
android:layout_width="138dp" android:layout_width="wrap_content"
android:layout_height="33dp" android:layout_height="wrap_content"
android:gravity="center" android:layout_marginEnd="20dp"
android:text="@string/card" android:buttonTint="@color/black"
android:textAppearance="@style/cash" android:text="Card"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.324"
app:layout_constraintStart_toEndOf="@+id/iv_card"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.507" /> app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
...@@ -140,7 +131,7 @@ ...@@ -140,7 +131,7 @@
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginTop="208dp" android:layout_marginTop="208dp"
android:layout_marginBottom="90dp" android:layout_marginBottom="70dp"
android:gravity="start" android:gravity="start"
android:text="Amount paid" android:text="Amount paid"
app:layout_constraintBottom_toTopOf="@id/etAmountPaid" app:layout_constraintBottom_toTopOf="@id/etAmountPaid"
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<color name="color_white">#fff</color> <color name="color_white">#fff</color>
<color name="color_grey">#fff</color> <color name="color_grey">#fff</color>
<color name="blue">#2196F3</color> <color name="blue">#2196F3</color>
<!-- dots inactive colors --> <!-- dots inactive colors -->
<color name="dot_dark_screen1">#FFFFF0</color> <color name="dot_dark_screen1">#FFFFF0</color>
<color name="dot_dark_screen2">#FFFFF0</color> <color name="dot_dark_screen2">#FFFFF0</color>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment