오윤석

고유번호 확인 추가 (123456 하드코딩)

......@@ -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() {
btnEnter.setOnClickListener(new View.OnClickListener() {
imgEnter.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();
}
}
}
});
......
......@@ -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"
......