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 ae72fc6..327b964 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 @@ -20,6 +20,8 @@ import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; +import java.util.ArrayList; + public class EditFragment extends Fragment { private EditViewModel editViewModel; @@ -43,6 +45,11 @@ return root; } + //----------------------------------------------------------------- + private ArrayList views = new ArrayList<>(); + //----------------------------------------------------------------- + + @Override public void onDestroyView() { super.onDestroyView(); @@ -52,12 +59,13 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); Button appButton = view.findViewById(R.id.Paint_button); - appButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(getActivity(), PaintActivity.class); - startActivity(intent); - } + 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); }); } + } \ No newline at end of file