diff --git a/app/src/main/java/com/example/citrusclient/views/SignUpActivity.java b/app/src/main/java/com/example/citrusclient/views/SignUpActivity.java index f62348f..47eb235 100644 --- a/app/src/main/java/com/example/citrusclient/views/SignUpActivity.java +++ b/app/src/main/java/com/example/citrusclient/views/SignUpActivity.java @@ -4,6 +4,7 @@ import android.os.Bundle; import android.os.Handler; import android.view.View; +import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -75,13 +76,20 @@ EditText editpw = (EditText) findViewById(R.id.put_pw); String pw = editpw.getText().toString().trim(); final Handler handler = new Handler(); + System.out.println("テスト入力完了"); + + //入力した文字に空白が含まれている場合 + if(id.contains(" ") || pw.contains(" ")){ + System.out.println("不適切入力"); + ((TextView)findViewById(R.id.textView_respons)).setText("空白を含まないように入力してください"); + } //入力欄が空欄の時 - if(id.isEmpty() && pw.isEmpty() && id.trim().isEmpty() && pw.trim().isEmpty()){ + if(id.isEmpty() || pw.isEmpty() || id.trim().isEmpty() || pw.trim().isEmpty() ){ System.out.println("不適切入力"); ((TextView)findViewById(R.id.textView_respons)).setText("適切に入力してください"); - }else if(!id.isEmpty() && !pw.isEmpty() && !id.trim().isEmpty() && !pw.trim().isEmpty() ){ + }else if(!id.isEmpty() && !pw.isEmpty() && !id.trim().isEmpty() && !pw.trim().isEmpty() && !id.contains(" ") && !pw.contains(" ") ){ //入力欄が全て適切に入力された場合の処理 Call call = accountsRest.signup(id,pw); call.enqueue(new Callback() { @@ -124,7 +132,14 @@ } }); - + //ボタンを押してlogin画面に遷移 + Button button_login = (Button) findViewById(R.id.button_login); + button_login.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(SignUpActivity.this,LoginActivity.class); + startActivity(intent); + } + }); } - } \ No newline at end of file