Android custom view : draw over toolbar when fragment replaced with animation

I created a custom view which draw a quarter circle :

public class QuarterCircle extends View { ... @Override protected void onDraw(Canvas canvas) { canvas.clipRect(mRectClip, Region.Op.REPLACE); canvas.rotate(mRotation, mRectClip.right / 2, mRectClip.bottom / 2); canvas.drawArc(mRect, 0, 360, false, mPaint); } ... }

It looks like that :

Android custom view : draw over toolbar when fragment replaced with animation

When I change fragment with an animation (exit to top), tge view draw over toolbar in a weird way :

Android custom view : draw over toolbar when fragment replaced with animation

On emulator and some devices, it looks like this. On some other devices, it's cleared after animation stops.

Any clue of what going wrong ?

Thanks, Anthony

Category:android Views:7 Time:2018-10-27

Related post

  • How onDraw method works in subclass of android-custom-view class? 2011-07-24

    I facing problem to draw rectangle at subclass of my android custom view class. Each time super class onDraw method works.But subclass onDraw method never executed. Super class will draw a rectangle and subclass will draw 4 rectangle within the super

  • android custom view how to draw button on top of the view 2010-01-08

    I am creating a android app using LunarLander as a example. Now I need to create a few buttons which are drawn over the view. I do not want them as a seperate layout above or below the view but in the custom view. Is this possible or am I going to ha

  • Android - Custom view in fragment not working in onResume() 2012-03-19

    I have created a custom view to draw a line on the screen. This view is included in a fragment's xml layout and retrieved like the following in the fragment's onCreateView method: MyCustomView mMyCustomView; public View onCreateView(LayoutInflater in

  • Android custom view save visible screen to bitmap 2011-12-08

    In my app the user manipulates a image, rotates, pinch, zoom etc. This is make within onDraw() using canvas.translate(), canvas.rotate() etc. Of course the image is big and after the manipulation of the image the user performs interactions with other

  • Android custom view bitmap size exceeds VM budget 2010-11-13

    I am making a custom view that has 2 elemnts: a background that consists of a Bitmap like a map and a small resource image that acts like a pin, to indicate position on the map. On each gps position change my view get's update and the pin moves in th

  • Android custom view is not drawn properly 2011-04-20

    I have a custom widget based on the Android Gallery view. It is slightly customized to show the elements from the left of the view without a gap and pass required events to my listener. On the very first view layout everything works perfect. However

  • My custom view is not visible when embedded inside HorizontalScrollView 2011-07-25

    I know a lot of people have had similar issues to this but I cannot find a solution. I have created a custom View which extends SurfaceView. This view works perfectly when I use : setContentView(graphView); However I want it to be embedded inside a H

  • Adobe DPS Android custom viewer using Angular 2013-11-24

    Hi I have recently developed a custom viewer app for the ipad using the excellent articles and code examples that Derek Lu provided. This app used backbone as the MVP framework and communicated with Adobe DPS to retrieve folios and information using

  • Android Custom View - Optimizing Redrawing while Fling 2010-05-04

    I have a custom view that represents something like a photo-collage. I need to support the following: Fling Zoom In Zoom Out Here's what I currently do: onDraw: Look out for the number of images to be drawn. Look out for the images to be drawn and th

  • Android: custom view onClickEvent with X & Y locations 2010-05-13

    I've got a custom view and I want to get the X and Y coordinates of a user click. I've found that I can only get the coordinates from the onTouchEvent and an onClickEvent won't fire if I have an onTouchEvent. Unfortunately the onTouchEventfires when

  • Android Custom View Constructor 2010-05-21

    I'm learning about using Custom Views from the following: http://developer.android.com/guide/topics/ui/custom-components.html#modifying The description says: Class Initialization As always, the super is called first. Furthermore, this is not a defaul

  • Android custom view causing force close 2010-10-21

    I have a custom view in src > myproject.test > HomeView In my main layout xml I have the following: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/home_r

  • my Custom View gets drawn only when added in onCreate 2010-11-12

    I made a "GraphBar" custom view that is a RelativeLayout with a TextView on the bottom and an ImageView, varying in height, above that. Here is the code: public class GraphBar extends RelativeLayout { private int mAvailHeight; // space for the bar (c

  • Android custom View + standard element-how? 2011-02-05

    I've been working away at an Android app for a while now and I'm trying to get a UI off the ground for it. I've created already created several with the standard XML + Java approach, but one screen requires a custom View (using draw to create a sort

  • Android Custom View Problem 2011-05-26

    Hi Guys i have been fighting with this problem and don't know what is the reason. I have a simple layout as follows <?xml version="1.0" encoding="utf-8"?> <view xmlns:android="http://schemas.android.com/apk/res/android" class="com.dinash.not

  • How to implement scrolling in Android custom view 2011-07-20

    I've written a custom view which I'd like to ensure is viewable on any screen size. I've overridden the onMeasure: @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec);

  • Android custom view layout issues 2011-07-21

    Short and sweet summary: When changing a class from View-derived to ViewGroup-derived, the height and/or width params passed to onSizeChanged are not consistent for my class when used inside of a LinearLayout. Is there any additional information I ne

  • Android Custom View Absolute Positioning 2011-10-19

    My question is rather straightforward. I have a custom view (a rectangle), that will be rotated, translated, and scaled ontop of its parent view (RelativeLayout). My question is what is the best way to handle these transformations. Should I: A: Modif

  • Android custom view background selection 2011-11-23

    I have a custom view: public class MyView extends RelativeLayout { private LayoutInflater inflater; public MyView(Context context, AttributeSet attrs) { super(context, attrs); inflater = LayoutInflater.from(context); inflater.inflate(R.layout.my_view

  • Do I need all three constructors for an Android custom view? 2012-02-08

    When creating a custom view, I have noticed that many people seem to do it like this: public MyView(Context context) { super(context); // this constructor used when programmatically creating view doAdditionalConstructorWork(); } public MyView(Context

  • Should I call super() or call this() for android custom view constructors? 2012-02-08

    When creating a custom view, I have noticed that many people seem to do it like this: public MyView(Context context) { super(context); // this constructor used when programmatically creating view doAdditionalConstructorWork(); } public MyView(Context

  • Android custom view only gets onDraw called once 2012-02-11

    i made a custom view which should animate a dot on a background according to some external data. (works like a charm with textviews) view is then added in xml and android:background is set. view gets rendered properly but does not update. some debugg

  • Mono Android: Java Android custom view JNI not calling constructors in xml layout 2012-02-13

    We're using Mono for Android, and we want to use a few custom view subclasses that we have written in Java Android. We created a C# "bridge" class to expose the Java class through JNI. The method overrides and custom methods we exposed are working fi

  • Custom view not inflating layout when added programmatically 2012-02-16

    I'm trying to add a custom view to a linear layout programmatically. I want the custom view to inflate a layout I've already created. When I create an instance of the custom view and add it, a spot shows up where the view is, but the layout didn't se

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.191 (s). 11 q(s)