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
37a68ec9
Commit
37a68ec9
authored
Sep 04, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix in forgot and register
parent
d980f07e
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
406 additions
and
106 deletions
+406
-106
misc.xml
.idea/misc.xml
+1
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
ForgotCode.java
app/src/main/java/com/yono/messeripos/ForgotCode.java
+60
-0
ForgotPasswordActivity.java
...main/java/com/yono/messeripos/ForgotPasswordActivity.java
+14
-0
FormProductActivity.java
...rc/main/java/com/yono/messeripos/FormProductActivity.java
+12
-5
LoginState.java
app/src/main/java/com/yono/messeripos/LoginState.java
+12
-0
RegisterState.java
app/src/main/java/com/yono/messeripos/RegisterState.java
+47
-4
PaymentAdapter.java
...main/java/com/yono/messeripos/adapter/PaymentAdapter.java
+13
-1
TransactionAdapter.java
.../java/com/yono/messeripos/adapter/TransactionAdapter.java
+7
-2
ProductModels.java
...c/main/java/com/yono/messeripos/models/ProductModels.java
+4
-0
TransactionSuccess.java
...om/yono/messeripos/transactiontab/TransactionSuccess.java
+7
-0
Utils.java
app/src/main/java/com/yono/messeripos/utils/Utils.java
+22
-14
ic_baseline_delete_24.xml
app/src/main/res/drawable/ic_baseline_delete_24.xml
+1
-1
ic_baseline_edit_24.xml
app/src/main/res/drawable/ic_baseline_edit_24.xml
+1
-1
activity_detail_transaction.xml
app/src/main/res/layout/activity_detail_transaction.xml
+52
-0
activity_forgot_password.xml
app/src/main/res/layout/activity_forgot_password.xml
+3
-3
forgot_password_code.xml
app/src/main/res/layout/forgot_password_code.xml
+86
-64
form_product.xml
app/src/main/res/layout/form_product.xml
+1
-1
item_category.xml
app/src/main/res/layout/item_category.xml
+10
-8
methode_payment.xml
app/src/main/res/layout/methode_payment.xml
+51
-0
No files found.
.idea/misc.xml
View file @
37a68ec9
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
JDK
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
1.8
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/AndroidManifest.xml
View file @
37a68ec9
...
...
@@ -20,7 +20,8 @@
android:roundIcon=
"@mipmap/ic_launcher_new_icon"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme.appbar"
>
<activity
android:name=
".ForgotPasswordActivity"
></activity>
<activity
android:name=
".ForgotPasswordActivity"
android:windowSoftInputMode=
"adjustResize"
></activity>
<activity
android:name=
".RegisterActivity"
/>
<activity
android:name=
".TransactionActivity"
/>
<activity
...
...
app/src/main/java/com/yono/messeripos/ForgotCode.java
0 → 100644
View file @
37a68ec9
package
com
.
yono
.
messeripos
;
import
android.app.Dialog
;
import
android.app.ProgressDialog
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
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.yono.messeripos.utils.Utils
;
public
class
ForgotCode
extends
BottomSheetDialogFragment
{
Utils
utils
;
BottomSheetBehavior
sheetBehavior
;
BottomSheetDialog
sheetDialog
;
RelativeLayout
fpCode
;
View
view
;
Context
context
;
public
ForgotCode
(
Context
c
)
{
context
=
c
;
}
@NonNull
@Override
public
Dialog
onCreateDialog
(
@Nullable
Bundle
savedInstanceState
)
{
sheetDialog
=
(
BottomSheetDialog
)
super
.
onCreateDialog
(
savedInstanceState
);
// inflating layout
view
=
View
.
inflate
(
getContext
(),
R
.
layout
.
forgot_password_code
,
null
);
// bindUI
fpCode
=
view
.
findViewById
(
R
.
id
.
fpCode
);
// utils
utils
=
new
Utils
();
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
);
fpCode
.
setMinimumHeight
(
setHeight
);
return
sheetDialog
;
}
}
app/src/main/java/com/yono/messeripos/ForgotPasswordActivity.java
View file @
37a68ec9
package
com
.
yono
.
messeripos
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.fragment.app.FragmentManager
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.ImageButton
;
public
class
ForgotPasswordActivity
extends
AppCompatActivity
{
ImageButton
btnReset
;
ForgotCode
forgotCode
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_forgot_password
);
btnReset
=
findViewById
(
R
.
id
.
btn_reset_password
);
btnReset
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
forgotCode
=
new
ForgotCode
(
ForgotPasswordActivity
.
this
);
forgotCode
.
show
(
getSupportFragmentManager
(),
"forgot code"
);
}
});
}
}
\ No newline at end of file
app/src/main/java/com/yono/messeripos/FormProductActivity.java
View file @
37a68ec9
...
...
@@ -196,7 +196,8 @@ public class FormProductActivity extends AppCompatActivity {
if
(
productModelsIntent
==
null
){
str
.
add
(
"SELECT CATEGORY"
);
}
else
{
getCategoryById
(
productModelsIntent
.
getIdProduct
());
Log
.
i
(
"Category_Product"
,
"setSpinner: "
+
productModelsIntent
.
getCategoryProduct
());
getCategoryById
(
productModelsIntent
.
getCategoryProduct
());
categorySelect
.
add
(
0
,
productModelsIntent
.
getCategoryProduct
());
}
// str.add("SELECT CATEGORY");
...
...
@@ -229,6 +230,7 @@ public class FormProductActivity extends AppCompatActivity {
productModelsSave
.
setPriceProduct
(
Integer
.
parseInt
(
binding
.
etPrice
.
getText
().
toString
()));
productModelsSave
.
setStockProduct
(
Integer
.
parseInt
(
binding
.
etStock
.
getText
().
toString
()));
productModelsSave
.
setCategoryProduct
(
categorySelect
.
get
(
0
));
if
(
productModelsIntent
==
null
){
productModelsSave
.
setImageProduct
(
productModels
.
getImageProduct
());
}
else
{
...
...
@@ -251,11 +253,13 @@ public class FormProductActivity extends AppCompatActivity {
progressDialog
.
setCancelable
(
false
);
progressDialog
.
show
();
ProductService
productService
=
client
.
Client
(
ProductService
.
class
);
Log
.
i
(
"data_post"
,
"saveProduct: "
+
utils
.
convertGson
(
productModelsSave
));
Log
.
i
(
"data_post"
,
"saveProduct: "
+
utils
.
convertGson
(
productModelsIntent
.
getIdProduct
()));
productModelsSave
.
setIdProduct
(
productModelsIntent
.
getIdProduct
());
Log
.
i
(
"data_post+intent"
,
"saveProduct: "
+
utils
.
convertGson
(
productModelsSave
.
getIdProduct
()));
productService
.
updateProduct
(
productModelsSave
,
productModelsIntent
.
getIdProduct
()).
enqueue
(
new
Callback
<
DataResponse
<
ProductModels
>>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
<
ProductModels
>>
call
,
Response
<
DataResponse
<
ProductModels
>>
response
)
{
Log
.
i
(
"
Success Post"
,
"onResponse: "
+
utils
.
convertGson
(
response
));
Log
.
i
(
"
CodeUpdate"
,
"onResponse: "
+
utils
.
convertGson
(
response
.
body
()
));
if
(
response
.
body
()
!=
null
){
new
AlertDialog
.
Builder
(
FormProductActivity
.
this
)
.
setCancelable
(
false
)
...
...
@@ -363,8 +367,11 @@ public class FormProductActivity extends AppCompatActivity {
categoryServise
.
getCategoryId
(
s
).
enqueue
(
new
Callback
<
DataResponse
<
CategoryModels
>>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
<
CategoryModels
>>
call
,
Response
<
DataResponse
<
CategoryModels
>>
response
)
{
Log
.
i
(
"ER"
,
"onResponse: "
+
utils
.
convertGson
(
response
.
body
()));
if
(
response
.
body
()
!=
null
){
str
.
add
(
response
.
body
().
getData
().
getNameCategory
());
}
else
{
str
.
add
(
"SELECT CATEGORY"
);
}
}
@Override
...
...
app/src/main/java/com/yono/messeripos/LoginState.java
View file @
37a68ec9
...
...
@@ -32,6 +32,7 @@ import com.google.android.material.button.MaterialButton;
import
com.google.android.material.dialog.MaterialAlertDialogBuilder
;
import
com.google.android.material.snackbar.Snackbar
;
import
com.google.android.material.textfield.TextInputEditText
;
import
com.google.android.material.textview.MaterialTextView
;
import
com.yono.messeripos.models.CategoryModels
;
import
com.yono.messeripos.models.MainViewModels
;
import
com.yono.messeripos.models.UsersModels
;
...
...
@@ -55,6 +56,7 @@ public class LoginState extends BottomSheetDialogFragment {
ProgressBar
bar
;
View
view
;
ProgressDialog
dialog
;
MaterialTextView
forgot
;
public
LoginState
(
Context
context
,
MainViewModels
mainViewModels
)
{
this
.
context
=
context
;
...
...
@@ -79,6 +81,15 @@ public class LoginState extends BottomSheetDialogFragment {
loginButton
=
view
.
findViewById
(
R
.
id
.
SignInButtonInLogin
);
closeBtn
=
view
.
findViewById
(
R
.
id
.
closeBtnLogin
);
bar
=
view
.
findViewById
(
R
.
id
.
progressLogin
);
forgot
=
view
.
findViewById
(
R
.
id
.
forgotPwd
);
forgot
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
context
.
startActivity
(
new
Intent
(
context
,
ForgotPasswordActivity
.
class
));
getActivity
().
finish
();
}
});
// set progress bar gone
bar
.
setVisibility
(
View
.
GONE
);
...
...
@@ -108,6 +119,7 @@ public class LoginState extends BottomSheetDialogFragment {
sheetDialog
.
dismiss
();
});
return
sheetDialog
;
}
...
...
app/src/main/java/com/yono/messeripos/RegisterState.java
View file @
37a68ec9
package
com
.
yono
.
messeripos
;
import
android.annotation.SuppressLint
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -18,6 +19,7 @@ import android.widget.RelativeLayout;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.lifecycle.LifecycleOwner
;
import
androidx.lifecycle.Observer
;
import
com.google.android.material.bottomsheet.BottomSheetBehavior
;
import
com.google.android.material.bottomsheet.BottomSheetDialog
;
...
...
@@ -151,20 +153,37 @@ public class RegisterState extends BottomSheetDialogFragment {
}
});
final
LifecycleOwner
lifecycleOwner
=
this
;
registerButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
mainViewModels
.
postRegis
(
new
UsersModels
(
username
.
getText
().
toString
(),
email
.
getText
().
toString
(),
password
.
getText
().
toString
(),
repassword
.
getText
().
toString
()));
mainViewModels
.
postRegis
(
new
UsersModels
(
username
.
getText
().
toString
(),
email
.
getText
().
toString
(),
password
.
getText
().
toString
(),
repassword
.
getText
().
toString
())).
observe
(
lifecycleOwner
,
new
Observer
<
DataResponse
<
UsersModels
>>()
{
@Override
public
void
onChanged
(
DataResponse
<
UsersModels
>
usersModelsDataResponse
)
{
/**
* TAMABHAKN RESPONSE DLUH AGAR ADA PROGRESS DIALOGNYA
* KETIKA RESPONNYA SUCCESS MAKA PROGRESS DIalog diSMISS
* DAN ALERT ACTIVATE MUNCUL
* */
}
});
/**
* Jika tombol sign up ditekan
*
* kembali ke halaman login utama dengan Snackbar Cek Email*/
Snackbar
mySnackbar
=
Snackbar
.
make
(
view
,
"Cek Email Anda"
,
3000
);
mySnackbar
.
show
();
*
* kembali ke halaman login utama dengan Snackbar Cek Email
*
* Pakai bahasa inggris ya untuk responnya
*
* */
registerButton
.
setEnabled
(
false
);
}
});
// close btn is clicked
closeBtn
.
setOnClickListener
(
view12
->
{
Log
.
d
(
TAG
,
"onCreateDialog: "
+
sheetBehavior2
.
getState
());
...
...
@@ -174,5 +193,29 @@ public class RegisterState extends BottomSheetDialogFragment {
return
sheetDialog2
;
}
private
void
activateEmail
(
View
customLayout
)
{
utils
=
new
Utils
(
customLayout
);
utils
.
dialog
(
context
,
false
,
customLayout
,
"Please Verifiy Email"
,
"Please verify your email before login"
,
"close"
,
"verify"
)
.
show
();
utils
.
setListener
(
new
Utils
.
DialogListener
()
{
@Override
public
void
onClickDisimiss
(
AlertDialog
alertDialog
)
{
alertDialog
.
dismiss
();
}
@Override
public
void
onClickLink
(
AlertDialog
alertDialog
)
{
Intent
pm
=
getActivity
().
getPackageManager
().
getLaunchIntentForPackage
(
"com.google.android.gm"
);
if
(
pm
!=
null
)
{
startActivity
(
pm
);
getActivity
().
finish
();
}
}
});
}
}
app/src/main/java/com/yono/messeripos/adapter/PaymentAdapter.java
View file @
37a68ec9
...
...
@@ -2,6 +2,7 @@ package com.yono.messeripos.adapter;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.nfc.NfcAdapter
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -30,6 +31,9 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
private
ArrayList
<
PaymentResponse
>
paymentResponses
;
Context
context
;
int
getPosition
=
-
1
;
NfcAdapter
nfcAdapter
;
public
interface
PaymentListener
{
void
onSelectPayment
(
PaymentResponse
paymentResponse
);
...
...
@@ -41,9 +45,10 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
this
.
listener
=
listener
;
}
public
PaymentAdapter
(
ArrayList
<
PaymentResponse
>
paymentResponses
,
PaymentActivity
mainActivity
)
{
public
PaymentAdapter
(
ArrayList
<
PaymentResponse
>
paymentResponses
,
Context
mainActivity
)
{
this
.
paymentResponses
=
paymentResponses
;
this
.
context
=
mainActivity
;
nfcAdapter
=
NfcAdapter
.
getDefaultAdapter
(
this
.
context
);
}
@NonNull
...
...
@@ -102,6 +107,13 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
public
void
binData
(
PaymentResponse
paymentResponse
){
binding
.
setPayment
(
paymentResponse
);
binding
.
setLogo
(
paymentResponse
.
getUrl
());
if
(
nfcAdapter
==
null
){
if
(
paymentResponse
.
getBank
()
==
"nfc"
){
binding
.
cvPayment
.
setVisibility
(
View
.
GONE
);
}
else
{
binding
.
cvPayment
.
setVisibility
(
View
.
VISIBLE
);
}
}
binding
.
cvPayment
.
setOnClickListener
(
view
->{
getPosition
=
getAdapterPosition
();
...
...
app/src/main/java/com/yono/messeripos/adapter/TransactionAdapter.java
View file @
37a68ec9
...
...
@@ -18,6 +18,7 @@ import com.yono.messeripos.models.PaymentsModels;
import
com.yono.messeripos.models.ProductCartModels
;
import
com.yono.messeripos.utils.Utils
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
public
class
TransactionAdapter
extends
RecyclerView
.
Adapter
<
TransactionAdapter
.
MyViewHolder
>
{
...
...
@@ -58,7 +59,11 @@ public class TransactionAdapter extends RecyclerView.Adapter<TransactionAdapter.
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
O
)
@Override
public
void
onBindViewHolder
(
@NonNull
TransactionAdapter
.
MyViewHolder
holder
,
int
position
)
{
try
{
holder
.
binData
(
paymentsModels
.
get
(
position
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
@Override
...
...
@@ -77,7 +82,7 @@ public class TransactionAdapter extends RecyclerView.Adapter<TransactionAdapter.
@SuppressLint
(
"ResourceAsColor"
)
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
O
)
public
void
binData
(
PaymentsModels
paymentsModels
)
{
public
void
binData
(
PaymentsModels
paymentsModels
)
throws
ParseException
{
itemHistoryBinding
.
setTransaction
(
paymentsModels
);
itemHistoryBinding
.
setDate
(
utils
.
convertDate
(
paymentsModels
.
getUpdatedAt
()));
itemHistoryBinding
.
cvHistory
.
setOnClickListener
(
view
->
listener
.
onShowDetail
(
paymentsModels
));
...
...
app/src/main/java/com/yono/messeripos/models/ProductModels.java
View file @
37a68ec9
...
...
@@ -39,12 +39,14 @@ public class ProductModels<T> implements Parcelable {
@SerializedName
(
"category_id"
)
private
int
categoryProduct
;
protected
ProductModels
(
Parcel
in
)
{
idProduct
=
in
.
readInt
();
productName
=
in
.
readString
();
priceProduct
=
in
.
readInt
();
stockProduct
=
in
.
readInt
();
imageProduct
=
in
.
readString
();
categoryProduct
=
in
.
readInt
();
}
public
static
final
Creator
<
ProductModels
>
CREATOR
=
new
Creator
<
ProductModels
>()
{
...
...
@@ -141,6 +143,7 @@ public class ProductModels<T> implements Parcelable {
}
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
@@ -153,5 +156,6 @@ public class ProductModels<T> implements Parcelable {
parcel
.
writeInt
(
priceProduct
);
parcel
.
writeInt
(
stockProduct
);
parcel
.
writeString
(
imageProduct
);
parcel
.
writeInt
(
categoryProduct
);
}
}
app/src/main/java/com/yono/messeripos/transactiontab/TransactionSuccess.java
View file @
37a68ec9
...
...
@@ -71,6 +71,13 @@ public class TransactionSuccess extends Fragment {
}
});
transactionAdapter
.
setListener
(
new
TransactionAdapter
.
TransactionListener
()
{
@Override
public
void
onShowDetail
(
PaymentsModels
paymentsModels
)
{
}
});
return
v
;
}
...
...
app/src/main/java/com/yono/messeripos/utils/Utils.java
View file @
37a68ec9
...
...
@@ -27,12 +27,14 @@ import com.yono.messeripos.models.CategoryModels;
import
java.io.ByteArrayOutputStream
;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormatSymbols
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Date
;
import
java.util.Locale
;
import
java.util.TimeZone
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -101,18 +103,25 @@ public class Utils {
}
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
O
)
public
String
convertDate
(
String
date
){
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
)
.
withZone
(
ZoneId
.
of
(
"UTC"
));
LocalDateTime
localDateTime
=
LocalDateTime
.
parse
(
date
,
dateTimeFormatter
);
DateTimeFormatter
localFormatter
=
DateTimeFormatter
.
ofPattern
(
"EEEE, dd MM yyyy"
,
new
Locale
(
"id"
,
"ID"
));
String
localDate
=
localDateTime
.
format
(
localFormatter
);
return
localDate
;
public
String
convertDate
(
String
date
)
throws
ParseException
{
// DateTimeFormatter dateTimeFormatter =
// DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'")
// .withZone(ZoneId.of("UTC"));
//
// LocalDateTime localDateTime = LocalDateTime
// .parse(date, dateTimeFormatter);
//
// DateTimeFormatter localFormatter = DateTimeFormatter
// .ofPattern("EEEE, dd MM yyyy", new Locale("id", "ID"));
// String localDate = localDateTime.format(localFormatter);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
);
sdf
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
Date
tanggal
=
sdf
.
parse
(
date
);
SimpleDateFormat
outputFormat
=
new
SimpleDateFormat
(
"EEEE, dd MM yyyy "
,
Locale
.
ENGLISH
);
outputFormat
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"Asia/Jakarta"
));
return
outputFormat
.
format
(
tanggal
);
}
public
String
convertImageBase64File
(
String
pathname
){
...
...
@@ -123,7 +132,6 @@ public class Utils {
// options.inSampleSize = 3;
// options.inSampleSize = calculateInSampleSize(options, 20,20);
Bitmap
bitmap
=
BitmapFactory
.
decodeFile
(
pathname
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
20
,
baos
);
byte
[]
b
=
baos
.
toByteArray
();
...
...
@@ -147,7 +155,7 @@ public class Utils {
options
.
inSampleSize
=
calculateInSampleSize
(
options
,
500
,
500
);
Bitmap
bitmap
=
BitmapFactory
.
decodeResource
(
resource
,
id
,
options
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
5
0
,
baos
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
2
0
,
baos
);
String
encodeImage
=
Base64
.
encodeToString
(
b
,
Base64
.
DEFAULT
);
Log
.
i
(
"Count_encode"
,
"convertImageBase64Resource: "
+
bitmap
.
getByteCount
());
return
encodeImage
;
...
...
app/src/main/res/drawable/ic_baseline_delete_24.xml
View file @
37a68ec9
<vector
android:height=
"24dp"
android:tint=
"#
FC151B
"
<vector
android:height=
"24dp"
android:tint=
"#
fff
"
android:viewportHeight=
"24"
android:viewportWidth=
"24"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"@android:color/white"
android:pathData=
"M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"
/>
...
...
app/src/main/res/drawable/ic_baseline_edit_24.xml
View file @
37a68ec9
<vector
android:height=
"24dp"
android:tint=
"#
34C25B
"
<vector
android:height=
"24dp"
android:tint=
"#
fff
"
android:viewportHeight=
"24"
android:viewportWidth=
"24"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"@android:color/white"
android:pathData=
"M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
/>
...
...
app/src/main/res/layout/activity_detail_transaction.xml
0 → 100644
View file @
37a68ec9
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
>
<include
android:id=
"@+id/appbarDetail"
layout=
"@layout/app_bar"
/>
<com.google.android.material.card.MaterialCardView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/appbarDetail"
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/jenisTransfer"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:text=
""
android:textColor=
"@android:color/black"
android:textSize=
"18sp"
tools:text=
"@tools:sample/full_names"
/>
<TextView
android:id=
"@+id/statusPayment"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:text=
""
android:textSize=
"12sp"
android:textColor=
"@android:color/black"
tools:text=
"@tools:sample/full_names"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_forgot_password.xml
View file @
37a68ec9
...
...
@@ -4,7 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@
drawable/background_login
"
>
android:background=
"@
color/colorPrimary
"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
...
...
@@ -93,7 +93,7 @@
android:id=
"@+id/btn_reset_password"
android:layout_marginTop=
"30dp"
android:src=
"@drawable/ic_arrow_forward_black_24dp"
android:background=
"@
drawable/button_background
"
android:background=
"@
color/colorPrimary
"
android:layout_marginEnd=
"30dp"
/>
...
...
@@ -113,7 +113,7 @@
android:layout_marginRight=
"40dp"
android:layout_marginBottom=
"20dp"
android:id=
"@+id/btn_back"
android:background=
"@
drawable/button_background
"
android:background=
"@
color/colorPrimary
"
android:text=
"@string/btn_back"
android:textColor=
"@android:color/white"
/>
...
...
app/src/main/res/layout/forgot_password_code.xml
View file @
37a68ec9
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_height=
"match_parent"
android:layout_width=
"match_parent"
>
<RelativeLayout
android:id=
"@+id/fpCode"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:padding=
"16dp"
>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<EditText
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -16,6 +31,7 @@
android:maxLines=
"1"
android:gravity=
"center"
android:padding=
"20dp"
android:nextFocusRight=
"@id/edit_text_2"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/edit_text_2"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
@@ -30,6 +46,7 @@
android:maxLength=
"1"
android:maxLines=
"1"
android:gravity=
"center"
android:nextFocusRight=
"@id/edit_text_3"
android:padding=
"20dp"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/edit_text_3"
...
...
@@ -46,6 +63,7 @@
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"
...
...
@@ -67,4 +85,8 @@
app:layout_constraintStart_toEndOf=
"@id/edit_text_3"
tools:ignore=
"Autofill,LabelFor"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/form_product.xml
View file @
37a68ec9
...
...
@@ -23,7 +23,7 @@
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
android:paddingTop=
"20dp"
android:background=
"@
drawable/gradient
"
android:background=
"@
color/colorPrimary
"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
app/src/main/res/layout/item_category.xml
View file @
37a68ec9
...
...
@@ -56,31 +56,33 @@
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
<
com.google.android.material.button.Material
Button
<
Image
Button
android:id=
"@+id/categoryDelete"
android:layout_width=
"0dp"
android:layout_height=
"40dp"
android:backgroundTint=
"@android:color/holo_red_dark"
android:text=
"DELETE"
android:src=
"@drawable/ic_baseline_delete_24"
android:textAlignment=
"textStart"
android:textSize=
"10sp"
android:layout_marginEnd=
"2dp"
android:backgroundTint=
"#E53B3B"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/cvCategory"
app:layout_constraint
Vertical_bias=
"0.0"
/>
app:layout_constraint
End_toStartOf=
"@id/categoryUpdate"
/>
<
com.google.android.material.button.Material
Button
<
Image
Button
android:id=
"@+id/categoryUpdate"
android:layout_width=
"0dp"
android:layout_height=
"40dp"
android:backgroundTint=
"@color/colorGreen"
android:text=
"UPDATE"
android:src=
"@drawable/ic_baseline_edit_24"
android:textAlignment=
"textEnd"
android:textSize=
"10sp"
android:backgroundTint=
"#4CAF50"
android:layout_marginStart=
"2dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/cvCategory"
app:layout_constraint
Vertical_bias=
"0.0
"
/>
app:layout_constraint
Start_toEndOf=
"@id/categoryDelete
"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
...
...
app/src/main/res/layout/methode_payment.xml
0 → 100644
View file @
37a68ec9
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<include
layout=
"@layout/app_bar"
android:id=
"@+id/appBarPaymentMethode"
/>
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvPayment"
android:clickable=
"true"
android:focusable=
"true"
android:checkable=
"true"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
app:layout_constraintTop_toBottomOf=
"@id/appBarPaymentMethode"
app:strokeWidth=
"1dp"
app:strokeColor=
"@color/color_stroke"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"15dp"
>
<ImageView
android:id=
"@+id/ivLogo"
android:layout_width=
"120dp"
android:layout_height=
"0dp"
android:src=
"@drawable/ic_bni_logo"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<RadioButton
android:id=
"@+id/rbPayment"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:buttonTint=
"@color/colorPrimary"
android:enabled=
"false"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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