Try attaching the layout to the class when inflating instead of adding as a view.
Change
binding = BannerViewBinding.inflate(LayoutInflater.from(context))
addView(binding.root)
to
binding = BannerViewBinding.inflate(LayoutInflater.from(context), this)
in all 3 classes.