diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 23617fa..a13acaf 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -7,11 +7,11 @@ - + - + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8803094..7339432 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -57,12 +57,12 @@ android:name=".LoginActivity" android:exported="true" android:label="@string/title_activity_login"> - - + + - - + + - - + + - - + + { - // ShopActivityでどこの店についての投稿かを管理できるように更新する - nemophila.setCurrentShop(shop); - - // ShopActivityへ画面遷移する - Intent intent = new Intent(getApplication(), ShopActivity.class); - startActivity(intent); - }); + // フィールド + Shop dummyShop = new Shop(); // 店の名前が入力されていればsidを発行し、新しくShopを生成 - Button shopCreateButton = findViewById(R.id.buttonShopCreate); - shopCreateButton.setOnClickListener(v -> { + Button transitionButton = findViewById(R.id.buttonTransitionPostActivity); + transitionButton.setOnClickListener(v -> { EditText nameTextBox = findViewById(R.id.editTextShopCreate); String name = nameTextBox.getText().toString(); // 店の名前を入力されているときのみ処理を行う if (!name.equals("")) { - shopsViewModel.createShop(name, nemophila.getCurrentLongitude(), nemophila.getCurrentLatitude()); - shopCreateButton.setEnabled(false); + dummyShop.setName(name); + dummyShop.setLongitude(nemophila.getCurrentLongitude()); + dummyShop.setLatitude(nemophila.getCurrentLatitude()); + nemophila.setDummyShop(dummyShop); + + // PostActivityへ画面を遷移する + Intent intent = new Intent(getApplication(), PostActivity.class); + startActivity(intent); // 店の名前を入力されていないときToastを発行 } else { Toast ts = Toast.makeText(ShopCreateActivity.this, "名前を入力してください", Toast.LENGTH_SHORT); @@ -55,5 +46,12 @@ ts.show(); } }); + + Button cancelButton = findViewById(R.id.buttonCancel); + cancelButton.setOnClickListener(v -> { + cancelButton.setEnabled(false); + Intent intent = new Intent(getApplication(), MainActivity.class); + startActivity(intent); + }); } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_shop_create.xml b/app/src/main/res/layout/activity_shop_create.xml index 15c2449..49640ec 100644 --- a/app/src/main/res/layout/activity_shop_create.xml +++ b/app/src/main/res/layout/activity_shop_create.xml @@ -8,16 +8,16 @@ + app:layout_constraintVertical_bias="0.125" />