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
308655a7
Commit
308655a7
authored
Sep 03, 2020
by
fauzi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into cart
parents
d18e8230
bf527c11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
LoginState.java
app/src/main/java/com/yono/messeripos/LoginState.java
+4
-2
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+18
-1
No files found.
app/src/main/java/com/yono/messeripos/LoginState.java
View file @
308655a7
...
...
@@ -115,11 +115,13 @@ public class LoginState extends BottomSheetDialogFragment {
TextUtils
.
isEmpty
(
password
.
getText
().
toString
())){
username
.
setError
(
"This field can't empty"
);
password
.
setError
(
"This field can't empty"
);
}
else
if
(
TextUtils
.
isEmpty
(
username
.
getText
().
toString
())){
}
else
if
(
TextUtils
.
isEmpty
(
username
.
getText
().
toString
()))
{
username
.
setError
(
"This field can't empty"
);
}
else
if
(
TextUtils
.
isEmpty
(
password
.
getText
().
toString
())){
password
.
setError
(
"This field can't empty"
);
}
else
{
}
else
{
/**
* Jika tombol sign in ditekan
*
...
...
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
308655a7
...
...
@@ -8,6 +8,7 @@ import android.content.Intent;
import
android.content.SharedPreferences
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.service.controls.actions.ModeAction
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
...
...
@@ -18,6 +19,8 @@ import android.view.MenuItem;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
...
...
@@ -68,7 +71,7 @@ public class MainActivity extends AppCompatActivity {
CategoryAdapter
categoryAdapter
;
ProductAdapter
productAdapter
;
Utils
utils
=
new
Utils
();
SharedPreferences
sharedPreferences
;
SharedPreferences
sharedPreferences
,
sharedPreferencesLogin
;
public
static
Boolean
status_update
=
false
;
MainViewModelsCart
mainViewModelsCart
;
public
static
Boolean
cartIsEmpty
;
...
...
@@ -108,6 +111,7 @@ public class MainActivity extends AppCompatActivity {
productAdapter
=
new
ProductAdapter
();
mainViewModelsCart
=
new
ViewModelProvider
(
MainActivity
.
this
).
get
(
MainViewModelsCart
.
class
);
sharedPreferences
=
getSharedPreferences
(
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
sharedPreferencesLogin
=
getSharedPreferences
(
SplashScreen
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
checkout
=
sharedPreferences
.
getBoolean
(
CHECKOUT
,
false
);
orderId
=
sharedPreferences
.
getString
(
ORDER_ID
,
""
);
progressDialog
=
new
ProgressDialog
(
MainActivity
.
this
);
...
...
@@ -178,6 +182,19 @@ public class MainActivity extends AppCompatActivity {
startActivity
(
new
Intent
(
getApplicationContext
(),
FormProductActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
allTransaction
){
startActivity
(
new
Intent
(
getApplicationContext
(),
TransactionActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
logout
){
progressDialog
.
show
();
SharedPreferences
.
Editor
editor
=
sharedPreferencesLogin
.
edit
();
editor
.
putBoolean
(
SplashScreen
.
SESSION
,
false
);
if
(
editor
.
commit
()){
new
Handler
().
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
startActivity
(
new
Intent
(
MainActivity
.
this
,
LoginActivity
.
class
));
finish
();
}
},
700
);
}
}
return
true
;
}
...
...
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