Toggle navigation
Toggle navigation
This project
Loading...
Sign in
cse437_e
/
smartdoorlock-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오윤석
2020-11-01 09:42:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cd601ef9632af52be29c78e3da5e4ceded5a3c45
cd601ef9
1 parent
1e02e594
고유번호 확인 추가 (123456 하드코딩)
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
app/src/main/java/com/sunnni/smartdoorlock/ui/SplashActivity.java
app/src/main/res/layout/activity_splash.xml
app/src/main/java/com/sunnni/smartdoorlock/ui/SplashActivity.java
View file @
cd601ef
...
...
@@ -11,6 +11,7 @@ import android.view.View;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
...
...
@@ -24,6 +25,7 @@ public class SplashActivity extends AppCompatActivity {
private
TextInputLayout
textInputLayout
;
private
TextInputEditText
edtSuperKey
;
private
ConstraintLayout
btnEnter
;
private
ImageView
imgEnter
;
private
Animation
logoAnimation
;
...
...
@@ -36,6 +38,7 @@ public class SplashActivity extends AppCompatActivity {
textInputLayout
=
findViewById
(
R
.
id
.
til_super_key
);
btnEnter
=
findViewById
(
R
.
id
.
cl_enter
);
edtSuperKey
=
findViewById
(
R
.
id
.
edt_super_key
);
imgEnter
=
findViewById
((
R
.
id
.
img_enter
));
logoAnimation
=
AnimationUtils
.
loadAnimation
(
this
,
R
.
anim
.
anim_bottom_up
);
...
...
@@ -57,13 +60,19 @@ public class SplashActivity extends AppCompatActivity {
}
private
void
init
()
{
btn
Enter
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
img
Enter
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
edtSuperKey
.
toString
().
isEmpty
()){
Log
.
d
(
"empty"
,
"true"
);
String
text
=
edtSuperKey
.
getText
().
toString
();
if
(
""
.
equals
(
text
)){
Toast
.
makeText
(
getApplicationContext
(),
"고유번호를 입력해주세요."
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
// main 화면으로 이동
// TODO : API 연결
if
(
"123456"
.
equals
(
text
))
{
startActivity
(
new
Intent
(
SplashActivity
.
this
,
MainActivity
.
class
));
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
"고유번호를 확인해주세요."
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
});
...
...
app/src/main/res/layout/activity_splash.xml
View file @
cd601ef
...
...
@@ -88,6 +88,7 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/img_enter"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/baseline_send_white_24"
...
...
Please
register
or
login
to post a comment