As i already tried views with motion drag reading Android docs.
I have clearly not saying about basics of it but i want to hide orinvisible view which will be visible when other view which is being dragged or using motion can taken to the hidden orinvisible surface area ?
Set tag of to view and after that when you touch view check tag of that view in MotionEvent.ACTION_DOWN or MotionEvent.ACTION_MOVE and set View.setVisibility(View.INVISIBLE) for other views.
I think it should be easy using transparent color for this View. Even you will use ViewGroup with other elements, you can just create method for updating parameters (like background, color, image, etc.) to the transparent type.
Related
I want to attach an onClickListener to an ImageView which is made INVISIBLE. I know I could set it to the TRANSPARENT color but due to certain reasons I don't want to do that and an INVISIBLE ImageView is not listening to clicks. Is there any way to achieve the required thing?
No, INVISIBLE views don't receive touch events. However there are a few alternatives you can use:
Set the view's alpha to 0. This would make it fully transparent.
Create a 2nd view of the exact same size above the view and put the click handler on that.
Put a touch handler on the parent and check if in the area of the invisible view when you detect a click.
Least work is probably top to bottom on that list.
Hi I am facing such issue,
I have two view for example my first view is A which's image is below
and I am opening View B on this A view
In view B when i touch the area where there is no button for example
it's affect to View A, means A view's button clicked, how to avoid this can any body help?
thanks
Since the background of the keyboard isn't clickable it goes through to the next layer. Simply set the background/panel of the keyboard as clickable by android:clickable="true", this will prevent the lower layer from being clicked.
After animation button moves out from parent layout and does not respond to touch. I tried to use TouchDelegate for extending a view's touchable area, but it did not work in my case. I need it to scale (parent layout with all childs), and I do not want to change the size parent layout. Whether it is possible to solve this problem?
thear scheme of problem
I use TouchDelegate for Parent view and check window location coordinate for child views. When there is a pressing on the ParetView, I check to see if in the same place a childView, and if so, then move it.
I have 2 views : View A and view B. View A is rendered and has actions to input a text value. Im displaying an overlay view - View B on top of this. I expect that the actions on View A get disabled but they do not and im still able to type in the input field on View A. How can i disable this ?
The reason is that your overlay is not consuming the touch events , so by design if a view is not consuming touch events the events are passed to underlying view in the view model. So the long answer is make your overlay touchable, focusable , and touch listener and return true . short answer is add android:clickable="true" to your overlay view.
In my sample app i am drawing images on canvas.
Now on touch of any view I use "view.bringToFront(..)" to bring view on top,and invalid selected view.
But here it drawn each view again at place of an single view.
I just want to draw an dirty view here.
Pls let me know how can I handle this,
Similar problem here : Android: How to get a custom view to redraw partially?
Thnx