mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (#3828)
This commit is contained in:
parent
3e389be6f5
commit
78d519f83e
1 changed files with 7 additions and 5 deletions
|
|
@ -176,9 +176,11 @@ public class UploadMediaDetailFragment extends UploadBaseFragment implements
|
|||
etTitle.setOnTouchListener((v, event) -> {
|
||||
//2 is for drawable right
|
||||
float twelveDpInPixels = convertDpToPixel(12, getContext());
|
||||
if (event.getAction() == MotionEvent.ACTION_UP && etTitle.getCompoundDrawables() != null
|
||||
&& etTitle.getCompoundDrawables().length > 2 && etTitle
|
||||
.getCompoundDrawables()[2].getBounds()
|
||||
if ((event.getAction() == MotionEvent.ACTION_UP)
|
||||
&& (etTitle.getCompoundDrawables() != null)
|
||||
&& (etTitle.getCompoundDrawables().length > 2)
|
||||
&& (etTitle.getCompoundDrawables()[2] != null)
|
||||
&& etTitle.getCompoundDrawables()[2].getBounds()
|
||||
.contains((int) (etTitle.getWidth() - (event.getX() + twelveDpInPixels)),
|
||||
(int) (event.getY() - twelveDpInPixels))) {
|
||||
showInfoAlert(R.string.media_detail_title, R.string.title_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue