Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
Your Cashier
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
Ahmad Abi Mulya
Your Cashier
Commits
df0dab5d
Commit
df0dab5d
authored
Aug 28, 2020
by
Wahyu Wibowo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.mdd.co.id:44195/abimulya/your-cashier
into wahyu
parents
aae7d551
6b18875d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
31 deletions
+5
-31
ForgetPassword.java
...om/example/yourcashiertest/activities/ForgetPassword.java
+1
-0
LoginActivity.java
...com/example/yourcashiertest/activities/LoginActivity.java
+2
-5
activity_forget_password.xml
app/src/main/res/layout/activity_forget_password.xml
+1
-25
activity_login.xml
app/src/main/res/layout/activity_login.xml
+1
-1
No files found.
app/src/main/java/com/example/yourcashiertest/activities/ForgetPassword.java
View file @
df0dab5d
...
@@ -48,6 +48,7 @@ public class ForgetPassword extends AppCompatActivity {
...
@@ -48,6 +48,7 @@ public class ForgetPassword extends AppCompatActivity {
userViewModel
.
resetPassword
(
users
.
get
(
i
).
getId
()
,
password
);
userViewModel
.
resetPassword
(
users
.
get
(
i
).
getId
()
,
password
);
binding
.
setLoading
(
false
);
binding
.
setLoading
(
false
);
startActivity
(
new
Intent
(
ForgetPassword
.
this
,
LoginActivity
.
class
));
startActivity
(
new
Intent
(
ForgetPassword
.
this
,
LoginActivity
.
class
));
finish
();
return
;
return
;
}
}
}
}
...
...
app/src/main/java/com/example/yourcashiertest/activities/LoginActivity.java
View file @
df0dab5d
...
@@ -32,9 +32,7 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -32,9 +32,7 @@ public class LoginActivity extends AppCompatActivity {
checkSession
();
checkSession
();
finish
();
finish
();
}
}
viewModel
=
new
ViewModelProvider
(
this
,
new
ViewModelProvider
.
NewInstanceFactory
()).
get
(
UserViewModel
.
class
);
viewModel
=
new
ViewModelProvider
(
this
,
new
ViewModelProvider
.
NewInstanceFactory
()).
get
(
UserViewModel
.
class
);
binding
.
btnLogin
.
setOnClickListener
(
view
->
{
binding
.
btnLogin
.
setOnClickListener
(
view
->
{
if
(
binding
.
etUsername
.
getText
().
toString
().
length
()
==
0
||
binding
.
etPassword
.
getText
().
toString
().
length
()
==
0
){
if
(
binding
.
etUsername
.
getText
().
toString
().
length
()
==
0
||
binding
.
etPassword
.
getText
().
toString
().
length
()
==
0
){
Toast
.
makeText
(
getApplicationContext
(),
"Please input Username and Password"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"Please input Username and Password"
,
Toast
.
LENGTH_SHORT
).
show
();
...
@@ -49,11 +47,9 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -49,11 +47,9 @@ public class LoginActivity extends AppCompatActivity {
}
}
});
});
}
}
public
void
tvForgetPassword
(
View
view
)
{
public
void
tvForgetPassword
(
View
view
)
{
startActivity
(
new
Intent
(
LoginActivity
.
this
,
ForgetPassword
.
class
));
startActivity
(
new
Intent
(
LoginActivity
.
this
,
ForgetPassword
.
class
));
}
}
public
void
tvSignUpHere
(
View
view
)
{
public
void
tvSignUpHere
(
View
view
)
{
startActivity
(
new
Intent
(
LoginActivity
.
this
,
RegisterActivity
.
class
));
startActivity
(
new
Intent
(
LoginActivity
.
this
,
RegisterActivity
.
class
));
}
}
...
@@ -70,7 +66,8 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -70,7 +66,8 @@ public class LoginActivity extends AppCompatActivity {
return
;
return
;
}
}
}
}
Toast
.
makeText
(
LoginActivity
.
this
,
"User tidak ditemukan"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
LoginActivity
.
this
,
"User Not Found!"
,
Toast
.
LENGTH_LONG
).
show
();
binding
.
setLoading
(
false
);
return
;
return
;
});
});
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
app/src/main/res/layout/activity_forget_password.xml
View file @
df0dab5d
...
@@ -53,30 +53,6 @@
...
@@ -53,30 +53,6 @@
android:textSize=
"@dimen/text_default"
/>
android:textSize=
"@dimen/text_default"
/>
</com.google.android.material.textfield.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilCrPw"
app:passwordToggleEnabled=
"true"
app:boxBackgroundColor=
"@color/white"
android:textColorHint=
"@color/grey"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/tilEmail"
android:layout_marginTop=
"20dp"
android:layout_marginStart=
"@dimen/space_default"
android:layout_marginEnd=
"@dimen/space_default"
android:layout_marginBottom=
"@dimen/space_default"
>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/etCrPw"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"Current Password"
android:imeOptions=
"actionNext"
android:inputType=
"text"
android:textSize=
"@dimen/text_default"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilNewPw"
android:id=
"@+id/tilNewPw"
app:passwordToggleEnabled=
"true"
app:passwordToggleEnabled=
"true"
...
@@ -85,7 +61,7 @@
...
@@ -85,7 +61,7 @@
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"
app:layout_constraintTop_toBottomOf=
"@id/til
CrPw
"
app:layout_constraintTop_toBottomOf=
"@id/til
Email
"
android:layout_marginTop=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginStart=
"@dimen/space_default"
android:layout_marginStart=
"@dimen/space_default"
android:layout_marginEnd=
"@dimen/space_default"
android:layout_marginEnd=
"@dimen/space_default"
...
...
app/src/main/res/layout/activity_login.xml
View file @
df0dab5d
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
android:id=
"@+id/tvDontHaveAnAccount"
android:id=
"@+id/tvDontHaveAnAccount"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"
4
0dp"
android:layout_marginStart=
"
5
0dp"
android:text=
"@string/dont_have_an_account"
android:text=
"@string/dont_have_an_account"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/tvSignUpHere"
app:layout_constraintEnd_toStartOf=
"@id/tvSignUpHere"
...
...
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