Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
Your Cashier
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ahmad Abi Mulya
Your Cashier
Commits
943b2d76
Commit
943b2d76
authored
Aug 27, 2020
by
Ahmad Abi Mulya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cart layout
parent
c91ca33f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
20 deletions
+22
-20
PaymentActivity.java
...m/example/yourcashiertest/activities/PaymentActivity.java
+1
-1
activity_cart.xml
app/src/main/res/layout/activity_cart.xml
+7
-7
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+6
-7
cart_item.xml
app/src/main/res/layout/cart_item.xml
+8
-5
No files found.
app/src/main/java/com/example/yourcashiertest/activities/PaymentActivity.java
View file @
943b2d76
...
@@ -60,7 +60,7 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -60,7 +60,7 @@ public class PaymentActivity extends AppCompatActivity {
public
void
btnPay
(
View
view
)
{
public
void
btnPay
(
View
view
)
{
if
(
TextUtils
.
isEmpty
(
binding
.
etAmountPaid
.
getText
().
toString
())){
if
(
TextUtils
.
isEmpty
(
binding
.
etAmountPaid
.
getText
().
toString
())){
ViewUtil
.
showMessage
(
view
,
"
Amount paid not empty
"
);
ViewUtil
.
showMessage
(
view
,
"
Please input Amount Paid by Customer!
"
);
}
else
{
}
else
{
int
amountPaid
=
Integer
.
parseInt
(
binding
.
etAmountPaid
.
getText
().
toString
());
int
amountPaid
=
Integer
.
parseInt
(
binding
.
etAmountPaid
.
getText
().
toString
());
refund
=
amountPaid
-
amount
;
refund
=
amountPaid
-
amount
;
...
...
app/src/main/res/layout/activity_cart.xml
View file @
943b2d76
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<TextView
<TextView
android:id=
"@+id/cart"
android:id=
"@+id/cart"
android:layout_width=
"
134
dp"
android:layout_width=
"
50
dp"
android:layout_height=
"36dp"
android:layout_height=
"36dp"
android:gravity=
"top"
android:gravity=
"top"
android:text=
"@string/cart"
android:text=
"@string/cart"
...
@@ -64,21 +64,21 @@
...
@@ -64,21 +64,21 @@
<View
<View
android:id=
"@+id/amount"
android:id=
"@+id/amount"
android:layout_width=
"100dp"
android:layout_width=
"150dp"
android:layout_height=
"50dp"
android:layout_height=
"60dp"
android:layout_marginTop=
"72dp"
android:layout_marginEnd=
"20dp"
android:background=
"@drawable/rectangle_1"
android:background=
"@drawable/rectangle_1"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_marginTop=
"62dp"
android:layout_marginEnd=
"52dp"
app:layout_constraintStart_toEndOf=
"@+id/items"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
<TextView
android:id=
"@+id/tvTotalPrice"
android:id=
"@+id/tvTotalPrice"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"
20dp
"
android:layout_height=
"
wrap_content
"
android:gravity=
"top"
android:gravity=
"top"
android:textColor=
"#fff"
android:textColor=
"#fff"
android:textSize=
"20sp"
android:textAppearance=
"@style/some_id"
android:textAppearance=
"@style/some_id"
app:layout_constraintBottom_toBottomOf=
"@+id/amount"
app:layout_constraintBottom_toBottomOf=
"@+id/amount"
app:layout_constraintEnd_toEndOf=
"@+id/amount"
app:layout_constraintEnd_toEndOf=
"@+id/amount"
...
...
app/src/main/res/layout/activity_payment.xml
View file @
943b2d76
...
@@ -58,16 +58,17 @@
...
@@ -58,16 +58,17 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:layout_height=
"100dp"
android:paddingVertical=
"5dp"
>
android:paddingVertical=
"5dp"
>
<ImageView
<ImageView
android:id=
"@+id/iv_cash"
android:id=
"@+id/iv_cash"
android:layout_width=
"
20
0dp"
android:layout_width=
"
15
0dp"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_marginStart=
"4dp"
android:src=
"@drawable/ic_undraw_wallet"
android:src=
"@drawable/ic_undraw_wallet"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
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.466"
app:layout_constraintVertical_bias=
"1.0"
/>
tools:layout_editor_absoluteX=
"117dp"
/>
<CheckBox
<CheckBox
android:id=
"@+id/cbCash"
android:id=
"@+id/cbCash"
...
@@ -102,14 +103,12 @@
...
@@ -102,14 +103,12 @@
<ImageView
<ImageView
android:id=
"@+id/iv_card"
android:id=
"@+id/iv_card"
android:layout_width=
"
20
0dp"
android:layout_width=
"
15
0dp"
android:layout_height=
"0dp"
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_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintVertical_bias=
"0.466"
tools:layout_editor_absoluteX=
"117dp"
/>
<CheckBox
<CheckBox
android:id=
"@+id/cbCard"
android:id=
"@+id/cbCard"
...
...
app/src/main/res/layout/cart_item.xml
View file @
943b2d76
...
@@ -19,11 +19,12 @@
...
@@ -19,11 +19,12 @@
</data>
</data>
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:layout_margin=
"5dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
>
android:layout_height=
"
130dp
"
>
<!-- Burger Medium -->
<!-- Burger Medium -->
...
@@ -31,7 +32,8 @@
...
@@ -31,7 +32,8 @@
<ImageView
<ImageView
android:id=
"@+id/imageView"
android:id=
"@+id/imageView"
android:layout_width=
"107dp"
android:layout_width=
"107dp"
android:layout_height=
"110dp"
android:layout_height=
"match_parent"
android:layout_margin=
"5dp"
app:file=
"@{cartProduct.image}"
app:file=
"@{cartProduct.image}"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
@@ -61,6 +63,7 @@
...
@@ -61,6 +63,7 @@
android:id=
"@+id/some_id"
android:id=
"@+id/some_id"
android:layout_width=
"82dp"
android:layout_width=
"82dp"
android:layout_height=
"23dp"
android:layout_height=
"23dp"
android:layout_margin=
"5dp"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentTop=
"true"
android:gravity=
"top"
android:gravity=
"top"
...
@@ -75,7 +78,7 @@
...
@@ -75,7 +78,7 @@
<View
<View
android:id=
"@+id/v_add"
android:id=
"@+id/v_add"
android:layout_width=
"
78
dp"
android:layout_width=
"
90
dp"
android:layout_height=
"40dp"
android:layout_height=
"40dp"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentTop=
"true"
...
@@ -115,7 +118,7 @@
...
@@ -115,7 +118,7 @@
<TextView
<TextView
android:id=
"@+id/tv_qty"
android:id=
"@+id/tv_qty"
android:layout_width=
"
10dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{cartProduct.qty + ``}"
android:text=
"@{cartProduct.qty + ``}"
app:layout_constraintBottom_toBottomOf=
"@+id/v_add"
app:layout_constraintBottom_toBottomOf=
"@+id/v_add"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment