![]() ![]() Int circleWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DP, 40, getResources().getDisplayMetrics()) Assuming your view has a 40 dp width and height, Manager.getDefaultDisplay().getSize(point) Top-right would look like this: WindowManager manager = (WindowManager) getSystemService(Context.WINDOW_SERVICE) For instance, top-left would look like this: params.x = 0 So, I'll give an example approach on how you can do it.Īdding the view in left and right corner can be specified in the layout params you are creating. I'm not entirely sure what the parent does, I believe you're trying to move the circle view here after touching it, with a drag operation or some sort. In your case, the event wouldn't reach your window, and that would mean you can't handle the event at all. ![]() They all depend on whether the event actually reaches your view, and even then, returning false wouldn't pass the event to the below screen, because they are different processes. Whether you're using intercept, returning false etc. You can't do that on the same view I'm afraid, because the touch event either enters to your view, or it does not. tOnTouchListener(new View.OnTouchListener() boolean onTouch(View view, MotionEvent motionEvent) /*this.animate().x(event.getRawX()).y(event.getRawY())Īlso tried returning false in onTouchEvent of CircleDraggingView and also to main mFloatingView (Root View ). ![]() MFloatingView = om(this).inflate(R.em_circle_dragging, null) /| _NOT_TOUCHABLE, this flag can make it in touchable. LayoutParams.TYPE_APPLICATION_OVERLAY : _PHONE įinal WindowManager.LayoutParams params = new WindowManager.LayoutParams( int LAYOUT_FLAG = _INT >= Build.VERSION_CODES.O ? WindowManager. ![]() WindowManager don't let the visible item clickable. But when I click on visible Home Screen button. I make them draggable on screen that's working fine. I have two small circle in left and right corner. My view must be match parent and handle circle touch listener and pass the rest touch to the below screen it's width and height are _PARENT with transparent background. Import .I have drawn an overlay using WindowManager. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |