FABProgressCircle icon indicating copy to clipboard operation
FABProgressCircle copied to clipboard

Clipping Problems <= 4.2.2

Open stetro opened this issue 9 years ago • 10 comments

Hey, thanks for your awesome work!

I have experienced some clipping problems in 4.2.2 and lower, do you have any idea to solve this problem?

screen shot 2015-08-01 at 12 02 51

stetro avatar Aug 01 '15 10:08 stetro

I experience the very same glitch in 4.4.4, with Support lib FAB. Very annoying as frustrating.

ascmp avatar Sep 24 '15 11:09 ascmp

@stetro I found a workaround for it, although the glitch should be fixed at the source. Basically I made a copy of my Support's FAB wrapped by a FrameLayout (which the ProgressCircle extends), and I use a ViewFlipper to switch to the progress circle one only just before I show() the animation, and switch back as soon as I want to hide() the animation:

<ViewFlipper
    android:id="@+id/view_flipper"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <FrameLayout
        android:id="@+id/frame_non_spinning"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/button_non_spinning"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </FrameLayout>

    <com.github.jorgecastilloprz.FABProgressCircle
        android:id="@+id/frame_spinning"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/button_spinning"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </com.github.jorgecastilloprz.FABProgressCircle>
</ViewFlipper>

ascmp avatar Sep 25 '15 05:09 ascmp

@ascmp I tried your solution, but when the FABProgressCircle is shown, the original clipping problem still exists, doesn't it?

torinnguyen avatar Oct 08 '15 03:10 torinnguyen

@ascmp @stetro I have another workaround by adding these 2 to my FAB app:fab_elevationCompat="0dp" //this fixes the clipping issue mentioned here android:layout_margin="3dp" //this fix another type of clipping, should be equals to arcWidth However, a side effect is that the shadow of my FAB is removed :(

So I have to create another layout for v19 and above with fab_elevationCompat > 0

Here is my layout xml for < v19

<com.github.jorgecastilloprz.FABProgressCircle
        android:id="@+id/fabProgressCircle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@id/main_layout"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="@dimen/medium_space"
        android:layout_marginEnd="@dimen/medium_space"
        android:layout_marginRight="@dimen/medium_space"
        app:arcColor="@color/app_primary_color"
        app:arcWidth="3dp"
        app:roundedStroke="true">

        <com.github.clans.fab.FloatingActionButton
            android:id="@+id/btn_big_red_location"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="3dp"
            android:src="@mipmap/ic_focusing"
            app:fab_elevationCompat="0dp"
            app:fab_colorNormal="@color/app_primary_color"
            app:fab_colorPressed="@color/app_primary_color_dark"
            app:fab_colorRipple="#99FFFFFF"
            app:fab_shadowColor="#55000000"
            app:fab_shadowRadius="4dp"
            app:fab_shadowXOffset="1dp"
            app:fab_shadowYOffset="3dp"
            app:fab_showShadow="true" />
    </com.github.jorgecastilloprz.FABProgressCircle>

torinnguyen avatar Oct 08 '15 04:10 torinnguyen

@torinnguyen no, not for me at least. The clipping disappeared, but it could be because of some other properties I have set.

Let me be verbose: I was experiencing that clipping problem as in the picture when the FABProgressCircle was not animated (can't recall now if it appeared for me once you animated it at least once or not), and still I could see that dirtiness. Therefore my ugly workaround to show the FABProgressCircle only during the animation period, whereas the animation itself covers the clipping effect. Before and after, switching to the normal FAB guarantee that the clipping is removed from the UI.

ascmp avatar Dec 01 '15 13:12 ascmp

Any update on this yet? Seems like this project hasn't been worked on for a while.

nak411 avatar Dec 07 '15 17:12 nak411

@nak411 @JorgeCastilloPrz wondering the same here; I guess the developer doesn't have the time to neither update this project, nor to fix the already open bugs. My only hope is design lib will bring this animation ootb at one point.

ascmp avatar Feb 03 '16 06:02 ascmp

same issue

PanCrucian avatar Dec 14 '16 15:12 PanCrucian

same issue

SjoerdvGestel avatar Jul 17 '17 12:07 SjoerdvGestel

could work around the issue with setting the color to transparent when hidden but the needed pull request (setting color at runtime) is not merged and open since 2016...

SjoerdvGestel avatar Jul 17 '17 12:07 SjoerdvGestel