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
1e073fe5
Commit
1e073fe5
authored
Aug 31, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
5b656e25
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
LoginActivity.java
app/src/main/java/com/yono/messeripos/LoginActivity.java
+1
-1
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+3
-3
No files found.
app/src/main/java/com/yono/messeripos/LoginActivity.java
View file @
1e073fe5
...
...
@@ -75,7 +75,7 @@ public class LoginActivity extends AppCompatActivity {
public
void
onChanged
(
DataResponse
<
UsersModels
>
usersModelsDataResponse
)
{
Log
.
d
(
"Status"
,
usersModelsDataResponse
.
getMessageData
());
if
(
!
usersModelsDataResponse
.
getMessageData
().
equals
(
"Login Failed"
)){
if
(
usersModelsDataResponse
.
getStatusData
(
)){
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
editor
.
putBoolean
(
SplashScreen
.
SESSION
,
true
);
editor
.
commit
();
...
...
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
1e073fe5
...
...
@@ -116,7 +116,7 @@ public class MainActivity extends AppCompatActivity {
toolbar
=
findViewById
(
R
.
id
.
topAppBar
);
mainViewModels
=
ViewModelProviders
.
of
(
this
).
get
(
MainViewModels
.
class
);
if
(
orderId
.
isEmpty
())
if
(
sharedPreferences
.
getString
(
ORDER_ID
,
""
)
.
isEmpty
())
{
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
editor
.
putString
(
ORDER_ID
,
"MES-ORDER"
+
utils
.
timeStamp
());
...
...
@@ -307,13 +307,13 @@ public class MainActivity extends AppCompatActivity {
@Override
public
void
onAddCart
(
ProductModels
product
)
{
mainViewModelsCart
.
checkOrderProduct
(
product
.
getIdProduct
(),
orderId
).
observe
(
MainActivity
.
this
,
new
Observer
<
List
<
ProductCartModels
>>()
{
mainViewModelsCart
.
checkOrderProduct
(
product
.
getIdProduct
(),
sharedPreferences
.
getString
(
ORDER_ID
,
""
)
).
observe
(
MainActivity
.
this
,
new
Observer
<
List
<
ProductCartModels
>>()
{
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
N
)
@Override
public
void
onChanged
(
List
<
ProductCartModels
>
productCartModels
)
{
if
(
productCartModels
.
isEmpty
()
&&
cartIsEmpty
){
mainViewModelsCart
.
insertCart
(
new
ProductCartModels
(
orderId
,
sharedPreferences
.
getString
(
ORDER_ID
,
""
)
,
1
,
product
.
getIdProduct
(),
product
.
getProductName
(),
...
...
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