Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
meser
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
Muhammad Suryono
meser
Commits
ba5b42cb
Commit
ba5b42cb
authored
Sep 04, 2020
by
fauzi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.mdd.co.id:44195/muhammadsuryono/meser
into dev
parents
1811b1dc
c2255c83
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
910 additions
and
277 deletions
+910
-277
build.gradle
app/build.gradle
+8
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-2
BottomSheets.java
app/src/main/java/com/yono/messeripos/BottomSheets.java
+23
-39
CartActivity.java
app/src/main/java/com/yono/messeripos/CartActivity.java
+0
-1
ForgotCode.java
app/src/main/java/com/yono/messeripos/ForgotCode.java
+40
-5
ForgotPassword.java
app/src/main/java/com/yono/messeripos/ForgotPassword.java
+97
-0
ForgotPasswordActivity.java
...main/java/com/yono/messeripos/ForgotPasswordActivity.java
+50
-2
LoginState.java
app/src/main/java/com/yono/messeripos/LoginState.java
+8
-10
MethodePayment.java
app/src/main/java/com/yono/messeripos/MethodePayment.java
+82
-2
PaymentActivity.java
app/src/main/java/com/yono/messeripos/PaymentActivity.java
+10
-3
RegisterState.java
app/src/main/java/com/yono/messeripos/RegisterState.java
+5
-9
ScannerNfc.java
app/src/main/java/com/yono/messeripos/ScannerNfc.java
+24
-2
TransactionDetail.java
app/src/main/java/com/yono/messeripos/TransactionDetail.java
+209
-1
UsersService.java
...in/java/com/yono/messeripos/api/service/UsersService.java
+3
-0
ForgotPasswordModels.java
...java/com/yono/messeripos/models/ForgotPasswordModels.java
+11
-0
Utils.java
app/src/main/java/com/yono/messeripos/utils/Utils.java
+24
-10
activity_forgot_password.xml
app/src/main/res/layout/activity_forgot_password.xml
+1
-1
activity_list_transaction.xml
app/src/main/res/layout/activity_list_transaction.xml
+5
-4
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+13
-14
alert_dialog.xml
app/src/main/res/layout/alert_dialog.xml
+1
-0
detail_transaction.xml
app/src/main/res/layout/detail_transaction.xml
+195
-0
forgot_new_password.xml
app/src/main/res/layout/forgot_new_password.xml
+53
-67
forgot_password_code.xml
app/src/main/res/layout/forgot_password_code.xml
+41
-99
item_checkout.xml
app/src/main/res/layout/item_checkout.xml
+4
-6
No files found.
app/build.gradle
View file @
ba5b42cb
...
@@ -63,4 +63,12 @@ dependencies {
...
@@ -63,4 +63,12 @@ dependencies {
implementation
'com.google.zxing:core:3.3.2'
implementation
'com.google.zxing:core:3.3.2'
implementation
'com.github.florent37:expansionpanel:1.2.4'
implementation
'com.github.florent37:expansionpanel:1.2.4'
implementation
(
'com.alimuzaffar.lib:pinentryedittext:1.3.10'
)
{
// Exclude is only needed if you already have
// any of the following as a dependency in your project.
exclude
group:
'com.android.support'
,
module:
'support-v4'
exclude
group:
'com.android.support'
,
module:
'appcompat-v7'
exclude
group:
'com.android.support'
,
module:
'support-v13'
}
}
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
ba5b42cb
...
@@ -23,8 +23,9 @@
...
@@ -23,8 +23,9 @@
<activity
android:name=
".MethodePayment"
/>
<activity
android:name=
".MethodePayment"
/>
<activity
android:name=
".ScannerNfc"
/>
<activity
android:name=
".ScannerNfc"
/>
<activity
android:name=
".TransactionDetail"
/>
<activity
android:name=
".TransactionDetail"
/>
<activity
android:name=
".ForgotPasswordActivity"
<activity
android:windowSoftInputMode=
"adjustResize"
></activity>
android:name=
".ForgotPasswordActivity"
android:windowSoftInputMode=
"adjustResize|stateHidden"
/>
<activity
android:name=
".RegisterActivity"
/>
<activity
android:name=
".RegisterActivity"
/>
<activity
android:name=
".TransactionActivity"
/>
<activity
android:name=
".TransactionActivity"
/>
<activity
<activity
...
...
app/src/main/java/com/yono/messeripos/BottomSheets.java
View file @
ba5b42cb
...
@@ -168,49 +168,33 @@ public class BottomSheets extends BottomSheetDialogFragment {
...
@@ -168,49 +168,33 @@ public class BottomSheets extends BottomSheetDialogFragment {
if
(
statusUpdatePayment
==
0
){
if
(
statusUpdatePayment
==
0
){
paymentsModels1
.
setOrderId
(
sharedPreferences
.
getString
(
ORDER_ID
,
""
));
paymentsModels1
.
setOrderId
(
sharedPreferences
.
getString
(
ORDER_ID
,
""
));
paymentService
.
postFromCart
(
paymentsModels1
).
enqueue
(
new
Callback
<
DataResponse
<
PaymentsModels
<
List
<
VaNumberModels
>>>>()
{
view
.
getContext
().
startActivity
(
new
Intent
(
getActivity
(),
TransactionDetail
.
class
)
@Override
.
putExtra
(
MethodePayment
.
VIA_CASH
,
paymentsModels1
));
public
void
onResponse
(
Call
<
DataResponse
<
PaymentsModels
<
List
<
VaNumberModels
>>>>
call
,
Response
<
DataResponse
<
PaymentsModels
<
List
<
VaNumberModels
>>>>
response
)
{
// paymentsModels1.setOrderId(sharedPreferences.getString(ORDER_ID, ""));
Log
.
i
(
"CASH_0"
,
"onResponse: "
+
utils
.
convertGson
(
response
.
body
()));
// paymentService.postFromCart(paymentsModels1).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
if
(
response
.
body
()
!=
null
){
// @Override
SharedPreferences
.
Editor
editor
=
PaymentActivity
.
sharedPreferences
.
edit
();
// public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) {
editor
.
putBoolean
(
CHECKOUT
,
false
);
// Log.i("CASH_0", "onResponse: "+utils.convertGson(response.body()));
editor
.
putString
(
ORDER_ID
,
""
);
// if (response.body() != null){
if
(
editor
.
commit
()){
// SharedPreferences.Editor editor = PaymentActivity.sharedPreferences.edit();
Intent
i
=
new
Intent
(
getActivity
(),
MainActivity
.
class
);
// editor.putBoolean(CHECKOUT, false);
view
.
getContext
().
startActivity
(
i
);
// editor.putString(ORDER_ID, "");
}
// if (editor.commit()){
}
// Intent i = new Intent(getActivity(), MainActivity.class);
}
// view.getContext().startActivity(i);
// }
@Override
// }
public
void
onFailure
(
Call
<
DataResponse
<
PaymentsModels
<
List
<
VaNumberModels
>>>>
call
,
Throwable
t
)
{
// }
//
}
// @Override
});
// public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) {
//
// }
// });
}
else
{
}
else
{
paymentsModels
.
setTransactionStatus
(
"success"
);
paymentsModels
.
setTransactionStatus
(
"success"
);
paymentsModels
.
setPaymentType
(
"cash"
);
paymentsModels
.
setPaymentType
(
"cash"
);
paymentService
.
postFromCartPending
(
paymentsModels
.
getOrderId
(),
paymentsModels
).
enqueue
(
new
Callback
<
DataResponse
>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
>
call
,
Response
<
DataResponse
>
response
)
{
Log
.
i
(
"CASH_1"
,
"onResponse: "
+
utils
.
convertGson
(
paymentsModels
));
if
(
response
.
body
()
!=
null
){
SharedPreferences
.
Editor
editor
=
PaymentActivity
.
sharedPreferences
.
edit
();
editor
.
putBoolean
(
CHECKOUT
,
false
);
editor
.
putString
(
ORDER_ID
,
""
);
if
(
editor
.
commit
()){
Intent
i
=
new
Intent
(
getActivity
(),
MainActivity
.
class
);
view
.
getContext
().
startActivity
(
i
);
}
}
}
@Override
public
void
onFailure
(
Call
<
DataResponse
>
call
,
Throwable
t
)
{
}
});
}
}
...
...
app/src/main/java/com/yono/messeripos/CartActivity.java
View file @
ba5b42cb
...
@@ -173,7 +173,6 @@ public class CartActivity extends AppCompatActivity {
...
@@ -173,7 +173,6 @@ public class CartActivity extends AppCompatActivity {
}
else
{
}
else
{
utils
.
dialog
(
CartActivity
.
this
,
utils
.
dialog
(
CartActivity
.
this
,
true
,
true
,
getLayoutInflater
().
inflate
(
R
.
layout
.
alert_dialog
,
null
),
"Warning"
,
"Warning"
,
"Item stock does not meet"
).
show
();
"Item stock does not meet"
).
show
();
}
}
...
...
app/src/main/java/com/yono/messeripos/ForgotCode.java
View file @
ba5b42cb
...
@@ -5,29 +5,43 @@ import android.app.ProgressDialog;
...
@@ -5,29 +5,43 @@ import android.app.ProgressDialog;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.WindowManager
;
import
android.widget.RelativeLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
com.alimuzaffar.lib.pin.PinEntryEditText
;
import
com.google.android.material.bottomsheet.BottomSheetBehavior
;
import
com.google.android.material.bottomsheet.BottomSheetBehavior
;
import
com.google.android.material.bottomsheet.BottomSheetDialog
;
import
com.google.android.material.bottomsheet.BottomSheetDialog
;
import
com.google.android.material.bottomsheet.BottomSheetDialogFragment
;
import
com.google.android.material.bottomsheet.BottomSheetDialogFragment
;
import
com.yono.messeripos.api.client.Client
;
import
com.yono.messeripos.api.service.UsersService
;
import
com.yono.messeripos.models.ForgotPasswordModels
;
import
com.yono.messeripos.models.MainViewModels
;
import
com.yono.messeripos.response.DataResponse
;
import
com.yono.messeripos.utils.Utils
;
import
com.yono.messeripos.utils.Utils
;
public
class
ForgotCode
extends
BottomSheetDialogFragment
{
public
class
ForgotCode
extends
BottomSheetDialogFragment
{
private
static
final
String
TAG
=
"FORGOT CODE"
;
Utils
utils
;
Utils
utils
;
BottomSheetBehavior
sheetBehavior
;
BottomSheetBehavior
sheetBehavior
;
BottomSheetDialog
sheetDialog
;
BottomSheetDialog
sheetDialog
;
RelativeLayout
fp
Code
;
RelativeLayout
fp
ass
;
View
view
;
View
view
;
PinEntryEditText
pinEntry
;
ForgotPasswordModels
forgotPasswordModels
;
Context
context
;
Context
context
;
public
ForgotCode
(
Context
c
)
{
public
ForgotCode
(
Context
context
,
ForgotPasswordModels
forgotPasswordModels
)
{
context
=
c
;
this
.
context
=
context
;
this
.
forgotPasswordModels
=
forgotPasswordModels
;
}
}
@NonNull
@NonNull
...
@@ -39,7 +53,7 @@ public class ForgotCode extends BottomSheetDialogFragment {
...
@@ -39,7 +53,7 @@ public class ForgotCode extends BottomSheetDialogFragment {
view
=
View
.
inflate
(
getContext
(),
R
.
layout
.
forgot_password_code
,
null
);
view
=
View
.
inflate
(
getContext
(),
R
.
layout
.
forgot_password_code
,
null
);
// bindUI
// bindUI
fp
Code
=
view
.
findViewById
(
R
.
id
.
fpCode
);
fp
ass
=
view
.
findViewById
(
R
.
id
.
fpasswd
);
// utils
// utils
utils
=
new
Utils
();
utils
=
new
Utils
();
...
@@ -53,7 +67,28 @@ public class ForgotCode extends BottomSheetDialogFragment {
...
@@ -53,7 +67,28 @@ public class ForgotCode extends BottomSheetDialogFragment {
// set max height
// set max height
sheetBehavior
.
setPeekHeight
(
setHeight
);
sheetBehavior
.
setPeekHeight
(
setHeight
);
fpCode
.
setMinimumHeight
(
setHeight
);
fpass
.
setMinimumHeight
(
setHeight
);
utils
=
new
Utils
();
// Log.d(TAG, "onCreateDialog: "+utils.convertGson(mainViewModels));
pinEntry
=
view
.
findViewById
(
R
.
id
.
txt_pin_entry
);
if
(
pinEntry
!=
null
)
{
pinEntry
.
setOnPinEnteredListener
(
new
PinEntryEditText
.
OnPinEnteredListener
()
{
@Override
public
void
onPinEntered
(
CharSequence
str
)
{
if
(
str
.
toString
().
equals
(
forgotPasswordModels
.
getMessage
()))
{
ForgotPassword
forgotPassword
=
new
ForgotPassword
(
context
,
forgotPasswordModels
);
forgotPassword
.
setCancelable
(
false
);
forgotPassword
.
show
(
getActivity
().
getSupportFragmentManager
(),
"Forgot Confirm"
);
}
else
{
Toast
.
makeText
(
context
,
"FAIL"
,
Toast
.
LENGTH_SHORT
).
show
();
pinEntry
.
setText
(
null
);
}
}
});
}
return
sheetDialog
;
return
sheetDialog
;
}
}
...
...
app/src/main/java/com/yono/messeripos/ForgotPassword.java
0 → 100644
View file @
ba5b42cb
package
com
.
yono
.
messeripos
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.RelativeLayout
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.google.android.material.bottomsheet.BottomSheetBehavior
;
import
com.google.android.material.bottomsheet.BottomSheetDialog
;
import
com.google.android.material.bottomsheet.BottomSheetDialogFragment
;
import
com.google.android.material.button.MaterialButton
;
import
com.google.android.material.textfield.TextInputEditText
;
import
com.yono.messeripos.api.service.UsersService
;
import
com.yono.messeripos.models.ForgotPasswordModels
;
import
com.yono.messeripos.models.UsersModels
;
import
com.yono.messeripos.response.DataResponse
;
import
com.yono.messeripos.utils.Utils
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
public
class
ForgotPassword
extends
BottomSheetDialogFragment
{
BottomSheetDialog
sheetDialog
;
BottomSheetBehavior
sheetBehavior
;
View
view
;
RelativeLayout
resetPassUI
;
Utils
utils
=
new
Utils
();
TextInputEditText
newPass
,
etConfPass
;
MaterialButton
btnReset
;
Context
context
;
UsersService
usersService
;
ForgotPasswordModels
forgotPasswordModels
;
public
ForgotPassword
(
Context
context
,
ForgotPasswordModels
forgotPasswordModels
)
{
this
.
context
=
context
;
this
.
forgotPasswordModels
=
forgotPasswordModels
;
}
@NonNull
@Override
public
Dialog
onCreateDialog
(
@Nullable
Bundle
savedInstanceState
)
{
sheetDialog
=
(
BottomSheetDialog
)
super
.
onCreateDialog
(
savedInstanceState
);
// inflating layout
view
=
View
.
inflate
(
getContext
(),
R
.
layout
.
forgot_new_password
,
null
);
// bindUI
resetPassUI
=
view
.
findViewById
(
R
.
id
.
resetPassword
);
newPass
=
view
.
findViewById
(
R
.
id
.
etNewPassword
);
etConfPass
=
view
.
findViewById
(
R
.
id
.
etPasswordConfirmation
);
btnReset
=
view
.
findViewById
(
R
.
id
.
btnReset
);
sheetDialog
.
setContentView
(
view
);
sheetBehavior
=
BottomSheetBehavior
.
from
((
View
)
(
view
.
getParent
()));
// get Window size
int
setHeight
=
utils
.
getWindowHeight
()
-
(
utils
.
getWindowHeight
()
*
5
)
/
100
;
// set max height
sheetBehavior
.
setPeekHeight
(
setHeight
);
resetPassUI
.
setMinimumHeight
(
setHeight
);
btnReset
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
String
newPas
=
newPass
.
getText
().
toString
();
String
conPass
=
etConfPass
.
getText
().
toString
();
forgotPasswordModels
.
setPassword
(
newPass
.
getText
().
toString
());
if
(
newPas
.
equals
(
conPass
))
{
sheetDialog
.
dismiss
();
usersService
.
resetPassword
(
forgotPasswordModels
);
startActivity
(
new
Intent
(
context
,
LoginActivity
.
class
));
getActivity
().
finish
();
}
else
{
utils
.
dialog
(
context
,
true
,
"password does't match"
,
"Your password not match!"
).
show
();
}
}
});
return
sheetDialog
;
}
}
app/src/main/java/com/yono/messeripos/ForgotPasswordActivity.java
View file @
ba5b42cb
...
@@ -3,25 +3,73 @@ package com.yono.messeripos;
...
@@ -3,25 +3,73 @@ package com.yono.messeripos;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentManager
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.EditText
;
import
android.widget.ImageButton
;
import
android.widget.ImageButton
;
import
com.yono.messeripos.api.client.Client
;
import
com.yono.messeripos.api.service.UsersService
;
import
com.yono.messeripos.models.ForgotPasswordModels
;
import
com.yono.messeripos.models.MainViewModels
;
import
com.yono.messeripos.response.DataResponse
;
import
com.yono.messeripos.utils.Utils
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
public
class
ForgotPasswordActivity
extends
AppCompatActivity
{
public
class
ForgotPasswordActivity
extends
AppCompatActivity
{
ImageButton
btnReset
;
ImageButton
btnReset
;
ForgotCode
forgotCode
;
ForgotCode
forgotCode
;
ForgotPasswordModels
forgotPasswordModels
;
Utils
utils
=
new
Utils
();
Client
client
=
new
Client
();
UsersService
usersService
;
EditText
formForgot
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_forgot_password
);
setContentView
(
R
.
layout
.
activity_forgot_password
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
w
=
getWindow
();
w
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
,
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
);
}
forgotPasswordModels
=
new
ForgotPasswordModels
();
// bind UI
btnReset
=
findViewById
(
R
.
id
.
btn_reset_password
);
btnReset
=
findViewById
(
R
.
id
.
btn_reset_password
);
formForgot
=
findViewById
(
R
.
id
.
forgotEmail
);
btnReset
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
btnReset
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
forgotCode
=
new
ForgotCode
(
ForgotPasswordActivity
.
this
);
forgotCode
.
show
(
getSupportFragmentManager
(),
"forgot code"
);
forgotPasswordModels
.
setEmail
(
formForgot
.
getText
().
toString
());
forgotPasswordModels
.
setMessage
(
utils
.
getRandomNumberString
());
usersService
=
client
.
Client
(
UsersService
.
class
);
usersService
.
postForgotPassword
(
forgotPasswordModels
).
enqueue
(
new
Callback
<
DataResponse
>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
>
call
,
Response
<
DataResponse
>
response
)
{
forgotCode
=
new
ForgotCode
(
ForgotPasswordActivity
.
this
,
forgotPasswordModels
);
forgotCode
.
setCancelable
(
false
);
forgotCode
.
show
(
getSupportFragmentManager
(),
"forgot code"
);
}
@Override
public
void
onFailure
(
Call
<
DataResponse
>
call
,
Throwable
t
)
{
}
});
}
}
});
});
}
}
...
...
app/src/main/java/com/yono/messeripos/LoginState.java
View file @
ba5b42cb
...
@@ -144,19 +144,17 @@ public class LoginState extends BottomSheetDialogFragment {
...
@@ -144,19 +144,17 @@ public class LoginState extends BottomSheetDialogFragment {
.
observe
((
LifecycleOwner
)
context
,
usersModelsDataResponse
->
{
.
observe
((
LifecycleOwner
)
context
,
usersModelsDataResponse
->
{
if
(
usersModelsDataResponse
!=
null
)
{
if
(
usersModelsDataResponse
!=
null
)
{
final
View
customLayout
=
getLayoutInflater
()
.
inflate
(
R
.
layout
.
alert_dialog
,
null
);
switch
(
usersModelsDataResponse
.
getMessageData
().
toLowerCase
())
{
switch
(
usersModelsDataResponse
.
getMessageData
().
toLowerCase
())
{
case
"invalid username or password"
:
case
"invalid username or password"
:
setAllLayoutToTrue
();
setAllLayoutToTrue
();
errUserPass
(
customLayout
);
errUserPass
();
break
;
break
;
case
"please activate your email first"
:
case
"please activate your email first"
:
setAllLayoutToTrue
();
setAllLayoutToTrue
();
activateEmail
(
customLayout
);
activateEmail
();
default
:
default
:
break
;
break
;
...
@@ -206,10 +204,10 @@ public class LoginState extends BottomSheetDialogFragment {
...
@@ -206,10 +204,10 @@ public class LoginState extends BottomSheetDialogFragment {
closeBtn
.
setEnabled
(
false
);
closeBtn
.
setEnabled
(
false
);
}
}
private
void
activateEmail
(
View
customLayout
)
{
private
void
activateEmail
()
{
utils
=
new
Utils
(
customLayout
);
utils
=
new
Utils
();
utils
.
dialog
(
context
,
false
,
customLayout
,
"Please Verify Email"
,
utils
.
dialog
(
context
,
false
,
"Please Verify Email"
,
"Please verify your email before login"
,
"Please verify your email before login"
,
"close"
,
"verify"
)
"close"
,
"verify"
)
.
show
();
.
show
();
...
@@ -230,10 +228,10 @@ public class LoginState extends BottomSheetDialogFragment {
...
@@ -230,10 +228,10 @@ public class LoginState extends BottomSheetDialogFragment {
});
});
}
}
private
void
errUserPass
(
View
customLayout
)
{
private
void
errUserPass
()
{
utils
=
new
Utils
(
customLayout
);
utils
=
new
Utils
();
utils
.
dialog
(
context
,
false
,
customLayout
,
"Wrong Username or Password"
,
utils
.
dialog
(
context
,
false
,
"Wrong Username or Password"
,
"The username or password is incorrect. Please try again!"
,
"The username or password is incorrect. Please try again!"
,
"Try Again"
)
"Try Again"
)
.
show
();
.
show
();
...
...
app/src/main/java/com/yono/messeripos/MethodePayment.java
View file @
ba5b42cb
...
@@ -7,15 +7,27 @@ import android.nfc.NfcAdapter;
...
@@ -7,15 +7,27 @@ import android.nfc.NfcAdapter;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.PersistableBundle
;
import
android.os.PersistableBundle
;
import
android.util.Log
;
import
android.view.Window
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.ViewModelProvider
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.google.android.material.card.MaterialCardView
;
import
com.google.android.material.card.MaterialCardView
;
import
com.google.gson.Gson
;
import
com.yono.messeripos.models.MainViewModels
;
import
com.yono.messeripos.models.MainViewModelsCart
;
import
com.yono.messeripos.models.PaymentsModels
;
import
com.yono.messeripos.models.PaymentsModels
;
import
com.yono.messeripos.models.ProductCartModels
;
import
com.yono.messeripos.utils.Utils
;
import
java.util.List
;
import
static
com
.
yono
.
messeripos
.
MainActivity
.
ORDER_ID
;
public
class
MethodePayment
extends
AppCompatActivity
{
public
class
MethodePayment
extends
AppCompatActivity
{
...
@@ -24,6 +36,12 @@ public class MethodePayment extends AppCompatActivity {
...
@@ -24,6 +36,12 @@ public class MethodePayment extends AppCompatActivity {
MaterialCardView
mcCash
,
mcBank
,
mcNfc
;
MaterialCardView
mcCash
,
mcBank
,
mcNfc
;
BottomSheets
bottomSheet
;
BottomSheets
bottomSheet
;
NfcAdapter
nfcAdapter
;
NfcAdapter
nfcAdapter
;
MainViewModelsCart
mainViewModels
;
private
long
total
=
0
;
Utils
utils
=
new
Utils
();
public
static
String
METHODE_PAYMENT_DATA
=
"payment_methode_data"
;
public
static
String
VIA_CASH
=
"via_cash"
;
public
static
String
VIA_NFC
=
"via_nfc"
;
@Override
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -44,6 +62,7 @@ public class MethodePayment extends AppCompatActivity {
...
@@ -44,6 +62,7 @@ public class MethodePayment extends AppCompatActivity {
sharedPreferences
=
getSharedPreferences
(
MainActivity
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
sharedPreferences
=
getSharedPreferences
(
MainActivity
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
paymentsModelsIntent
=
getIntent
().
getParcelableExtra
(
CartActivity
.
CODE_SEND_CHECKOUT_HISTORY
);
paymentsModelsIntent
=
getIntent
().
getParcelableExtra
(
CartActivity
.
CODE_SEND_CHECKOUT_HISTORY
);
paymentsModels
=
new
PaymentsModels
();
paymentsModels
=
new
PaymentsModels
();
mainViewModels
=
new
ViewModelProvider
(
MethodePayment
.
this
).
get
(
MainViewModelsCart
.
class
);
MaterialToolbar
toolbars
=
findViewById
(
R
.
id
.
appBarPaymentMethode
);
MaterialToolbar
toolbars
=
findViewById
(
R
.
id
.
appBarPaymentMethode
);
...
@@ -61,14 +80,75 @@ public class MethodePayment extends AppCompatActivity {
...
@@ -61,14 +80,75 @@ public class MethodePayment extends AppCompatActivity {
mcBank
.
setOnClickListener
(
view
->
bank
());
mcBank
.
setOnClickListener
(
view
->
bank
());
mcNfc
.
setOnClickListener
(
view
->
nfc
());
mcNfc
.
setOnClickListener
(
view
->
nfc
());
getdataCheckout
();
Log
.
i
(
"paymentModels"
,
"onCreate: "
+
utils
.
convertGson
(
paymentsModels
));
Log
.
i
(
"paymentModelsIntent"
,
"onCreate: "
+
utils
.
convertGson
(
paymentsModelsIntent
));
}
private
void
getdataCheckout
()
{
if
(
paymentsModelsIntent
==
null
){
mainViewModels
.
getCartById
(
sharedPreferences
.
getString
(
ORDER_ID
,
""
)).
observe
(
this
,
new
Observer
<
List
<
ProductCartModels
>>()
{
@Override
public
void
onChanged
(
List
<
ProductCartModels
>
productCartModels
)
{
String
js
=
new
Gson
().
toJson
(
productCartModels
);
Log
.
i
(
"On payment"
,
"onChanged: "
+
js
);
for
(
ProductCartModels
pd
:
productCartModels
){
total
=
total
+
pd
.
getPrice_orders
()*
pd
.
getQuantity_orders
();
}
paymentsModels
.
setOrderId
(
productCartModels
.
get
(
0
).
getId_orders
());
paymentsModels
.
setGrossAmount
(
total
);
Log
.
i
(
"paymentModels"
,
"onCreate: "
+
utils
.
convertGson
(
paymentsModels
));
}
});
}
else
{
mainViewModels
.
getCartById
(
paymentsModelsIntent
.
getOrderId
()).
observe
(
this
,
new
Observer
<
List
<
ProductCartModels
>>()
{
@Override
public
void
onChanged
(
List
<
ProductCartModels
>
productCartModels
)
{
String
js
=
new
Gson
().
toJson
(
productCartModels
);
Log
.
i
(
"On Intent_CHANGE"
,
"onChanged: "
+
paymentsModelsIntent
.
getOrderId
());
for
(
ProductCartModels
pd
:
productCartModels
){
total
=
total
+
pd
.
getPrice_orders
()*
pd
.
getQuantity_orders
();
}
paymentsModelsIntent
.
setOrderId
(
productCartModels
.
get
(
0
).
getId_orders
());
paymentsModelsIntent
.
setGrossAmount
(
total
);
Log
.
i
(
"paymentModelsIntent"
,
"onCreate: "
+
utils
.
convertGson
(
paymentsModelsIntent
));
// if (productCartModels.size() != 0){
// getSupportActionBar().setTitle(productCartModels.get(0).getId_orders());
// paymentsModelsIntent.setOrderId(productCartModels.get(0).getId_orders());
// paymentsModelsIntent.setGrossAmount(total);
// checkoutAdapter.setCheckoutAdapter(PaymentActivity.this, productCartModels);
// recyclerView.setLayoutManager(new LinearLayoutManager(PaymentActivity.this, RecyclerView.VERTICAL, false));
// recyclerView.setAdapter(checkoutAdapter);
// recyclerView.addItemDecoration(dividerItemDecoration);
//// grandTotal.setText(utils.convertPrice("Rp. ", total));
// }
}
});
}
}
}
private
void
nfc
()
{
private
void
nfc
()
{
startActivity
(
new
Intent
(
MethodePayment
.
this
,
ScannerNfc
.
class
));
if
(
paymentsModelsIntent
==
null
){
startActivity
(
new
Intent
(
MethodePayment
.
this
,
ScannerNfc
.
class
)
.
putExtra
(
VIA_NFC
,
paymentsModels
));
}
}
}
private
void
bank
()
{
private
void
bank
()
{
startActivity
(
new
Intent
(
MethodePayment
.
this
,
PaymentActivity
.
class
));
if
(
paymentsModelsIntent
==
null
){
paymentsModels
.
setPaymentType
(
"nfc"
);
startActivity
(
new
Intent
(
MethodePayment
.
this
,
PaymentActivity
.
class
)
.
putExtra
(
METHODE_PAYMENT_DATA
,
paymentsModels
));
}
}
}
private
void
cash
()
{
private
void
cash
()
{
...
...
app/src/main/java/com/yono/messeripos/PaymentActivity.java
View file @
ba5b42cb
...
@@ -70,6 +70,7 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -70,6 +70,7 @@ public class PaymentActivity extends AppCompatActivity {
BottomSheetBehavior
bottomSheetBank
;
BottomSheetBehavior
bottomSheetBank
;
RelativeLayout
qrcodeLayoutBank
;
RelativeLayout
qrcodeLayoutBank
;
PaymentsModels
paymentsModelsIntent
;
PaymentsModels
paymentsModelsIntent
;
public
static
String
PAYMENT_VIA_BANK
=
"payment_via_bank"
;
@Override
@Override
...
@@ -86,7 +87,9 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -86,7 +87,9 @@ public class PaymentActivity extends AppCompatActivity {
recyclerView
=
findViewById
(
R
.
id
.
rvPayment
);
recyclerView
=
findViewById
(
R
.
id
.
rvPayment
);
sharedPreferences
=
getSharedPreferences
(
MainActivity
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
sharedPreferences
=
getSharedPreferences
(
MainActivity
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
paymentsModelsIntent
=
getIntent
().
getParcelableExtra
(
CartActivity
.
CODE_SEND_CHECKOUT_HISTORY
);
paymentsModelsIntent
=
getIntent
().
getParcelableExtra
(
MethodePayment
.
METHODE_PAYMENT_DATA
);
Log
.
i
(
"OKE"
,
"onCreate: "
+
utils
.
convertGson
(
paymentsModelsIntent
));
paymentsModels
=
new
PaymentsModels
();
paymentsModels
=
new
PaymentsModels
();
...
@@ -173,11 +176,15 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -173,11 +176,15 @@ public class PaymentActivity extends AppCompatActivity {
PaymentAdapter
adapter
=
new
PaymentAdapter
(
paymentResponses
,
this
);
PaymentAdapter
adapter
=
new
PaymentAdapter
(
paymentResponses
,
this
);
rvPayment
.
setAdapter
(
adapter
);
rvPayment
.
setAdapter
(
adapter
);
btnPay
=
findViewById
(
R
.
id
.
btnPay
);
//
btnPay = findViewById(R.id.btnPay);
adapter
.
setListener
(
paymentResponse
->
{
adapter
.
setListener
(
paymentResponse
->
{
methodPay
=
paymentResponse
.
getBank
();
methodPay
=
paymentResponse
.
getBank
();
startActivity
(
new
Intent
(
PaymentActivity
.
this
,
TransactionDetail
.
class
));
paymentsModelsIntent
.
setBank
(
methodPay
);
paymentsModelsIntent
.
setPaymentType
(
"bank_transfer"
);
Log
.
i
(
"SENDING"
,
"onCreate: "
+
utils
.
convertGson
(
paymentsModelsIntent
));
startActivity
(
new
Intent
(
PaymentActivity
.
this
,
TransactionDetail
.
class
)
.
putExtra
(
PAYMENT_VIA_BANK
,
paymentsModelsIntent
));
// btnPay.setEnabled(true);
// btnPay.setEnabled(true);
});
});
...
...
app/src/main/java/com/yono/messeripos/RegisterState.java
View file @
ba5b42cb
...
@@ -180,10 +180,8 @@ public class RegisterState extends BottomSheetDialogFragment {
...
@@ -180,10 +180,8 @@ public class RegisterState extends BottomSheetDialogFragment {
* */
* */
setAllLayoutToFalse
();
setAllLayoutToFalse
();
if
(
usersModelsDataResponse
!=
null
)
{
if
(
usersModelsDataResponse
!=
null
)
{
final
View
customLayout
=
getLayoutInflater
()
.
inflate
(
R
.
layout
.
alert_dialog
,
null
);
activateEmail
(
customLayout
);
activateEmail
();
setAllLayoutToTrue
();
setAllLayoutToTrue
();
}
}
}
}
...
@@ -201,9 +199,7 @@ public class RegisterState extends BottomSheetDialogFragment {
...
@@ -201,9 +199,7 @@ public class RegisterState extends BottomSheetDialogFragment {
return
sheetDialog2
;
return
sheetDialog2
;
}
}
private
void
setAllLayoutToTrue
()
{
private
void
setAllLayoutToTrue
()
{
pbReg
.
setVisibility
(
View
.
GONE
);
pbReg
.
setVisibility
(
View
.
GONE
);
registerButton
.
setText
(
DEFAULT_REGISTER
);
registerButton
.
setText
(
DEFAULT_REGISTER
);
sheetDialog2
.
setCancelable
(
true
);
sheetDialog2
.
setCancelable
(
true
);
...
@@ -226,10 +222,10 @@ public class RegisterState extends BottomSheetDialogFragment {
...
@@ -226,10 +222,10 @@ public class RegisterState extends BottomSheetDialogFragment {
}
}
private
void
activateEmail
(
View
customLayout
)
{
private
void
activateEmail
()
{
utils
=
new
Utils
(
customLayout
);
utils
=
new
Utils
();
utils
.
dialog
(
context
,
false
,
customLayout
,
"Please Verifiy Email"
,
utils
.
dialog
(
context
,
false
,
"Please Verifiy Email"
,
"Please verify your email before login"
,
"Please verify your email before login"
,
"close"
,
"verify"
)
"close"
,
"verify"
)
.
show
();
.
show
();
...
...
app/src/main/java/com/yono/messeripos/ScannerNfc.java
View file @
ba5b42cb
...
@@ -2,7 +2,9 @@ package com.yono.messeripos;
...
@@ -2,7 +2,9 @@ package com.yono.messeripos;
import
android.app.PendingIntent
;
import
android.app.PendingIntent
;
import
android.app.ProgressDialog
;
import
android.app.ProgressDialog
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.nfc.NdefMessage
;
import
android.nfc.NdefMessage
;
import
android.nfc.NdefRecord
;
import
android.nfc.NdefRecord
;
import
android.nfc.NfcAdapter
;
import
android.nfc.NfcAdapter
;
...
@@ -24,8 +26,11 @@ import android.widget.Toast;
...
@@ -24,8 +26,11 @@ import android.widget.Toast;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.lifecycle.ViewModelProvider
;
import
com.yono.messeripos.R
;
import
com.yono.messeripos.R
;
import
com.yono.messeripos.models.MainViewModelsCart
;
import
com.yono.messeripos.models.PaymentsModels
;
import
com.yono.messeripos.nfc.parser.NdefMessageParser
;
import
com.yono.messeripos.nfc.parser.NdefMessageParser
;
import
com.yono.messeripos.nfc.record.ParsedNdefRecord
;
import
com.yono.messeripos.nfc.record.ParsedNdefRecord
;
import
com.yono.messeripos.utils.Utils
;
import
com.yono.messeripos.utils.Utils
;
...
@@ -38,6 +43,12 @@ public class ScannerNfc extends AppCompatActivity {
...
@@ -38,6 +43,12 @@ public class ScannerNfc extends AppCompatActivity {
NfcAdapter
nfcAdapter
;
NfcAdapter
nfcAdapter
;
Utils
utils
=
new
Utils
();
Utils
utils
=
new
Utils
();
ProgressDialog
progressDialog
;
ProgressDialog
progressDialog
;
PaymentsModels
paymentsModels
;
MainViewModelsCart
mainViewModelsCart
;
public
static
final
String
MY_SHARED_NFC
=
"shared_nfc"
;
public
static
String
getMySharedNfc
;
public
static
final
String
NFC_ID
=
"nfcId"
;
SharedPreferences
sharedPreferences
,
sharedPreferencesMain
;
@Override
@Override
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
...
@@ -48,6 +59,11 @@ public class ScannerNfc extends AppCompatActivity {
...
@@ -48,6 +59,11 @@ public class ScannerNfc extends AppCompatActivity {
progressDialog
=
new
ProgressDialog
(
ScannerNfc
.
this
);
progressDialog
=
new
ProgressDialog
(
ScannerNfc
.
this
);
progressDialog
.
setMessage
(
"Loading..."
);
progressDialog
.
setMessage
(
"Loading..."
);
paymentsModels
=
getIntent
().
getParcelableExtra
(
MethodePayment
.
VIA_NFC
);
mainViewModelsCart
=
new
ViewModelProvider
(
this
).
get
(
MainViewModelsCart
.
class
);
sharedPreferences
=
getSharedPreferences
(
MY_SHARED_NFC
,
Context
.
MODE_PRIVATE
);
sharedPreferencesMain
=
getSharedPreferences
(
MainActivity
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
w
=
getWindow
();
Window
w
=
getWindow
();
w
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
,
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
);
w
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
,
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
);
...
@@ -108,8 +124,14 @@ public class ScannerNfc extends AppCompatActivity {
...
@@ -108,8 +124,14 @@ public class ScannerNfc extends AppCompatActivity {
NdefMessage
msg
=
new
NdefMessage
(
new
NdefRecord
[]
{
record
});
NdefMessage
msg
=
new
NdefMessage
(
new
NdefRecord
[]
{
record
});
msgs
=
new
NdefMessage
[]
{
msg
};
msgs
=
new
NdefMessage
[]
{
msg
};
Log
.
i
(
"DUMPTAG"
,
"resolveIntent: "
+
toDec
(
tag
.
getId
()));
Log
.
i
(
"DUMPTAG"
,
"resolveIntent: "
+
toDec
(
tag
.
getId
()));
/**
* DISINI UNTUK SAVE KE DATABASE*/
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
editor
.
putString
(
NFC_ID
,
""
+
toDec
(
tag
.
getId
()));
if
(
editor
.
commit
()){
paymentsModels
.
setOrderId
(
sharedPreferencesMain
.
getString
(
MainActivity
.
ORDER_ID
,
""
));
startActivity
(
new
Intent
(
ScannerNfc
.
this
,
TransactionDetail
.
class
)
.
putExtra
(
MethodePayment
.
VIA_NFC
,
paymentsModels
));
}
progressDialog
.
dismiss
();
progressDialog
.
dismiss
();
}
}
...
...
app/src/main/java/com/yono/messeripos/TransactionDetail.java
View file @
ba5b42cb
This diff is collapsed.
Click to expand it.
app/src/main/java/com/yono/messeripos/api/service/UsersService.java
View file @
ba5b42cb
...
@@ -18,4 +18,7 @@ public interface UsersService {
...
@@ -18,4 +18,7 @@ public interface UsersService {
@POST
(
ApiHelper
.
VERSI_API_1
+
"forgot-password"
)
@POST
(
ApiHelper
.
VERSI_API_1
+
"forgot-password"
)
Call
<
DataResponse
>
postForgotPassword
(
@Body
ForgotPasswordModels
forgotPasswordModels
);
Call
<
DataResponse
>
postForgotPassword
(
@Body
ForgotPasswordModels
forgotPasswordModels
);
@POST
(
ApiHelper
.
VERSI_API_1
+
"reset-password"
)
Call
<
DataResponse
>
resetPassword
(
@Body
ForgotPasswordModels
forgotPasswordModels
);
}
}
app/src/main/java/com/yono/messeripos/models/ForgotPasswordModels.java
View file @
ba5b42cb
...
@@ -9,6 +9,9 @@ public class ForgotPasswordModels {
...
@@ -9,6 +9,9 @@ public class ForgotPasswordModels {
@SerializedName
(
"message"
)
@SerializedName
(
"message"
)
private
String
message
;
private
String
message
;
@SerializedName
(
"password"
)
private
String
password
;
public
ForgotPasswordModels
()
{
public
ForgotPasswordModels
()
{
}
}
...
@@ -32,4 +35,12 @@ public class ForgotPasswordModels {
...
@@ -32,4 +35,12 @@ public class ForgotPasswordModels {
public
void
setMessage
(
String
message
)
{
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
this
.
message
=
message
;
}
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
}
}
app/src/main/java/com/yono/messeripos/utils/Utils.java
View file @
ba5b42cb
...
@@ -8,6 +8,7 @@ import android.graphics.BitmapFactory;
...
@@ -8,6 +8,7 @@ import android.graphics.BitmapFactory;
import
android.os.Build
;
import
android.os.Build
;
import
android.util.Base64
;
import
android.util.Base64
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -224,12 +225,13 @@ public class Utils {
...
@@ -224,12 +225,13 @@ public class Utils {
* Alert Dialog
* Alert Dialog
* @param context
* @param context
* @param cancelable
* @param cancelable
* @param view
* @return
* @return
*/
*/
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
View
view
)
{
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
)
{
CardView
btCard
=
view
.
findViewById
(
R
.
id
.
cvAlertOnClick
);
final
View
view
=
View
.
inflate
(
context
,
R
.
layout
.
alert_dialog
,
null
);
CardView
btnCard
=
view
.
findViewById
(
R
.
id
.
cvAlertOnClick
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
context
)
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
context
)
.
setCancelable
(
cancelable
)
.
setCancelable
(
cancelable
)
...
@@ -242,10 +244,14 @@ public class Utils {
...
@@ -242,10 +244,14 @@ public class Utils {
}
}
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
View
view
,
@Nullable
String
titles
)
{
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
@Nullable
String
titles
)
{
final
View
view
=
View
.
inflate
(
context
,
R
.
layout
.
alert_dialog
,
null
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
CardView
btCard
=
view
.
findViewById
(
R
.
id
.
cvAlertOnClick
);
CardView
bt
n
Card
=
view
.
findViewById
(
R
.
id
.
cvAlertOnClick
);
// set title and message
// set title and message
if
(
titles
!=
null
){
if
(
titles
!=
null
){
...
@@ -263,7 +269,12 @@ public class Utils {
...
@@ -263,7 +269,12 @@ public class Utils {
}
}
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
View
view
,
@Nullable
String
titles
,
@Nullable
String
messages
)
{
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
@Nullable
String
titles
,
@Nullable
String
messages
)
{
final
View
view
=
View
.
inflate
(
context
,
R
.
layout
.
alert_dialog
,
null
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
message
=
view
.
findViewById
(
R
.
id
.
alertBody
);
TextView
message
=
view
.
findViewById
(
R
.
id
.
alertBody
);
...
@@ -290,16 +301,18 @@ public class Utils {
...
@@ -290,16 +301,18 @@ public class Utils {
public
AlertDialog
dialog
(
Context
context
,
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
Boolean
cancelable
,
View
view
,
@Nullable
String
titles
,
@Nullable
String
titles
,
@Nullable
String
messages
,
@Nullable
String
messages
,
@Nullable
String
dismiss
)
{
@Nullable
String
dismiss
)
{
final
View
view
=
View
.
inflate
(
context
,
R
.
layout
.
alert_dialog
,
null
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
message
=
view
.
findViewById
(
R
.
id
.
alertBody
);
TextView
message
=
view
.
findViewById
(
R
.
id
.
alertBody
);
TextView
button2
=
view
.
findViewById
(
R
.
id
.
tvTextBtn2
);
TextView
button2
=
view
.
findViewById
(
R
.
id
.
tvTextBtn2
);
CardView
btnCard2
=
view
.
findViewById
(
R
.
id
.
cvAlertOnClick2
);
CardView
btnCard2
=
view
.
findViewById
(
R
.
id
.
cvAlertOnClick2
);
// set title and message
// set title and message
if
(
titles
!=
null
){
if
(
titles
!=
null
){
title
.
setText
(
titles
);
title
.
setText
(
titles
);
...
@@ -328,7 +341,6 @@ public class Utils {
...
@@ -328,7 +341,6 @@ public class Utils {
public
AlertDialog
dialog
(
Context
context
,
public
AlertDialog
dialog
(
Context
context
,
Boolean
cancelable
,
Boolean
cancelable
,
View
view
,
@Nullable
String
titles
,
@Nullable
String
titles
,
@Nullable
String
messages
,
@Nullable
String
messages
,
@Nullable
String
dismiss
,
@Nullable
String
dismiss
,
...
@@ -339,6 +351,8 @@ public class Utils {
...
@@ -339,6 +351,8 @@ public class Utils {
* Button2 untuk link
* Button2 untuk link
*/
*/
final
View
view
=
View
.
inflate
(
context
,
R
.
layout
.
alert_dialog
,
null
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
title
=
view
.
findViewById
(
R
.
id
.
alertTitles
);
TextView
message
=
view
.
findViewById
(
R
.
id
.
alertBody
);
TextView
message
=
view
.
findViewById
(
R
.
id
.
alertBody
);
TextView
button
=
view
.
findViewById
(
R
.
id
.
tvTextBtn
);
TextView
button
=
view
.
findViewById
(
R
.
id
.
tvTextBtn
);
...
@@ -385,9 +399,9 @@ public class Utils {
...
@@ -385,9 +399,9 @@ public class Utils {
// It will generate 6 digit random Number.
// It will generate 6 digit random Number.
// from 0 to 999999
// from 0 to 999999
Random
rnd
=
new
Random
();
Random
rnd
=
new
Random
();
int
number
=
rnd
.
nextInt
(
9999
99
);
int
number
=
rnd
.
nextInt
(
9999
);
// this will convert any number sequence into 6 character.
// this will convert any number sequence into 6 character.
return
String
.
format
(
"%0
6
d"
,
number
);
return
String
.
format
(
"%0
4
d"
,
number
);
}
}
}
}
app/src/main/res/layout/activity_forgot_password.xml
View file @
ba5b42cb
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawableStart=
"@drawable/ic_mail_outline_black_24dp"
android:drawableStart=
"@drawable/ic_mail_outline_black_24dp"
android:layout_marginEnd=
"20dp"
android:layout_marginEnd=
"20dp"
android:id=
"@+id/
e
mail"
android:id=
"@+id/
forgotE
mail"
android:layout_marginStart=
"20dp"
android:layout_marginStart=
"20dp"
android:textSize=
"14sp"
android:textSize=
"14sp"
android:drawablePadding=
"10dp"
android:drawablePadding=
"10dp"
...
...
app/src/main/res/layout/activity_list_transaction.xml
View file @
ba5b42cb
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
...
@@ -16,13 +17,13 @@
...
@@ -16,13 +17,13 @@
app:tabIndicatorHeight=
"4dp"
app:tabIndicatorHeight=
"4dp"
app:tabTextColor=
"@color/colorWhite"
app:tabTextColor=
"@color/colorWhite"
app:tabBackground=
"@color/colorPrimary"
app:tabBackground=
"@color/colorPrimary"
a
pp:layout_constraintTop_toBottomOf
=
"@id/toolbar"
a
ndroid:layout_below
=
"@id/toolbar"
app:tabMode=
"fixed"
/>
app:tabMode=
"fixed"
/>
<androidx.viewpager.widget.ViewPager
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/viewPager"
android:id=
"@+id/viewPager"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
a
pp:layout_constraintTop_toBottomOf
=
"@id/tabLayout"
/>
a
ndroid:layout_below
=
"@id/tabLayout"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
\ No newline at end of file
\ No newline at end of file
app/src/main/res/layout/activity_payment.xml
View file @
ba5b42cb
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/appbar"
android:layout_below=
"@id/appbar"
android:layout_above=
"@id/btnPay"
android:overScrollMode=
"never"
android:overScrollMode=
"never"
android:scrollingCache=
"false"
android:scrollingCache=
"false"
android:fadingEdge=
"none"
android:fadingEdge=
"none"
...
@@ -42,19 +41,19 @@
...
@@ -42,19 +41,19 @@
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</ScrollView>
<com.google.android.material.button.MaterialButton
<!-- <com.google.android.material.button.MaterialButton-->
android:id=
"@+id/btnPay"
<!-- android:id="@+id/btnPay"-->
android:layout_width=
"0dp"
<!-- android:layout_width="0dp"-->
android:layout_height=
"wrap_content"
<!-- android:layout_height="wrap_content"-->
android:text=
"pay"
<!-- android:text="pay"-->
android:padding=
"15dp"
<!-- android:padding="15dp"-->
android:textSize=
"16sp"
<!-- android:textSize="16sp"-->
android:enabled=
"false"
<!-- android:enabled="false"-->
android:layout_margin=
"10dp"
<!-- android:layout_margin="10dp"-->
android:layout_alignParentBottom=
"true"
<!-- android:layout_alignParentBottom="true"-->
android:layout_alignParentEnd=
"true"
<!-- android:layout_alignParentEnd="true"-->
android:layout_alignParentStart=
"true"
<!-- android:layout_alignParentStart="true"-->
/
>
<!-- />--
>
</RelativeLayout>
</RelativeLayout>
...
...
app/src/main/res/layout/alert_dialog.xml
View file @
ba5b42cb
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:paddingVertical=
"20dp"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<TextView
...
...
app/src/main/res/layout/
activity_
detail_transaction.xml
→
app/src/main/res/layout/detail_transaction.xml
View file @
ba5b42cb
...
@@ -6,14 +6,14 @@
...
@@ -6,14 +6,14 @@
xmlns:tools=
"http://schemas.android.com/tools"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<include
<include
android:id=
"@+id/app
barDetail
"
android:id=
"@+id/app
BarDetailTransaction
"
layout=
"@layout/app_bar"
/>
layout=
"@layout/app_bar"
/>
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/methodePayment"
android:id=
"@+id/
cv
methodePayment"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/app
barDetail
"
app:layout_constraintTop_toBottomOf=
"@id/app
BarDetailTransaction
"
app:cardElevation=
"2dp"
app:cardElevation=
"2dp"
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:layout_marginBottom=
"5dp"
...
@@ -51,10 +51,88 @@
...
@@ -51,10 +51,88 @@
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/detailTransaksi"
android:id=
"@+id/
cv
detailTransaksi"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/methodePayment"
app:layout_constraintTop_toBottomOf=
"@id/cvmethodePayment"
app:cardElevation=
"2dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:padding=
"10dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_margin=
"10dp"
>
<TextView
android:id=
"@+id/titleDetail"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:text=
"Transaction Detail"
android:textColor=
"@android:color/black"
android:textSize=
"18sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/lvDetail"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/titleDetail"
android:layout_marginTop=
"10dp"
/>
<TextView
android:id=
"@+id/txtAdminFee"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/lvDetail"
app:layout_constraintStart_toStartOf=
"parent"
android:text=
"Admin Fee"
android:textSize=
"12sp"
android:layout_marginTop=
"10dp"
/>
<TextView
android:id=
"@+id/adminFee"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/lvDetail"
app:layout_constraintEnd_toEndOf=
"parent"
android:text=
"Rp. 0"
android:textSize=
"12sp"
android:layout_marginTop=
"10dp"
/>
<TextView
android:id=
"@+id/txtGross"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/txtAdminFee"
app:layout_constraintStart_toStartOf=
"parent"
android:text=
"Gross Amount"
android:textSize=
"18sp"
android:layout_marginTop=
"20dp"
/>
<TextView
android:id=
"@+id/grossAmount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/adminFee"
app:layout_constraintEnd_toEndOf=
"parent"
android:text=
"Rp."
android:textSize=
"18sp"
android:layout_marginTop=
"10dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvMethodePaymentDetail"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/cvdetailTransaksi"
app:cardElevation=
"2dp"
app:cardElevation=
"2dp"
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:layout_marginBottom=
"5dp"
...
@@ -66,68 +144,52 @@
...
@@ -66,68 +144,52 @@
android:layout_margin=
"10dp"
>
android:layout_margin=
"10dp"
>
<TextView
<TextView
android:id=
"@+id/t
itleDetail
"
android:id=
"@+id/t
xtMethode
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:text=
"
Transaction Detail
"
android:text=
"
Payment Methode
"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
android:textSize=
"18sp"
/>
android:textSize=
"18sp"
/>
<ListView
android:id=
"@+id/lvDetail"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/titleDetail"
android:layout_marginTop=
"10dp"
/>
<TextView
<TextView
android:id=
"@+id/
txtAdminFee
"
android:id=
"@+id/
jenisMethod
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/
lvDetail
"
app:layout_constraintTop_toBottomOf=
"@id/
txtMethode
"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:text=
"Admin Fee"
android:textSize=
"12sp"
android:textSize=
"12sp"
android:layout_marginTop=
"10dp"
/>
android:textColor=
"@android:color/black"
android:layout_marginTop=
"20dp"
tools:text=
"@tools:sample/full_names"
/>
<TextView
<TextView
android:id=
"@+id/
adminFee
"
android:id=
"@+id/
mtdGrossAmount
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/
lvDetail
"
app:layout_constraintTop_toBottomOf=
"@id/
txtMethode
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:text=
"
Admin Fee
"
android:text=
""
android:textSize=
"12sp"
android:textSize=
"12sp"
android:layout_marginTop=
"10dp"
android:textColor=
"@android:color/black"
tools:ignore=
"DuplicateIds"
/>
android:layout_marginTop=
"20dp"
tools:text=
"@tools:sample/full_names"
/>
<TextView
android:id=
"@+id/txtgrandTotal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/txtAdminFee"
app:layout_constraintStart_toStartOf=
"parent"
android:text=
"Gross Amount"
android:textSize=
"18sp"
android:layout_marginTop=
"10dp"
/>
<TextView
android:id=
"@+id/txtgrandTotal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/adminFee"
app:layout_constraintEnd_toEndOf=
"parent"
android:text=
"Admin Fee"
android:textSize=
"18sp"
android:layout_marginTop=
"10dp"
tools:ignore=
"DuplicateIds"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/btnConfirm"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Confirmation"
android:padding=
"15dp"
android:textSize=
"16sp"
android:layout_margin=
"10dp"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/forgot_new_password.xml
View file @
ba5b42cb
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
>
<com.google.android.material.textfield.TextInputLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id=
"@+id/tfCurrentPassword"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
>
android:layout_margin=
"10dp"
android:hint=
"Current Password"
android:textColor=
"#fff"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
tools:ignore=
"MissingConstraints"
>
<com.google.android.material.textfield.TextInputEditText
<RelativeLayout
android:id=
"@+id/etCurrentPassword"
android:id=
"@+id/resetPassword"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:inputType=
"textPassword"
android:layout_height=
"match_parent"
android:imeOptions=
"actionNext"
android:fitsSystemWindows=
"true"
>
android:layout_height=
"wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tfNewPassword"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:hint=
"New Password"
android:textColor=
"#fff"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
>
<com.google.android.material.textfield.TextInputLayout
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/tfNewPassword"
android:id=
"@+id/etNewPassword"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"textPassword"
android:layout_margin=
"10dp"
android:imeOptions=
"actionNext"
android:hint=
"New Password"
android:layout_height=
"wrap_content"
/>
android:textColor=
"#fff"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:layout_constraintTop_toBottomOf=
"@id/tfCurrentPassword"
>
<com.google.android.material.textfield.TextInputEditText
</com.google.android.material.textfield.TextInputLayout>
android:id=
"@+id/etNewPassword"
android:layout_width=
"match_parent"
android:inputType=
"textPassword"
android:imeOptions=
"actionNext"
android:layout_height=
"wrap_content"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tfPasswordConfirmation"
android:id=
"@+id/tfPasswordConfirmation"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:layout_margin=
"10dp"
android:hint=
"Password Confirmation"
android:hint=
"Password Confirmation"
android:textColor=
"#fff"
android:textColor=
"#fff"
app:layout_constraintTop_toBottomOf=
"@id/tfNewPassword"
android:layout_below=
"@id/tfNewPassword"
>
tools:layout_editor_absoluteX=
"10dp"
>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/etPasswordConfirmation"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"textPassword"
android:imeOptions=
"actionNext"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/etPasswordConfirmation"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"textPassword"
android:imeOptions=
"actionNext"
/>
<com.google.android.material.button.MaterialButton
</com.google.android.material.textfield.TextInputLayout>
android:id=
"@+id/btnAdd"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:text=
"@string/add"
android:padding=
"16dp"
app:layout_constraintTop_toBottomOf=
"@id/tfPasswordConfirmation"
tools:ignore=
"MissingConstraints"
/>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/btnReset"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:text=
"@string/btn_reset_password"
android:padding=
"16dp"
android:layout_below=
"@id/tfPasswordConfirmation"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
\ No newline at end of file
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/forgot_password_code.xml
View file @
ba5b42cb
...
@@ -8,105 +8,47 @@
...
@@ -8,105 +8,47 @@
android:layout_width=
"match_parent"
>
android:layout_width=
"match_parent"
>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/fp
Code
"
android:id=
"@+id/fp
asswd
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingHorizontal=
"70dp"
android:padding=
"16dp"
>
android:layout_marginTop=
"100dp"
android:layout_height=
"match_parent"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/verifCode"
<com.google.android.material.textview.MaterialTextView
android:layout_width=
"match_parent"
android:id=
"@+id/insertCode"
android:layout_height=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_centerInParent=
"true"
>
android:layout_height=
"wrap_content"
android:text=
"Insert Code"
<androidx.constraintlayout.widget.ConstraintLayout
android:textStyle=
"bold"
android:layout_width=
"match_parent"
android:textSize=
"18sp"
android:layout_height=
"wrap_content"
>
android:layout_marginBottom=
"20dp"
android:layout_alignParentTop=
"true"
<EditText
android:layout_centerHorizontal=
"true"
/>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<com.alimuzaffar.lib.pin.PinEntryEditText
android:id=
"@+id/edit_text_1"
android:id=
"@+id/txt_pin_entry"
android:inputType=
"number"
android:layout_width=
"match_parent"
android:maxLength=
"1"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:cursorVisible=
"false"
android:gravity=
"center"
android:digits=
"1234567890"
android:padding=
"20dp"
android:inputType=
"number"
android:nextFocusRight=
"@id/edit_text_2"
android:maxLength=
"4"
android:singleLine=
"true"
android:textIsSelectable=
"false"
app:layout_constraintTop_toTopOf=
"parent"
android:textSize=
"20sp"
app:layout_constraintEnd_toStartOf=
"@id/edit_text_2"
android:layout_marginBottom=
"20dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:pinAnimationType=
"fromBottom"
app:layout_constraintStart_toStartOf=
"parent"
app:pinTextBottomPadding=
"20dp"
tools:ignore=
"Autofill,LabelFor"
/>
android:layoutDirection=
"ltr"
android:layout_below=
"@id/insertCode"
<EditText
/>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/edit_text_2"
android:layout_width=
"wrap_content"
android:inputType=
"number"
android:layout_height=
"wrap_content"
android:maxLength=
"1"
android:text=
"enter the code that has been sent to the email"
android:maxLines=
"1"
android:layout_below=
"@id/txt_pin_entry"
android:gravity=
"center"
android:layout_centerHorizontal=
"true"
/>
android:nextFocusRight=
"@id/edit_text_3"
android:padding=
"20dp"
</RelativeLayout>
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/edit_text_3"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/edit_text_1"
tools:ignore=
"Autofill,LabelFor"
/>
<EditText
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/edit_text_3"
android:inputType=
"number"
android:maxLength=
"1"
android:maxLines=
"1"
android:gravity=
"center"
android:padding=
"20dp"
android:nextFocusRight=
"@id/edit_text_4"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/edit_text_4"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/edit_text_2"
tools:ignore=
"Autofill,LabelFor"
/>
<EditText
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/edit_text_4"
android:inputType=
"number"
android:maxLength=
"1"
android:maxLines=
"1"
android:gravity=
"center"
android:padding=
"20dp"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/edit_text_3"
tools:ignore=
"Autofill,LabelFor"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- <androidx.cardview.widget.CardView-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_below="@id/verifCode"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content">-->
<!-- -->
<!-- <GridLayout-->
<!-- android:columnCount="3"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- -->
<!-- <com.google.android.material.button.MaterialButton-->
<!-- android:text="1"/>-->
<!-- -->
<!-- </GridLayout>-->
<!-- </androidx.cardview.widget.CardView>-->
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
</layout>
\ No newline at end of file
app/src/main/res/layout/item_checkout.xml
View file @
ba5b42cb
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<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=
"
6
0dp"
android:layout_height=
"
5
0dp"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -27,15 +27,14 @@
...
@@ -27,15 +27,14 @@
<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:layout_margin=
"10dp"
>
<TextView
<TextView
android:id=
"@+id/itemCheckout"
android:id=
"@+id/itemCheckout"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"@tools:sample/full_names"
tools:text=
"@tools:sample/full_names"
android:textSize=
"
20
sp"
android:textSize=
"
12
sp"
android:lines=
"3"
android:lines=
"3"
android:text=
"@{checkout.product_name_orders.toUpperCase()+` x `+checkout.quantity_orders}"
android:text=
"@{checkout.product_name_orders.toUpperCase()+` x `+checkout.quantity_orders}"
android:layout_margin=
"10dp"
android:layout_margin=
"10dp"
...
@@ -47,9 +46,8 @@
...
@@ -47,9 +46,8 @@
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"@tools:sample/full_names"
tools:text=
"@tools:sample/full_names"
android:textSize=
"
20
sp"
android:textSize=
"
12
sp"
android:text=
"@{subtotal}"
android:text=
"@{subtotal}"
android:textColor=
"@android:color/black"
android:layout_margin=
"10dp"
android:layout_margin=
"10dp"
app:layout_constraintStart_toEndOf=
"@id/itemCheckout"
app:layout_constraintStart_toEndOf=
"@id/itemCheckout"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
...
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