diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/SignUpFragment.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/SignUpFragment.java index 19df6e1..fa298ae 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/SignUpFragment.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/views/SignUpFragment.java @@ -10,6 +10,7 @@ import android.widget.Button; import android.widget.EditText; import android.widget.Toast; + import net.arnx.jsonic.JSON; import net.arnx.jsonic.TypeReference; @@ -45,35 +46,32 @@ FragmentManager manager = getFragmentManager(); FragmentTransaction transaction = manager.beginTransaction(); - transaction.addToBackStack(null); - //transaction.replace(R.id.fragment_place, new LoginFragment()); transaction.replace(R.id.framelayout_place, new LoginFragment()); - transaction.commit(); } }); //サインアップ Button signUpButton = (Button) getActivity().findViewById(R.id.signUp2); - signUpButton.setOnClickListener(new View.OnClickListener(){ + signUpButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - EditText inputPassword = (EditText)getActivity().findViewById(R.id.inputPassword2); - EditText checkPassWord = (EditText)getActivity().findViewById(R.id.checkPassword); - EditText inputUserName = (EditText)getActivity().findViewById(R.id.inputUserName); - EditText inputUserID = (EditText)getActivity().findViewById(R.id.inputUserID); + EditText inputPassword = (EditText) getActivity().findViewById(R.id.inputPassword2); + EditText checkPassWord = (EditText) getActivity().findViewById(R.id.checkPassword); + EditText inputUserName = (EditText) getActivity().findViewById(R.id.inputUserName); + EditText inputUserID = (EditText) getActivity().findViewById(R.id.inputUserID); - if(inputUserID.getText().toString().contains(" ") || inputUserID.getText().toString().contains(" ")){ + if (inputUserID.getText().toString().contains(" ") || inputUserID.getText().toString().contains(" ")) { Toast.makeText(getActivity(), "空白の含むIDは登録できません", Toast.LENGTH_SHORT).show(); - }else if (inputPassword.getText().toString().isEmpty()) { + } else if (inputPassword.getText().toString().isEmpty()) { Toast.makeText(getActivity(), "パスワードを入力してください", Toast.LENGTH_SHORT).show(); } else if (checkPassWord.getText().toString().isEmpty()) { Toast.makeText(getActivity(), "確認用パスワードを入力してください", Toast.LENGTH_SHORT).show(); - } else if (!inputPassword.getText().toString().equals(checkPassWord.getText().toString() )) { + } else if (!inputPassword.getText().toString().equals(checkPassWord.getText().toString())) { Toast.makeText(getActivity(), "パスワードが一致しません", Toast.LENGTH_SHORT).show(); - }else{ + } else { connection = new SignUpFragmentConnection(); connection.setCallBack(new CallBack() { @@ -81,11 +79,12 @@ public void onResponse(String response) { //通信した時の処理を書くのだよ URIAddressedAccount ac = JSON.decode(response, URIAddressedAccount.class); - URIAddressedAccount ac2 = JSON.decode(response, new TypeReference(){}); - System.out.println("JSON.decode(response, URIAddressedAccount.class);\n"+ac.getUri()); - System.out.println("JSON.decode(response, new TypeReference(){});\n"+ac2.getUri()); + URIAddressedAccount ac2 = JSON.decode(response, new TypeReference() { + }); + System.out.println("JSON.decode(response, URIAddressedAccount.class);\n" + ac.getUri()); + System.out.println("JSON.decode(response, new TypeReference(){});\n" + ac2.getUri()); System.out.println(response); - Toast.makeText(getActivity(),response, Toast.LENGTH_SHORT).show(); + Toast.makeText(getActivity(), response, Toast.LENGTH_SHORT).show(); } });