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
66bd6084
Commit
66bd6084
authored
Aug 24, 2020
by
Wahyu Wibowo
Browse files
Options
Browse Files
Download
Plain Diff
add login
parents
d7d90432
feacd68e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
1 deletion
+123
-1
LoginActivity.java
...com/example/yourcashiertest/activities/LoginActivity.java
+38
-0
LocalDatabase.java
.../com/example/yourcashiertest/databases/LocalDatabase.java
+1
-1
edit_text.xml
app/src/main/res/drawable/edit_text.xml
+4
-0
activity_login.xml
app/src/main/res/layout/activity_login.xml
+80
-0
No files found.
app/src/main/java/com/example/yourcashiertest/activities/LoginActivity.java
0 → 100644
View file @
66bd6084
package
com
.
example
.
yourcashiertest
.
activities
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
com.example.yourcashiertest.R
;
import
com.google.android.material.button.MaterialButton
;
import
com.google.android.material.textfield.TextInputEditText
;
public
class
LoginActivity
extends
AppCompatActivity
{
TextInputEditText
etUsername
;
MaterialButton
btnLogin
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_login
);
etUsername
=
findViewById
(
R
.
id
.
etUsername
);
btnLogin
=
findViewById
(
R
.
id
.
btnLogin
);
btnLogin
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Intent
intent
=
new
Intent
(
LoginActivity
.
this
,
MainActivity
.
class
);
intent
.
putExtra
(
"username"
,
etUsername
.
getText
().
toString
());
startActivity
(
intent
);
finish
();
}
});
}
}
\ No newline at end of file
app/src/main/java/com/example/yourcashiertest/databases/LocalDatabase.java
View file @
66bd6084
...
...
@@ -56,4 +56,4 @@ public abstract class LocalDatabase extends RoomDatabase {
public
void
clearAllTables
()
{
}
}
\ No newline at end of file
}
app/src/main/res/drawable/edit_text.xml
0 → 100644
View file @
66bd6084
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
</selector>
\ No newline at end of file
app/src/main/res/layout/activity_login.xml
0 → 100644
View file @
66bd6084
<?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"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_margin=
"@dimen/space_default"
android:layout_height=
"match_parent"
tools:context=
".activities.LoginActivity"
>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/tvLogin"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"25dp"
android:layout_marginTop=
"80dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:textStyle=
"bold"
android:text=
"Login"
/>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilUsername"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@+id/tvLogin"
android:layout_marginTop=
"60dp"
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/etUsername"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"Masukkan username..."
android:inputType=
"textCapWords"
android:imeOptions=
"actionNext"
android:textSize=
"@dimen/text_default"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=
"@+id/tilPassword"
style=
"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@+id/tilUsername"
android:layout_marginStart=
"@dimen/space_default"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"@dimen/space_default"
android:layout_marginBottom=
"@dimen/space_default"
>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/etPassword"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"Masukkan password..."
android:inputType=
"textPassword"
android:textSize=
"@dimen/text_default"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id=
"@+id/btnLogin"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Login"
android:backgroundTint=
"@color/colorPrimary"
app:layout_constraintTop_toBottomOf=
"@+id/tilPassword"
android:layout_marginTop=
"60dp"
app:layout_constraintEnd_toEndOf=
"parent"
android:padding=
"@dimen/space_default"
app:cornerRadius=
"@dimen/space_default"
android:layout_marginEnd=
"@dimen/space_default"
/>
</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