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
bf527c11
Commit
bf527c11
authored
Sep 03, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update main
parent
c6c27f3b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
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
LocalDatabase.java
...main/java/com/yono/messeripos/database/LocalDatabase.java
+2
-1
No files found.
app/src/main/java/com/yono/messeripos/LoginState.java
View file @
bf527c11
...
@@ -116,11 +116,13 @@ public class LoginState extends BottomSheetDialogFragment {
...
@@ -116,11 +116,13 @@ public class LoginState extends BottomSheetDialogFragment {
TextUtils
.
isEmpty
(
password
.
getText
().
toString
())){
TextUtils
.
isEmpty
(
password
.
getText
().
toString
())){
username
.
setError
(
"This field can't empty"
);
username
.
setError
(
"This field can't empty"
);
password
.
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"
);
username
.
setError
(
"This field can't empty"
);
}
else
if
(
TextUtils
.
isEmpty
(
password
.
getText
().
toString
())){
}
else
if
(
TextUtils
.
isEmpty
(
password
.
getText
().
toString
())){
password
.
setError
(
"This field can't empty"
);
password
.
setError
(
"This field can't empty"
);
}
else
{
}
else
{
/**
/**
* Jika tombol sign in ditekan
* Jika tombol sign in ditekan
*
*
...
...
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
bf527c11
...
@@ -8,6 +8,7 @@ import android.content.Intent;
...
@@ -8,6 +8,7 @@ import android.content.Intent;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.service.controls.actions.ModeAction
;
import
android.service.controls.actions.ModeAction
;
import
android.text.Editable
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.text.TextWatcher
;
...
@@ -18,6 +19,8 @@ import android.view.MenuItem;
...
@@ -18,6 +19,8 @@ import android.view.MenuItem;
import
android.view.View
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -68,7 +71,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -68,7 +71,7 @@ public class MainActivity extends AppCompatActivity {
CategoryAdapter
categoryAdapter
;
CategoryAdapter
categoryAdapter
;
ProductAdapter
productAdapter
;
ProductAdapter
productAdapter
;
Utils
utils
=
new
Utils
();
Utils
utils
=
new
Utils
();
SharedPreferences
sharedPreferences
;
SharedPreferences
sharedPreferences
,
sharedPreferencesLogin
;
public
static
Boolean
status_update
=
false
;
public
static
Boolean
status_update
=
false
;
MainViewModelsCart
mainViewModelsCart
;
MainViewModelsCart
mainViewModelsCart
;
public
static
Boolean
cartIsEmpty
;
public
static
Boolean
cartIsEmpty
;
...
@@ -108,6 +111,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -108,6 +111,7 @@ public class MainActivity extends AppCompatActivity {
productAdapter
=
new
ProductAdapter
();
productAdapter
=
new
ProductAdapter
();
mainViewModelsCart
=
new
ViewModelProvider
(
MainActivity
.
this
).
get
(
MainViewModelsCart
.
class
);
mainViewModelsCart
=
new
ViewModelProvider
(
MainActivity
.
this
).
get
(
MainViewModelsCart
.
class
);
sharedPreferences
=
getSharedPreferences
(
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
sharedPreferences
=
getSharedPreferences
(
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
sharedPreferencesLogin
=
getSharedPreferences
(
SplashScreen
.
MY_SHARED_PREFERENCES
,
Context
.
MODE_PRIVATE
);
checkout
=
sharedPreferences
.
getBoolean
(
CHECKOUT
,
false
);
checkout
=
sharedPreferences
.
getBoolean
(
CHECKOUT
,
false
);
orderId
=
sharedPreferences
.
getString
(
ORDER_ID
,
""
);
orderId
=
sharedPreferences
.
getString
(
ORDER_ID
,
""
);
progressDialog
=
new
ProgressDialog
(
MainActivity
.
this
);
progressDialog
=
new
ProgressDialog
(
MainActivity
.
this
);
...
@@ -178,6 +182,19 @@ public class MainActivity extends AppCompatActivity {
...
@@ -178,6 +182,19 @@ public class MainActivity extends AppCompatActivity {
startActivity
(
new
Intent
(
getApplicationContext
(),
FormProductActivity
.
class
));
startActivity
(
new
Intent
(
getApplicationContext
(),
FormProductActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
allTransaction
){
}
else
if
(
id
==
R
.
id
.
allTransaction
){
startActivity
(
new
Intent
(
getApplicationContext
(),
TransactionActivity
.
class
));
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
;
return
true
;
}
}
...
...
app/src/main/java/com/yono/messeripos/database/LocalDatabase.java
View file @
bf527c11
...
@@ -12,12 +12,13 @@ import androidx.sqlite.db.SupportSQLiteOpenHelper;
...
@@ -12,12 +12,13 @@ import androidx.sqlite.db.SupportSQLiteOpenHelper;
import
com.yono.messeripos.daos.CartDaos
;
import
com.yono.messeripos.daos.CartDaos
;
import
com.yono.messeripos.daos.PaymentPendingDaos
;
import
com.yono.messeripos.daos.PaymentPendingDaos
;
import
com.yono.messeripos.models.PaymentPending
;
import
com.yono.messeripos.models.ProductCartModels
;
import
com.yono.messeripos.models.ProductCartModels
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
@Database
(
entities
=
{
ProductCartModels
.
class
},
version
=
1
,
exportSchema
=
false
)
@Database
(
entities
=
{
ProductCartModels
.
class
,
PaymentPending
.
class
},
version
=
1
,
exportSchema
=
false
)
public
abstract
class
LocalDatabase
extends
RoomDatabase
{
public
abstract
class
LocalDatabase
extends
RoomDatabase
{
public
abstract
CartDaos
cartDaos
();
public
abstract
CartDaos
cartDaos
();
...
...
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