xarlymg89
xarlymg89

Reputation: 2617

Fragment layout seems to not be interactive/clickable

So here's the tricky or buggy thing.

I have an activity that displays a mapview (I don't believe this is important at all, but the mapview is from Carto Mobile SDK), and I have a few actions that trigger two fragments to be displayed over the current activity layout.

The first one, takes the whole screen and is fully interactive. There is a Toolbar, a few Spinners and some TextViews.

The second fragment that gets displayed, takes a portion of the screen (almost the lower half), and the elements I included are interactive (3 Image Buttons). However, if I click over a part of that layout that's on the lower half of the screen, that has a white background, is like it's 'invisible' to the touch event.

Let me rephrase it. There's a white box, that if I touch over it and I perform a movement, like if I was moving the map (the mapview behind it, which I can partially see), I can then see the map moving. Even though I'm seeing the white LinearLayout, with 3 Image Buttons in it, if I click somewhere where there isn't any of the Image Buttons, is like the LinearLayout isn't there and the map moves.

I attached a screenshot at the end. The area that I talk about is just on top of the Image Buttons (Route to, Route from and View details).

Can I stop that from happening? Is this due to Carto or is an Android thing?

Upvotes: 0

Views: 93

Answers (1)

Tam Huynh
Tam Huynh

Reputation: 2477

You don't put any code above so I assume your root view doesn't have click event, only the 3 buttons have.

Add clickable="true" to your white panel's root view to capture all the touch event

Upvotes: 2

Related Questions