diff --git a/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java b/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java index c7c74de..91b5e0f 100644 --- a/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java @@ -33,7 +33,7 @@ //各種IDを取得 SigninButton = findViewById(R.id.SigninButton); Button SignupButton = findViewById(R.id.SignupButton); - final EditText NameText = findViewById(R.id.NameText); + final EditText UserIdText = findViewById(R.id.UserIdText); final EditText PasswordText = findViewById(R.id.PasswordText); Button ForgotPasswordButton = findViewById(R.id.ForgotPasswordButton); @@ -41,7 +41,7 @@ SigninButton.setEnabled(false); //TextWatcherで入力監視 - NameText.addTextChangedListener(new SigninActivity.GenericTextWatcher(NameText)); + UserIdText.addTextChangedListener(new SigninActivity.GenericTextWatcher(UserIdText)); PasswordText.addTextChangedListener(new SigninActivity.GenericTextWatcher(PasswordText)); //retrofitの処理 @@ -57,7 +57,7 @@ @Override public void onClick(View v) { //APIに値を送信 - Call call = signinService.loginList(NameText.getText().toString(), PasswordText.getText().toString()); + Call call = signinService.loginList(UserIdText.getText().toString(), PasswordText.getText().toString()); //サーバからのレスポンス call.enqueue(new Callback() { @@ -66,13 +66,15 @@ public void onResponse(Call call, Response response) { if (response.isSuccessful()) { SigninResponse result = response.body(); + + //app/Cosmosに情報保存 Cosmos app = (Cosmos)getApplication(); app.setToken(result.token); + Intent intent = new Intent(getApplication(), GroupList.class); + startActivity(intent); Toast.makeText(SigninActivity.this, "ログインしました", Toast.LENGTH_SHORT).show(); - - startActivity(intent); finish(); }else{ @@ -129,7 +131,7 @@ @Override public void afterTextChanged(Editable s){ switch(view.getId()) { - case R.id.NameText: + case R.id.UserIdText: if (s.length() > 0) { uIdEnable = true; } else { @@ -145,7 +147,7 @@ break; } //ボタン有効&無効 - if(uIdEnable && pwEnable ){ + if(uIdEnable && pwEnable){ SigninButton.setEnabled(true); }else{ SigninButton.setEnabled(false);