-1

I was looking at this post to figure out the differences between a clickable image view and an image button.

In accepted answer @Michael says:

EDIT: Also, ImageButton.onSetAlpha() method always returns false, scaleType is set to center and it's always inflated as focusable.

My question is: Why does ImageButton.onSetAlpha() always return false? I've checked out the docs which says that the default implementation is false, but never explictly says that onSetAlpha will always return false.

Thanks!

CodingChap
  • 1,088
  • 2
  • 10
  • 23

1 Answers1

1

He's talking about what the image button does, and as you just quoted, the documentation explicitly says that the default implementation (always) returns false.

Andreas
  • 154,647
  • 11
  • 152
  • 247
  • Hi, thanks. Why is it always false though? I understand the default implementation is false, but that doesn't mean it's always false(we can change it)? Or can we not change it? – CodingChap May 14 '21 at 23:56
  • @CodingChap Because the documentation says so, which is because the default implementation doesn't support alpha, which is because they didn't bother to implement that, and have no intention of ever doing so. – Andreas May 14 '21 at 23:58
  • @CodingChap *"we can change it"* If you did, then it wouldn't be the *default* implementation any more, it would be *your* implementation. – Andreas May 14 '21 at 23:59
  • So @Michael was just talking about the default implementation? – CodingChap May 15 '21 at 00:02
  • @CodingChap Of course! The entire question is about the difference between the (default) `ImageView` and the (default) `ImageButton`. Asking about the difference custom versions of those, without showing the custom changes, wouldn't make any sense, so of course it's about the **default** implementations, i.e. the *system-supplied* implementations. – Andreas May 15 '21 at 00:06