アイテムをタッチしたら画面推移するように

This commit is contained in:
r-ca 2024-01-20 15:40:52 +09:00
parent 439b76f8bf
commit f4c46fbd5d
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -7,6 +7,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.navigation.Navigation;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
@ -35,6 +36,10 @@ public class ListItemAdapter extends RecyclerView.Adapter<ListItemAdapter.ListIt
holder.icon.setColorFilter(one.nem.lacerta.shared.ui.R.color.colorOnSurface);
holder.title.setText(listItem.getTitle());
holder.description.setText(listItem.getDescription());
holder.itemView.setOnClickListener( v -> {
Navigation.findNavController(v).navigate(listItem.getDestination());
});
}
@Override