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
52f9d029
Commit
52f9d029
authored
Aug 28, 2020
by
Wahyu Wibowo
Browse files
Options
Browse Files
Download
Plain Diff
add forgot password
parents
a45fcaf4
4f6c5a74
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
211 additions
and
153 deletions
+211
-153
LoginActivity.java
...com/example/yourcashiertest/activities/LoginActivity.java
+25
-32
MainActivity.java
.../com/example/yourcashiertest/activities/MainActivity.java
+2
-2
PaymentActivity.java
...m/example/yourcashiertest/activities/PaymentActivity.java
+34
-30
PrefManager.java
...a/com/example/yourcashiertest/activities/PrefManager.java
+1
-1
RegisterActivity.java
.../example/yourcashiertest/activities/RegisterActivity.java
+16
-7
WelcomeActivity.java
...m/example/yourcashiertest/activities/WelcomeActivity.java
+4
-1
ic_undraw_credit_card.xml
app/src/main/res/drawable/ic_undraw_credit_card.xml
+17
-17
activity_cart.xml
app/src/main/res/layout/activity_cart.xml
+12
-13
activity_main.xml
app/src/main/res/layout/activity_main.xml
+12
-3
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+31
-41
cart_item.xml
app/src/main/res/layout/cart_item.xml
+8
-5
category_item.xml
app/src/main/res/layout/category_item.xml
+49
-0
colors.xml
app/src/main/res/values/colors.xml
+0
-1
No files found.
app/src/main/java/com/example/yourcashiertest/activities/LoginActivity.java
View file @
52f9d029
...
...
@@ -2,32 +2,21 @@ package com.example.yourcashiertest.activities;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.ViewModelProvider
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.Toast
;
import
com.example.yourcashiertest.R
;
import
com.example.yourcashiertest.databinding.ActivityLoginBinding
;
import
com.example.yourcashiertest.models.User
;
import
com.example.yourcashiertest.viewmodels.UserViewModel
;
import
com.google.android.material.button.MaterialButton
;
import
com.google.android.material.textfield.TextInputEditText
;
import
java.util.List
;
public
class
LoginActivity
extends
AppCompatActivity
{
ActivityLoginBinding
binding
;
public
static
final
String
DATA_LOGIN
=
"DATA_LOGIN"
;
public
static
Boolean
syarat
;
// SharedPreferences sharedPreferences;
// public static final String SESS_SYARAT = "syarat";
// public static final String my_shared = "session_status";
private
PrefManager
prefManager
;
UserViewModel
viewModel
;
...
...
@@ -36,11 +25,11 @@ public class LoginActivity extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
binding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
activity_login
);
// sharedPreferences = getSharedPreferences(my_shared, Context.MODE_PRIVATE);
// syarat = sharedPreferences.getBoolean(SESS_SYARAT, false);
prefManager
=
new
PrefManager
(
this
);
Log
.
d
(
"login1"
,
""
+
prefManager
.
isFirstLogin
());
if
(!
prefManager
.
isFirstLogin
())
{
launchMain
();
Log
.
d
(
"login2"
,
""
+
prefManager
.
isFirstLogin
());
checkSession
();
finish
();
}
...
...
@@ -56,23 +45,8 @@ public class LoginActivity extends AppCompatActivity {
}
else
{
binding
.
setLoading
(
true
);
viewModel
.
setListUser
();
checkLogin
();
}
});
}
private
void
checkLogin
()
{
viewModel
.
getListUser
().
observe
(
this
,
users
->
{
for
(
int
i
=
0
;
i
<
users
.
size
();
i
++){
if
(
users
.
get
(
i
).
getEmail
().
equals
(
binding
.
etUsername
.
getText
().
toString
())
&&
users
.
get
(
i
).
getPassword
().
equals
(
binding
.
etPassword
.
getText
().
toString
())){
binding
.
setLoading
(
false
);
startActivity
(
new
Intent
(
LoginActivity
.
this
,
MainActivity
.
class
)
.
putExtra
(
DATA_LOGIN
,
users
.
get
(
i
).
getFullName
()));
}
launchMain
();
}
// Toast.makeText(getApplication(), "Username or password wrong", Toast.LENGTH_LONG).show();
});
}
...
...
@@ -84,8 +58,27 @@ public class LoginActivity extends AppCompatActivity {
startActivity
(
new
Intent
(
LoginActivity
.
this
,
RegisterActivity
.
class
));
}
public
void
launchMain
()
{
viewModel
.
getListUser
().
observe
(
this
,
users
->
{
for
(
int
i
=
0
;
i
<
users
.
size
();
i
++){
if
(
binding
.
etUsername
.
getText
().
toString
().
equals
(
users
.
get
(
i
).
getEmail
())
&&
binding
.
etPassword
.
getText
().
toString
().
equals
(
users
.
get
(
i
).
getPassword
())){
prefManager
.
setFirstLogin
(
false
);
binding
.
setLoading
(
false
);
startActivity
(
new
Intent
(
LoginActivity
.
this
,
MainActivity
.
class
).
putExtra
(
DATA_LOGIN
,
users
.
get
(
i
).
getFullName
()).
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
).
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
));
finish
();
return
;
}
else
if
(!
binding
.
etUsername
.
getText
().
toString
().
equals
(
users
.
get
(
i
).
getEmail
())){
binding
.
etUsername
.
setError
(
"Email Not Found!"
);
}
else
if
(!
binding
.
etPassword
.
getText
().
toString
().
equals
(
users
.
get
(
i
).
getPassword
())){
binding
.
etPassword
.
setError
(
"Password Wrong!"
);
}
}
});
}
public
void
checkSession
(){
prefManager
.
setFirstLogin
(
false
);
startActivity
(
new
Intent
(
LoginActivity
.
this
,
MainActivity
.
class
));
startActivity
(
new
Intent
(
LoginActivity
.
this
,
MainActivity
.
class
)
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
).
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
)
);
finish
();
}
}
\ No newline at end of file
app/src/main/java/com/example/yourcashiertest/activities/MainActivity.java
View file @
52f9d029
...
...
@@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity;
import
androidx.databinding.DataBindingUtil
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.ViewModelProvider
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
android.Manifest
;
...
...
@@ -13,7 +14,6 @@ import android.content.SharedPreferences;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.util.Log
;
import
android.widget.PopupMenu
;
import
android.widget.Toast
;
...
...
@@ -25,7 +25,6 @@ import com.example.yourcashiertest.entities.Product;
import
com.example.yourcashiertest.viewmodels.CartViewModel
;
import
com.example.yourcashiertest.viewmodels.ProductViewModel
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -100,6 +99,7 @@ public class MainActivity extends AppCompatActivity {
popupMenu
.
show
();
});
binding
.
rvCategory
.
setLayoutManager
(
new
LinearLayoutManager
(
MainActivity
.
this
,
LinearLayoutManager
.
HORIZONTAL
,
false
));
binding
.
rvProducts
.
setAdapter
(
adapter
);
viewModel
=
new
ViewModelProvider
(
this
).
get
(
ProductViewModel
.
class
);
viewModel
.
getProducts
().
observe
(
this
,
adapter:
:
setProducts
);
...
...
app/src/main/java/com/example/yourcashiertest/activities/PaymentActivity.java
View file @
52f9d029
...
...
@@ -13,6 +13,9 @@ import android.os.Bundle;
import
android.text.TextUtils
;
import
android.view.MotionEvent
;
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.databinding.ActivityPaymentBinding
;
...
...
@@ -40,15 +43,16 @@ public class PaymentActivity extends AppCompatActivity {
amount
=
getIntent
().
getIntExtra
(
CartActivity
.
PRICE
,
0
);
binding
.
setAmount
(
Convert
.
changeToCurrency
(
amount
));
binding
.
cvCash
.
setOnTouchListener
((
view
,
event
)
->
{
changeCvColor
(
event
,
binding
.
cvCash
);
return
true
;
});
// binding.cbCash.setOnTouchListener((view, event) -> {
// changeCvColor(event, binding.cvCash);
// return true;
// });
//
// binding.cbCard.setOnTouchListener((view, event) -> {
// changeCvColor(event, binding.cvCard);
// return true;
// });
binding
.
cvCard
.
setOnTouchListener
((
view
,
event
)
->
{
changeCvColor
(
event
,
binding
.
cvCard
);
return
true
;
});
...
...
@@ -56,7 +60,7 @@ public class PaymentActivity extends AppCompatActivity {
public
void
btnPay
(
View
view
)
{
if
(
TextUtils
.
isEmpty
(
binding
.
etAmountPaid
.
getText
().
toString
())){
ViewUtil
.
showMessage
(
view
,
"
Amount paid not empty
"
);
ViewUtil
.
showMessage
(
view
,
"
Please input Amount Paid by Customer!
"
);
}
else
{
int
amountPaid
=
Integer
.
parseInt
(
binding
.
etAmountPaid
.
getText
().
toString
());
refund
=
amountPaid
-
amount
;
...
...
@@ -67,27 +71,27 @@ public class PaymentActivity extends AppCompatActivity {
}
public
void
changeCvColor
(
MotionEvent
event
,
CardView
cv
){
if
(
change
)
{
change
=
false
;
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
cv
.
setCardBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
colorPrimary
));
break
;
case
MotionEvent
.
ACTION_UP
:
cv
.
setCardBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
white
));
}
}
else
{
change
=
true
;
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
cv
.
setCardBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
white
));
break
;
case
MotionEvent
.
ACTION_UP
:
cv
.
setCardBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
colorPrimary
));
}
}
}
//
public void changeCvColor(MotionEvent event, CardView cv){
//
if (change) {
//
change = false;
//
switch (event.getAction()) {
//
case MotionEvent.ACTION_DOWN:
// cv.setCardBackgroundColor(getResources().getColor(R.color.choose_payment
));
//
break;
//
case MotionEvent.ACTION_UP:
//
cv.setCardBackgroundColor(getResources().getColor(R.color.white));
//
}
//
} else {
//
change = true;
//
switch (event.getAction()) {
//
case MotionEvent.ACTION_DOWN:
//
cv.setCardBackgroundColor(getResources().getColor(R.color.white));
//
break;
//
case MotionEvent.ACTION_UP:
// cv.setCardBackgroundColor(getResources().getColor(R.color.choose_payment
));
//
}
//
}
//
}
@Override
protected
void
onDestroy
()
{
...
...
app/src/main/java/com/example/yourcashiertest/activities/PrefManager.java
View file @
52f9d029
...
...
@@ -12,7 +12,7 @@ public class PrefManager {
int
PRIVATE_MODE
=
0
;
// Shared preferences file name
private
static
final
String
PREF_NAME
=
"pref
erences
"
;
private
static
final
String
PREF_NAME
=
"pref
Welcome
"
;
private
static
final
String
IS_FIRST_WELCOME
=
"IsFirstWelcome"
;
private
static
final
String
IS_FIRST_LOGIN
=
"IsFirstLogin"
;
...
...
app/src/main/java/com/example/yourcashiertest/activities/RegisterActivity.java
View file @
52f9d029
...
...
@@ -35,6 +35,14 @@ public class RegisterActivity extends AppCompatActivity {
binding
.
btnRegister
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
binding
.
etUsername
.
getText
().
toString
().
length
()
==
0
||
binding
.
etPassword
.
getText
().
toString
().
length
()
==
0
||
binding
.
etEmail
.
getText
().
toString
().
length
()
==
0
||
binding
.
etPhoneNumber
.
getText
().
toString
().
length
()
==
0
){
Toast
.
makeText
(
getApplicationContext
(),
"Please input All Required Data"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(!
binding
.
etPassword
.
getText
().
toString
().
matches
(
"[A-Za-z0-9]+"
)){
binding
.
etPassword
.
setError
(
"Passwords can only contain Alphanumeric"
);
}
else
if
(
binding
.
etPassword
.
getText
().
toString
().
length
()
<
8
)
{
binding
.
etPassword
.
setError
(
"Password length cannot be less than 8 characters"
);
}
else
{
user
.
setEmail
(
binding
.
etEmail
.
getText
().
toString
());
user
.
setFullName
(
binding
.
etUsername
.
getText
().
toString
());
user
.
setPassword
(
binding
.
etPassword
.
getText
().
toString
());
...
...
@@ -43,6 +51,7 @@ public class RegisterActivity extends AppCompatActivity {
Toast
.
makeText
(
getApplicationContext
(),
"Register berhasil"
,
Toast
.
LENGTH_LONG
).
show
();
startActivity
(
new
Intent
(
getApplicationContext
(),
LoginActivity
.
class
));
}
}
});
}
...
...
app/src/main/java/com/example/yourcashiertest/activities/WelcomeActivity.java
View file @
52f9d029
...
...
@@ -6,6 +6,7 @@ import android.graphics.Color;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.text.Html
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -36,11 +37,13 @@ public class WelcomeActivity extends AppCompatActivity {
// mengecek lauch activity - sebelum memanggil setContentView()
prefManager
=
new
PrefManager
(
this
);
Log
.
d
(
"welcome1"
,
""
+
prefManager
.
isFirstWelcome
());
if
(!
prefManager
.
isFirstWelcome
())
{
Log
.
d
(
"welcome2"
,
""
+
prefManager
.
isFirstWelcome
());
launchHomeScreen
();
finish
();
}
Log
.
d
(
"welcome3"
,
""
+
prefManager
.
isFirstWelcome
());
// membuat transparan notifikasi
if
(
Build
.
VERSION
.
SDK_INT
>=
21
)
{
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
...
...
app/src/main/res/drawable/ic_undraw_credit_card.xml
View file @
52f9d029
...
...
@@ -2,26 +2,26 @@
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=
"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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
E0A24
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"#
40e0d
0"
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=
"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"
/>
...
...
app/src/main/res/layout/activity_cart.xml
View file @
52f9d029
...
...
@@ -39,7 +39,7 @@
<TextView
android:id=
"@+id/cart"
android:layout_width=
"
134
dp"
android:layout_width=
"
50
dp"
android:layout_height=
"36dp"
android:gravity=
"top"
android:text=
"@string/cart"
...
...
@@ -53,31 +53,30 @@
android:id=
"@+id/items"
android:layout_width=
"60dp"
android:layout_height=
"21dp"
android:layout_margin
End=
"5
dp"
android:layout_margin
Start=
"14
dp"
android:gravity=
"top"
app:layout_constraintBottom_toBottomOf=
"@+id/cart"
app:layout_constraintStart_toEndOf=
"@+id/cart"
app:layout_constraintEnd_toStartOf=
"@+id/amount"
app:layout_constraintTop_toTopOf=
"@+id/cart"
app:layout_constraintVertical_bias=
"0.466"
/>
app:layout_constraintBottom_toTopOf=
"@id/rvCartList"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/cart"
app:layout_constraintVertical_bias=
"0.375"
/>
<View
android:id=
"@+id/amount"
android:layout_width=
"100dp"
android:layout_height=
"50dp"
android:layout_width=
"150dp"
android:layout_height=
"60dp"
android:layout_marginTop=
"72dp"
android:layout_marginEnd=
"20dp"
android:background=
"@drawable/rectangle_1"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_marginTop=
"62dp"
android:layout_marginEnd=
"52dp"
app:layout_constraintStart_toEndOf=
"@+id/items"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tvTotalPrice"
android:layout_width=
"wrap_content"
android:layout_height=
"
20dp
"
android:layout_height=
"
wrap_content
"
android:gravity=
"top"
android:textColor=
"#fff"
android:textSize=
"20sp"
android:textAppearance=
"@style/some_id"
app:layout_constraintBottom_toBottomOf=
"@+id/amount"
app:layout_constraintEnd_toEndOf=
"@+id/amount"
...
...
app/src/main/res/layout/activity_main.xml
View file @
52f9d029
...
...
@@ -24,7 +24,7 @@
<View
android:id=
"@+id/rectangle_4"
android:layout_width=
"match_parent"
android:layout_height=
"
20
0dp"
android:layout_height=
"
15
0dp"
android:background=
"@drawable/rectangle_4"
app:layout_constraintBottom_toTopOf=
"@id/rvProducts"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
@@ -113,13 +113,22 @@
android:imeOptions=
"actionSearch"
android:inputType=
"textCapWords"
android:textSize=
"@dimen/text_default"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvCategory"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
tools:listitem=
"@layout/category_item"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/rectangle_4"
app:layout_constraintBottom_toTopOf=
"@id/rvProducts"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvProducts"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginVertical=
"15dp"
app:layout_constraintTop_toBottomOf=
"@id/r
ectangle_4
"
app:layout_constraintTop_toBottomOf=
"@id/r
vCategory
"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
app/src/main/res/layout/activity_payment.xml
View file @
52f9d029
...
...
@@ -44,7 +44,6 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tvPayment"
app:layout_constraintVertical_bias=
"0.0"
/>
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvCash"
android:layout_width=
"match_parent"
...
...
@@ -57,37 +56,33 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"100dp"
android:paddingVertical=
"5dp"
>
<ImageView
android:id=
"@+id/iv_cash"
android:layout_width=
"200dp"
android:layout_height=
"wrap_content"
android:layout_width=
"150dp"
android:layout_height=
"0dp"
android:layout_marginStart=
"4dp"
android:src=
"@drawable/ic_undraw_wallet"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"
0.8
"
/>
app:layout_constraintVertical_bias=
"
1.0
"
/>
<TextView
android:id=
"@+id/cash"
android:layout_width=
"138dp"
android:layout_height=
"33dp"
android:gravity=
"center"
android:text=
"@string/cash"
android:textAppearance=
"@style/cash"
app:layout_constraintBottom_toBottomOf=
"parent"
<CheckBox
android:id=
"@+id/cbCash"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"20dp"
android:buttonTint=
"@color/black"
android:text=
"Cash"
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_constraint
Vertical_bias=
"0.507"
/>
app:layout_constraint
Bottom_toBottomOf=
"parent"
/>
>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
...
...
@@ -103,33 +98,28 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:paddingVertical=
"5dp"
>
<ImageView
android:id=
"@+id/iv_card"
android:layout_width=
"
20
0dp"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
15
0dp"
android:layout_height=
"
0dp
"
android:src=
"@drawable/ic_undraw_credit_card"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.8"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/card"
android:layout_width=
"138dp"
android:layout_height=
"33dp"
android:gravity=
"center"
android:text=
"@string/card"
android:textAppearance=
"@style/cash"
app:layout_constraintBottom_toBottomOf=
"parent"
<CheckBox
android:id=
"@+id/cbCard"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"20dp"
android:buttonTint=
"@color/black"
android:text=
"Card"
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_constraint
Vertical_bias=
"0.507"
/>
app:layout_constraint
Bottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
@@ -140,7 +130,7 @@
android:layout_width=
"100dp"
android:layout_height=
"30dp"
android:layout_marginTop=
"208dp"
android:layout_marginBottom=
"
9
0dp"
android:layout_marginBottom=
"
7
0dp"
android:gravity=
"start"
android:text=
"Amount paid"
app:layout_constraintBottom_toTopOf=
"@id/etAmountPaid"
...
...
app/src/main/res/layout/cart_item.xml
View file @
52f9d029
...
...
@@ -19,11 +19,12 @@
</data>
<com.google.android.material.card.MaterialCardView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:layout_margin=
"5dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
>
android:layout_height=
"
130dp
"
>
<!-- Burger Medium -->
...
...
@@ -31,7 +32,8 @@
<ImageView
android:id=
"@+id/imageView"
android:layout_width=
"107dp"
android:layout_height=
"110dp"
android:layout_height=
"match_parent"
android:layout_margin=
"5dp"
app:file=
"@{cartProduct.image}"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
@@ -61,6 +63,7 @@
android:id=
"@+id/some_id"
android:layout_width=
"82dp"
android:layout_height=
"23dp"
android:layout_margin=
"5dp"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:gravity=
"top"
...
...
@@ -75,7 +78,7 @@
<View
android:id=
"@+id/v_add"
android:layout_width=
"
78
dp"
android:layout_width=
"
90
dp"
android:layout_height=
"40dp"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
...
...
@@ -115,7 +118,7 @@
<TextView
android:id=
"@+id/tv_qty"
android:layout_width=
"
10dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:text=
"@{cartProduct.qty + ``}"
app:layout_constraintBottom_toBottomOf=
"@+id/v_add"
...
...
app/src/main/res/layout/category_item.xml
0 → 100644
View file @
52f9d029
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<data>
<variable
name=
"category"
type=
"String"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height=
"wrap_content"
android:layout_width=
"wrap_content"
android:paddingVertical=
"10dp"
android:layout_marginHorizontal=
"3dp"
>
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvCategory"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/colorPrimaryDark"
android:clickable=
"true"
android:focusable=
"true"
android:checkable=
"true"
app:cardCornerRadius=
"10dp"
android:clipToPadding=
"true"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingHorizontal=
"20dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Example"
android:textStyle=
"bold"
android:textSize=
"20sp"
android:textColor=
"#fff"
tools:text=
"elizabeth"
android:layout_centerInParent=
"true"
/>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
app/src/main/res/values/colors.xml
View file @
52f9d029
...
...
@@ -12,7 +12,6 @@
<color
name=
"color_white"
>
#fff
</color>
<color
name=
"color_grey"
>
#fff
</color>
<color
name=
"blue"
>
#2196F3
</color>
<!-- dots inactive colors -->
<color
name=
"dot_dark_screen1"
>
#FFFFF0
</color>
<color
name=
"dot_dark_screen2"
>
#FFFFF0
</color>
...
...
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