Showing
2 changed files
with
14 additions
and
4 deletions
... | @@ -11,6 +11,7 @@ import android.view.View; | ... | @@ -11,6 +11,7 @@ import android.view.View; |
11 | import android.view.animation.Animation; | 11 | import android.view.animation.Animation; |
12 | import android.view.animation.AnimationUtils; | 12 | import android.view.animation.AnimationUtils; |
13 | import android.widget.Button; | 13 | import android.widget.Button; |
14 | +import android.widget.ImageView; | ||
14 | import android.widget.LinearLayout; | 15 | import android.widget.LinearLayout; |
15 | import android.widget.Toast; | 16 | import android.widget.Toast; |
16 | 17 | ||
... | @@ -24,6 +25,7 @@ public class SplashActivity extends AppCompatActivity { | ... | @@ -24,6 +25,7 @@ public class SplashActivity extends AppCompatActivity { |
24 | private TextInputLayout textInputLayout; | 25 | private TextInputLayout textInputLayout; |
25 | private TextInputEditText edtSuperKey; | 26 | private TextInputEditText edtSuperKey; |
26 | private ConstraintLayout btnEnter; | 27 | private ConstraintLayout btnEnter; |
28 | + private ImageView imgEnter; | ||
27 | 29 | ||
28 | private Animation logoAnimation; | 30 | private Animation logoAnimation; |
29 | 31 | ||
... | @@ -36,6 +38,7 @@ public class SplashActivity extends AppCompatActivity { | ... | @@ -36,6 +38,7 @@ public class SplashActivity extends AppCompatActivity { |
36 | textInputLayout = findViewById(R.id.til_super_key); | 38 | textInputLayout = findViewById(R.id.til_super_key); |
37 | btnEnter = findViewById(R.id.cl_enter); | 39 | btnEnter = findViewById(R.id.cl_enter); |
38 | edtSuperKey = findViewById(R.id.edt_super_key); | 40 | edtSuperKey = findViewById(R.id.edt_super_key); |
41 | + imgEnter = findViewById((R.id.img_enter)); | ||
39 | 42 | ||
40 | logoAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_bottom_up); | 43 | logoAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_bottom_up); |
41 | 44 | ||
... | @@ -57,13 +60,19 @@ public class SplashActivity extends AppCompatActivity { | ... | @@ -57,13 +60,19 @@ public class SplashActivity extends AppCompatActivity { |
57 | } | 60 | } |
58 | 61 | ||
59 | private void init() { | 62 | private void init() { |
60 | - btnEnter.setOnClickListener(new View.OnClickListener() { | 63 | + imgEnter.setOnClickListener(new View.OnClickListener() { |
61 | @Override | 64 | @Override |
62 | public void onClick(View v) { | 65 | public void onClick(View v) { |
63 | - if(edtSuperKey.toString().isEmpty()){ | 66 | + String text = edtSuperKey.getText().toString(); |
64 | - Log.d("empty", "true"); | 67 | + if("".equals(text)){ |
68 | + Toast.makeText(getApplicationContext(),"고유번호를 입력해주세요.",Toast.LENGTH_SHORT).show(); | ||
65 | } else { | 69 | } else { |
66 | - // main 화면으로 이동 | 70 | + // TODO : API 연결 |
71 | + if("123456".equals(text)) { | ||
72 | + startActivity(new Intent(SplashActivity.this, MainActivity.class)); | ||
73 | + } else { | ||
74 | + Toast.makeText(getApplicationContext(),"고유번호를 확인해주세요.",Toast.LENGTH_SHORT).show(); | ||
75 | + } | ||
67 | } | 76 | } |
68 | } | 77 | } |
69 | }); | 78 | }); | ... | ... |
... | @@ -88,6 +88,7 @@ | ... | @@ -88,6 +88,7 @@ |
88 | app:layout_constraintTop_toTopOf="parent" /> | 88 | app:layout_constraintTop_toTopOf="parent" /> |
89 | 89 | ||
90 | <ImageView | 90 | <ImageView |
91 | + android:id="@+id/img_enter" | ||
91 | android:layout_width="wrap_content" | 92 | android:layout_width="wrap_content" |
92 | android:layout_height="wrap_content" | 93 | android:layout_height="wrap_content" |
93 | android:src="@drawable/baseline_send_white_24" | 94 | android:src="@drawable/baseline_send_white_24" | ... | ... |
-
Please register or login to post a comment