diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/edit/EditFragment.java b/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/edit/EditFragment.java index 327b964..1641c7f 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/edit/EditFragment.java +++ b/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/edit/EditFragment.java @@ -6,6 +6,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.EditText; import android.widget.TextView; @@ -46,7 +47,7 @@ } //----------------------------------------------------------------- - private ArrayList views = new ArrayList<>(); + //----------------------------------------------------------------- @@ -60,12 +61,21 @@ super.onViewCreated(view, savedInstanceState); Button appButton = view.findViewById(R.id.Paint_button); appButton.setOnClickListener(v -> { - Acanthus achanthus = (Acanthus) getActivity().getApplication(); - Integer uid = achanthus.getPreferenceUid(); - String name = views.get(R.id.AnimationName).getText().toString(); - String token = achanthus.getPreferenceToken(); - editViewModel.startWorkEdit(uid, name, token); + Acanthus acanthus = (Acanthus) getActivity().getApplication(); + Integer uid = acanthus.getPreferenceUid(); + String name = ((EditText)view.findViewById(R.id.AnimationName)).getText().toString(); + String token = acanthus.getPreferenceToken(); + Integer aid = editViewModel.startWorkEdit(uid, name, token); + acanthus.setAid(aid); + transitionPaintActivity(); }); } + //----------------------------------------------------------------- + // 画面遷移 + private void transitionPaintActivity() { + Acanthus acanthus = (Acanthus) getActivity().getApplication(); + Intent intent = new Intent(acanthus, PaintActivity.class); + startActivity(intent); + } } \ No newline at end of file