Scalified / fab

Floating Action Button Library for Android
Apache License 2.0
848 stars 164 forks source link

Remove deprecated API, fix unknown API references #37

Open Emeriko opened 9 years ago

Emeriko commented 9 years ago

Hi when I start my app, I get a "Could not find class 'com.software.shell.fab.ActionButtonOutlineProvider', referenced from method com.software.shell.fab.ActionButton.drawElevation" exeption, but the Action button works fine.

Maybe you can help me with this issue.

BR Emeriko

vbaidak commented 9 years ago

Hi Emeriko,

Please provide the following information:

  1. What Android SDK version are you running your application at?
  2. What version of ActionButton library are you using?

The current implementation of the drawElevation() method does not have a call to ActionButtonOutlineProvider class:

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    protected void drawElevation() {
        float halfSize = getSize() / 2;
        final int left = (int) (calculateCenterX() - halfSize);
        final int top = (int) (calculateCenterY() - halfSize);
        final int right = (int) (calculateCenterX() + halfSize);
        final int bottom = (int) (calculateCenterY() + halfSize);
        ViewOutlineProvider provider = new ViewOutlineProvider() {
            @Override
            public void getOutline(View view, Outline outline) {
                outline.setOval(left, top, right, bottom);
            }
        };
        setOutlineProvider(provider);
        LOGGER.trace("Drawn the Action Button elevation");
    }

and indeed there is no such class currently in trunk.

Emeriko commented 9 years ago

Hi i have updated the your library to 1.1.2. I use minSdkVersion="15", targetSdkVersion="21" and compileSDKVersion 21. Error still occures.

BR Emeriko

vbaidak commented 9 years ago

Hi,

As I said the current version of the ActionButton has no class ActionButtonOutlineProvider. If you see the message that there is a reference to this class then there is probably the issue with cached library etc.

Here is what I have when I launch the sample apk:

