Closed krabo0om closed 8 years ago
why is the calloutlayout smaller than the tileview?
I have no idea, but I guess it's related to PR #318 which also led to setClipChildren( false );
in the MarkerLayout
(b43ab2e9db7dc36c9b8d2cf2e759599b164ec12d, discussed at the end of #338 )
still, all children of tileview (zoompanlayout) should fill up the container.
can you post a branch with a demo modified to show the issue?
Please check out my 359_showcase branch where I made it clearer. None of the demos used tileView.setMinimumScaleMode( ZoomPanLayout.MinimumScaleMode.FIT )
.
So in my modified "Large Image" demo just tap Lisa to make a callout (simple button) appear, tapping the button shows a Toast message. If you tap above Lisa (not in the whitespace) the callout appears again, but this time tapping the upper part of the button (in the whitespace) lets the button disappear without a Toast.
Verify the size of the layouts using the Android Device Monitor's (Android Studio -> Tools -> Android) Hierarchy View perspective (Window -> Open Perspective).
great i'll check it out asap, thanks for posting that
didn't have time to get this one done tonight, i'll try again tomorrow, if that fails then this weekend
thanks mate
ok i took a look, and you're right i've never used FIT, that's something that was added by other contributors that was never needed in any of the apps i wrote this for. it's not a bug, and it's not a TileView-specific thing, it's just an android thing - if you're child is drawn outside of the container, it won't get touch events - you can google or check stack for many questions about this very thing.
there's not much you can do about it. you could grab the touch event on the container and check position against callouts, but that's about all i can think of. even hotspots won't work because no touch event will be triggered in the TileView or any of its children if it happens outside its drawn bounds.
you can check the source for HotSpots and Markers to see how i did it and apply the same basic logic to the ViewGroup containing the TileView...
sorry i couldn't be more help - good luck
Touch events don't get passed to the part of the view that is outside of the callout/marker layout (the orange parts). This super illustration might help to visualize it (taken from Android Device Monitor): How easy would it be to resize the Callout/Marker Layouts to match the parent (TileView) and capture the touch events?