Hi all,
I have used gesture implementation in my application, my object moves perfectly throughout the screen, during fling, scroll..etc, but sometimes my object goes out of the view and its getting disappear, now i have to restrict the boundary of my gesture object, i have placed this gesture with in a view, i tried to get the width and height of the view and tried to restrict,but i can;t find it right , still the ;object moves out of its boundary....
My viewholder(layout where the gesture is placed) , i tried to get the width and height viewholder.getWidth(),viewholder.getHeight() but both returns 0,
i knew i have gone wrong somewhere, could anyone able to correct me, how i can move further
framelayout = (FrameLayout) findViewById(R.id.LinearLayout_DrawCircle); framelayout.addView(new DrawTarget(this)); // View 1 (Draws Concentric circle) framelayout.addView(gestureaction); // View 2 (Draws a bitmap and invokes gesture that can move around) //trying to find the width and height of the view, so that movement of object can be restricted px = framelayout.getWidth(); py = framelayout.getHeight(); Log.i(TAG,"Width =" +px + "," + "Height = " +py); //return 0,0
please let me know how to proceed further...
Thanks in advance