| | package org.ntlab.acanthus_client.views.Main_menu_ui.edit; |
---|
| | |
---|
| | import android.content.Intent; |
---|
| | import android.os.Bundle; |
---|
| | import android.view.LayoutInflater; |
---|
| | import android.view.View; |
---|
| | import android.view.ViewGroup; |
---|
| | import android.widget.Button; |
---|
| | import android.widget.TextView; |
---|
| | |
---|
| | import org.ntlab.acanthus_client.databinding.FragmentMakeBinding; |
---|
| | |
---|
| | import org.ntlab.acanthus_client.R; |
---|
| | import org.ntlab.acanthus_client.databinding.FragmentEditBinding; |
---|
| | import org.ntlab.acanthus_client.views.Paint.PaintActivity; |
---|
| | |
---|
| | import androidx.annotation.NonNull; |
---|
| | import androidx.annotation.Nullable; |
---|
| | import androidx.fragment.app.Fragment; |
---|
| |
---|
| | |
---|
| | public class EditFragment extends Fragment { |
---|
| | |
---|
| | private EditViewModel editViewModel; |
---|
| | private FragmentMakeBinding binding; |
---|
| | private FragmentEditBinding binding; |
---|
| | |
---|
| | public View onCreateView(@NonNull LayoutInflater inflater, |
---|
| | ViewGroup container, Bundle savedInstanceState) { |
---|
| | editViewModel = |
---|
| | new ViewModelProvider(this).get(EditViewModel.class); |
---|
| | |
---|
| | binding = FragmentMakeBinding.inflate(inflater, container, false); |
---|
| | binding = FragmentEditBinding.inflate(inflater, container, false); |
---|
| | View root = binding.getRoot(); |
---|
| | |
---|
| | final TextView textView = binding.textMake; |
---|
| | editViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { |
---|
| |
---|
| | public void onDestroyView() { |
---|
| | super.onDestroyView(); |
---|
| | binding = null; |
---|
| | } |
---|
| | @Override |
---|
| | 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); |
---|
| | } |
---|
| | }); |
---|
| | } |
---|
| | } |
---|
| | |
No description provided.
確認しました. 天才!
1ac381f
intomaster
fromkuraokaテンプレート作成
on 5 Jun 2021kuraokaテンプレート作成
branch on 5 Jun 2021