igalata / Bubble-Picker

An easy-to-use animation which can be used for content picking for Android
https://medium.com/@igalata13/how-to-create-a-bubble-selection-animation-on-android-627044da4854#.js8nebsx6
1.4k stars 248 forks source link

Does not work on minSDK 16 #6

Closed a7medpa closed 7 years ago

a7medpa commented 7 years ago

It seems that the library only works on sdk 23+ as it does not work at all on minSDK16, it repeatedly produces this error: E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glActiveTexture:1260 GL error 0x500. The app does not crash, rather it freezes and it does not show anything.

igalata commented 7 years ago

Hello @ahmedpamin Have you tried the version from the Play Store? Doesn't it work? I've just checked it on 5.1.1, and it works ok. Provide me with more details, please, so I could fix this issue

igalata commented 7 years ago

@ahmedpamin Also tried on 4.2.1, it works too

a7medpa commented 7 years ago

Sure, take a look at the code: http://pastebin.com/0NN2PfQH If you want you can just put in some drawables after the same names and test it with your bubble picker layout, it should reproduce the same error.

Like this: 03-20 16:42:32.652 3998-5516/com.example.ahmedamin.ntsuapp W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 03-20 16:42:32.652 3998-5516/com.example.ahmedamin.ntsuapp W/System.err: SLF4J: Defaulting to no-operation (NOP) logger implementation 03-20 16:42:32.652 3998-5516/com.example.ahmedamin.ntsuapp W/System.err: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 03-20 16:42:32.794 3998-5516/com.example.ahmedamin.ntsuapp E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glActiveTexture:1260 GL error 0x500 03-20 16:42:32.795 3998-5516/com.example.ahmedamin.ntsuapp E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glActiveTexture:1260 GL error 0x500

EDIT: The "StaticLoggerBinder" is fixed, that was a fault on my half and resolved it by following their instructions. Please do fix the "E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glActiveTexture:1260 GL error 0x500" error. Thank you. It is now occurring on SDK23 also.

igalata commented 7 years ago

@ahmedpamin What the device are you testing on? Does the demo from Play Store work correctly on your device?

a7medpa commented 7 years ago

Nexus 6 API25 on android studio emulator.

igalata commented 7 years ago

@ahmedpamin I'm not really sure about the emulator. Please, check the version from the Play Store on the real device

a7medpa commented 7 years ago

The source code works fine but that's using kotlin, using java it does not work

igalata commented 7 years ago

@ahmedpamin There is no difference between using Java and Kotlin, since both are compiled to bytecode. The emulator can be the reason of this issue

a7medpa commented 7 years ago

I think you are right because I have tested it on a tablet with SDK21 and there are no signs of that error however it makes all of the bubbles black.

igalata commented 7 years ago

Ok, I'll check it

a7medpa commented 7 years ago

This is what I get on the tablet:

03-21 15:04:44.912 4696-5488/com.example.ahmedamin.ntsuapp I/art: WaitForGcToComplete blocked for 43.205ms for cause Alloc 03-21 15:04:44.965 4696-5488/com.example.ahmedamin.ntsuapp I/art: Alloc sticky concurrent mark sweep GC freed 45(2064B) AllocSpace objects, 0(0B) LOS objects, 0% free, 79MB/80MB, paused 897us total 12.588ms 03-21 15:04:45.079 4696-4711/com.example.ahmedamin.ntsuapp I/art: Clamp target GC heap from 90MB to 80MB 03-21 15:04:45.079 4696-4711/com.example.ahmedamin.ntsuapp I/art: Background partial concurrent mark sweep GC freed 1951(99KB) AllocSpace objects, 16(5MB) LOS objects, 7% free, 74MB/80MB, paused 3.032ms total 111.549ms 03-21 15:04:45.079 4696-5488/com.example.ahmedamin.ntsuapp I/art: WaitForGcToComplete blocked for 99.805ms for cause Alloc 03-21 15:04:45.127 4696-4711/com.example.ahmedamin.ntsuapp W/art: Suspending all threads took: 38.096ms 03-21 15:04:45.147 4696-5488/com.example.ahmedamin.ntsuapp I/art: Clamp target GC heap from 90MB to 80MB 03-21 15:04:45.147 4696-5488/com.example.ahmedamin.ntsuapp I/art: Alloc partial concurrent mark sweep GC freed 1028(70KB) AllocSpace objects, 0(0B) LOS objects, 7% free, 74MB/80MB, paused 5.274ms total 67.348ms

a7medpa commented 7 years ago

I do not know if you did anything with the library but I tested it again and it works on SDK 16. However, it still produces the same errors every second continuously but it shows up fine on the emulator, I am trying to implement it now to open a activity see if it works on deselect and select. The tablet still shows it as black bubbles and the messages are shown above for it.

EDIT: It does appear that something is still wrong with the library as I get this error when I press back from the activity I intent on selected/deselected- 5055-5264/com.example.ahmedamin.ntsuapp E/AndroidRuntime: FATAL EXCEPTION: GLThread 184 Process: com.example.ahmedamin.ntsuapp, PID: 5055 java.lang.NullPointerException: Attempt to invoke virtual method 'org.jbox2d.collision.shapes.Shape org.jbox2d.dynamics.Fixture.getShape()' on a null object reference at com.igalata.bubblepicker.physics.CircleBody.reset(CircleBody.kt:100) at com.igalata.bubblepicker.physics.CircleBody.decrease(CircleBody.kt:80) at com.igalata.bubblepicker.physics.CircleBody.resize(CircleBody.kt:75) at com.igalata.bubblepicker.physics.Engine.move(Engine.kt:55) at com.igalata.bubblepicker.rendering.PickerRenderer.onDrawFrame(PickerRenderer.kt:67) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1548) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1259)

igalata commented 7 years ago

@ahmedpamin I fixed this crash, please review v0.1.3 version, it should be ok

a7medpa commented 7 years ago

@igalata thanks it works now, do you have any usage guides on how to use it with on pause and on resume so when I go back it is in the same state as it takes a few seconds to load? Also please note that I written my previous post incorrectly it is meant to be:

I think you are right because I have tested it on a tablet with SDK21 and there are no signs of that error however it makes all of the bubbles black.

igalata commented 7 years ago

@ahmedpamin, are you talking about saving bubbles state? If so, it's necessary to override onSaveInstanceState() and onRestoreInstanceState() methods in your activity. I think it's even better to handle it in BubblePicker view, so I'll implement it shortly. Did I understand you correctly? Also please share your latest code, so I could help you to fix 'black bubbles' issue.

a7medpa commented 7 years ago

@igalata Yes that is exactly what I meant, thank you. Also the code for the black bubbles is still the same as posted. I just tested it again on a nexus 7 API 22 and I can confirm it is still black.

igalata commented 7 years ago

@ahmedpamin Try the v0.2.3 version out. Eventually I've fixed the black bubbles issue 🎉

aniruth commented 6 years ago

I get this error when proguard enabled.

java.lang.NullPointerException at org.a.d.l.a(World.java:198) at org.a.d.d.a(ContactManager.java:108) at org.a.b.a.a.a(BroadPhase.java:187) at org.a.d.d.a(ContactManager.java:152) at org.a.d.l.a(World.java:540) at com.igalata.bubblepicker.physics.Engine.move(Engine.kt:129) at com.igalata.bubblepicker.rendering.PickerRenderer.onDrawFrame(PickerRenderer.kt:72) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)