2019-09-01 09:55 PM
How to draw a dotted rectangle while dragging to select a part of the interface?
Solved! Go to Solution.
2019-09-02 12:10 AM
Hi,
The cheapest way is to do this using images (which can be handled by DMA2D), rather than using Canvas lines.
Overwrite the handleClickEvent() method in your view to be able to superimpose your selection rectangle and subsequently select elements on the screen based on the position of that rectangle. Listen for a drag event - If this is registered start drawing the rectangle and when a clickevent is of type RELEASED, then remove the rectangle and evaluate what to do based on the area covered by it.
For the rectangle itself, implement it in a custom container that can expand from a certain point based on finger position. Use more containers inside to act as a "viewport" that shows more and more of the "dotted line" the more the container grows (and vice versa) based on finger origin and x,y delta.
Let me know if you need some more ideas.
/Martin
2019-09-02 12:10 AM
Hi,
The cheapest way is to do this using images (which can be handled by DMA2D), rather than using Canvas lines.
Overwrite the handleClickEvent() method in your view to be able to superimpose your selection rectangle and subsequently select elements on the screen based on the position of that rectangle. Listen for a drag event - If this is registered start drawing the rectangle and when a clickevent is of type RELEASED, then remove the rectangle and evaluate what to do based on the area covered by it.
For the rectangle itself, implement it in a custom container that can expand from a certain point based on finger position. Use more containers inside to act as a "viewport" that shows more and more of the "dotted line" the more the container grows (and vice versa) based on finger origin and x,y delta.
Let me know if you need some more ideas.
/Martin