diff --git a/app/src/main/java/org/ntlab/irisclient/DrawingCardFragment.java b/app/src/main/java/org/ntlab/irisclient/DrawingCardFragment.java index 94d43b6..be9d689 100644 --- a/app/src/main/java/org/ntlab/irisclient/DrawingCardFragment.java +++ b/app/src/main/java/org/ntlab/irisclient/DrawingCardFragment.java @@ -2,12 +2,14 @@ import android.content.Context; import android.content.res.Resources; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -84,19 +86,60 @@ ImageButton imageButton33 = (ImageButton) view.findViewById(R.id.imageButton33); imageButton33.setBackground(resources.getDrawable(R.drawable.test02)); + imageButton00.setOnClickListener(this::onClick); + imageButton01.setOnClickListener(this::onClick); + imageButton02.setOnClickListener(this::onClick); + imageButton03.setOnClickListener(this::onClick); + imageButton10.setOnClickListener(this::onClick); + imageButton11.setOnClickListener(this::onClick); + imageButton12.setOnClickListener(this::onClick); + imageButton13.setOnClickListener(this::onClick); + imageButton20.setOnClickListener(this::onClick); + imageButton21.setOnClickListener(this::onClick); + imageButton22.setOnClickListener(this::onClick); + imageButton23.setOnClickListener(this::onClick); + imageButton30.setOnClickListener(this::onClick); + imageButton31.setOnClickListener(this::onClick); + imageButton32.setOnClickListener(this::onClick); + imageButton33.setOnClickListener(this::onClick); + return view; } - @Override - public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - -// FragmentManager fragmentManager = getChildFragmentManager(); -// FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); -// fragmentTransaction.addToBackStack(null); -// fragmentTransaction.replace(R.id.container, -// DrawingCardFragment.newInstance("Fragment")); -// fragmentTransaction.commit(); + public void onClick(View v) { + if (v.getId() == R.id.imageButton00) { + Log.i("didTap", "imageButton00"); + } else if (v.getId() == R.id.imageButton01) { + Log.i("didTap", "imageButton01"); + } else if (v.getId() == R.id.imageButton02) { + Log.i("didTap", "imageButton02"); + } else if (v.getId() == R.id.imageButton03) { + Log.i("didTap", "imageButton03"); + } else if (v.getId() == R.id.imageButton10) { + Log.i("didTap", "imageButton10"); + } else if (v.getId() == R.id.imageButton11) { + Log.i("didTap", "imageButton11"); + } else if (v.getId() == R.id.imageButton12) { + Log.i("didTap", "imageButton12"); + } else if (v.getId() == R.id.imageButton13) { + Log.i("didTap", "imageButton13"); + } else if (v.getId() == R.id.imageButton20) { + Log.i("didTap", "imageButton20"); + } else if (v.getId() == R.id.imageButton21) { + Log.i("didTap", "imageButton21"); + } else if (v.getId() == R.id.imageButton22) { + Log.i("didTap", "imageButton22"); + } else if (v.getId() == R.id.imageButton23) { + Log.i("didTap", "imageButton23"); + } else if (v.getId() == R.id.imageButton30) { + Log.i("didTap", "imageButton30"); + } else if (v.getId() == R.id.imageButton31) { + Log.i("didTap", "imageButton31"); + } else if (v.getId() == R.id.imageButton32) { + Log.i("didTap", "imageButton32"); + } else if (v.getId() == R.id.imageButton33) { + Log.i("didTap", "imageButton33"); + } } }