07-29 07:07:17.651     879-1033/system_process I/ActivityManager﹕ START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.software.shell.fabsample/.FABActivity} from pid 1010
07-29 07:07:17.651     879-1033/system_process W/WindowManager﹕ Failure taking screenshot for (230x383) to layer 21005
07-29 07:07:17.662      785-785/? D/dalvikvm﹕ GC_EXPLICIT freed 36K, 5% free 6423K/6723K, paused 1ms+0ms
07-29 07:07:17.672     879-1032/system_process I/ActivityManager﹕ Start proc com.software.shell.fabsample for activity com.software.shell.fabsample/.FABActivity: pid=1469 uid=10039 gids={}
07-29 07:07:17.682    1469-1469/? D/dalvikvm﹕ Not late-enabling CheckJNI (already on)
07-29 07:07:17.692      785-785/? D/dalvikvm﹕ GC_EXPLICIT freed <1K, 5% free 6423K/6723K, paused 1ms+7ms
07-29 07:07:17.712      785-785/? D/dalvikvm﹕ GC_EXPLICIT freed <1K, 5% free 6423K/6723K, paused 0ms+18ms
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample I/dalvikvm﹕ Could not find method android.view.View.<init>, referenced from method com.software.shell.fab.ActionButton.<init>
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ VFY: unable to resolve direct method 11122: Landroid/view/View;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;II)V
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample D/dalvikvm﹕ VFY: replacing opcode 0x70 at 0x0004
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample I/dalvikvm﹕ Could not find method com.software.shell.fab.ActionButton.getElevation, referenced from method com.software.shell.fab.ActionButton.hasElevation
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ VFY: unable to resolve virtual method 12041: Lcom/software/shell/fab/ActionButton;.getElevation ()F
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0006
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ Unable to resolve superclass of Lcom/software/shell/fab/ActionButton$1; (1369)
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ Link of class 'Lcom/software/shell/fab/ActionButton$1;' failed
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample E/dalvikvm﹕ Could not find class 'com.software.shell.fab.ActionButton$1', referenced from method com.software.shell.fab.ActionButton.drawElevation
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ VFY: unable to resolve new-instance 1461 (Lcom/software/shell/fab/ActionButton$1;) in Lcom/software/shell/fab/ActionButton;
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0020
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ Unable to resolve superclass of Lcom/software/shell/fab/ActionButton$1; (1369)
07-29 07:07:17.742    1469-1469/com.software.shell.fabsample W/dalvikvm﹕ Link of class 'Lcom/software/shell/fab/ActionButton$1;' failed
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample D/dalvikvm﹕ DexOpt: unable to opt direct call 0x2ed0 at 0x23 in Lcom/software/shell/fab/ActionButton;.drawElevation
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][TouchPoint]﹕ Touch point X-axis coordinate set to: 0.0
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][TouchPoint]﹕ Touch point Y-axis coordinate set to: 0.0
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Layer type initialized
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button initialized
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Initialized type: DEFAULT
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Initialized size: 56.0
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button attributes initialized
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Button color changed to: -6579301
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Button ripple effect color changed to: -11250604
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Button color pressed changed to: -9868951
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Button color changed to: -6579301
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Button ripple effect color changed to: -11250604
07-29 07:07:17.752    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Button color pressed changed to: -9868951
07-29 07:07:17.762      879-938/system_process W/NetworkManagementSocketTagger﹕ setKernelCountSet(10039, 1) failed with errno -2
07-29 07:07:17.782    1469-1474/com.software.shell.fabsample D/dalvikvm﹕ GC_CONCURRENT freed 155K, 4% free 6705K/6919K, paused 0ms+0ms
07-29 07:07:17.782    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Stroke color changed to: -16777216
07-29 07:07:17.782    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Stroke color changed to: -16777216
07-29 07:07:17.782    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Show animation set
07-29 07:07:17.782    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Hide animation set
07-29 07:07:17.782    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Show animation set
07-29 07:07:17.782    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Hide animation set
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button onMeasure called
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow width = 28
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured width = 84
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow height = 44
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured height = 100
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ View size measured with: height = 0, width = 0
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button onMeasure called
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow width = 28
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured width = 84
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow height = 44
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured height = 100
07-29 07:07:17.862    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ View size measured with: height = 0, width = 0
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button onMeasure called
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow width = 28
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured width = 84
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow height = 44
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured height = 100
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ View size measured with: height = 100, width = 84
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button onMeasure called
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow width = 28
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured width = 84
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated shadow height = 44
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated stroke weight is: 0
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated measured height = 100
07-29 07:07:18.023    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ View size measured with: height = 100, width = 84
07-29 07:07:18.041    1469-1469/com.software.shell.fabsample D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Action Button onDraw called
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Paint reset
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ShadowResponsiveDrawer]﹕ Shadow responsive current radius updated to: 8.0
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ShadowResponsiveDrawer]﹕ Shadow responsive step drawn
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated center X = 42.0
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated center Y = 50.0
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Calculated circle circleRadius = 28.0
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ActionButton]﹕ Circle drawn
07-29 07:07:18.051    1469-1469/com.software.shell.fabsample V/[FAB][ViewInvalidator]﹕ View invalidator configuration reset
07-29 07:07:18.061     879-1033/system_process W/InputManagerService﹕ Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@b38b0150 (uid=10012 pid=1010)
07-29 07:07:18.071      879-920/system_process I/ActivityManager﹕ Displayed com.software.shell.fabsample/.FABActivity: +413ms
07-29 07:07:18.701      879-938/system_process W/NetworkManagementSocketTagger﹕ setKernelCountSet(10012, 0) failed with errno -2
vbaidak commented 9 years ago

Hi,

Any updates about this?

heiko13 commented 9 years ago

I have a similar problem. I get this error log: Could not find class 'com.software.shell.fab.ActionButton$1', referenced from method com.software.shell.fab.ActionButton.drawElevation

I get this error message every time I start my app on a pre-lollipop phone. This error line is not printed on Lollipop devices. However the FAB is working fine on all tested Android versions. The error also occurs in your log which you posted above (Line 16).

I am using the latest library 1.1.2 with minSdkVersion="18", targetSdkVersion="22" and compileSDKVersion 22.

Would be great if there is a way to get rid of this.

Best regards Heiko

vbaidak commented 9 years ago

Yes, I am aware of it.

This happens because of the additional (4-th) constructor, which appeared in View class starting from Lollipop update. This will be fixed in the next releases

This, however, does not relate to the issue with ActionButtonOutlineProvider class, which is absent in the library indeed

jesusignazio commented 9 years ago

Same issue here.