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 249 forks source link

Don't open the same page again #88

Closed sezginozgurr closed 3 years ago

sezginozgurr commented 3 years ago

When you enter the page with the balloons, destroy the page.I visit again. requests on the page are received.But the image is not available. What is the problem?

the error is attached

W/libEGL: EGLNativeWindowType 0x7ba0e3b010 disconnect failed I/QarthLog: [PatchStore] createDisableExceptionQarthFile [PatchStore] create disable file for member.kidzjungle.mtek.stb uid is 10575 E/AndroidRuntime: FATAL EXCEPTION: GLThread 12652 Process: member.kidzjungle.mtek.stb, PID: 23522 java.lang.AssertionError at org.jbox2d.collision.broadphase.DynamicTree.destroyProxy(DynamicTree.java:115) at org.jbox2d.collision.broadphase.BroadPhase.destroyProxy(BroadPhase.java:104) at org.jbox2d.dynamics.Fixture.destroyProxy(Fixture.java:314) at org.jbox2d.dynamics.World.destroyBody(World.java:344) at com.igalata.bubblepicker.physics.Engine.clear(Engine.kt:85) at com.igalata.bubblepicker.rendering.PickerRenderer.clear(PickerRenderer.kt:169) at com.igalata.bubblepicker.rendering.PickerRenderer.initialize(PickerRenderer.kt:77) at com.igalata.bubblepicker.rendering.PickerRenderer.onSurfaceChanged(PickerRenderer.kt:67) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1566) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1281)

Ekran görüntüsü 2021-03-03 145043

lazy-coder-10 commented 3 years ago

Did you find any solution ??

sezginozgurr commented 3 years ago

@rohit6027 Not yet. Have you encountered such a problem?

lazy-coder-10 commented 3 years ago

Yes, App is getting crashed whenever onResumed() called in activity but the sample is not crashing. I don't know where is the issue.

sezginozgurr commented 3 years ago

@rohit6027 I will write when I find the solution. Thanks Give me some time

lazy-coder-10 commented 3 years ago

Great thanks for your help. If you use the below if-case in Engine.kt file then the app is not getting crashed but after that items are very slow to display.

fun clear() { borders.forEach { if(world.isLocked) world.destroyBody(it.itemBody) } bodies.forEach { if(world.isLocked) world.destroyBody(it.physicalBody) } borders.clear() bodies.clear() }

sezginozgurr commented 3 years ago

aw bro. Thanks. I will try. But borders ? /bodies ?

lazy-coder-10 commented 3 years ago

@sezginozgurr Here is the final workaround code which is working fine for me

don't forget to add onResume() and onPause() with respect to bubble picker inside your activity

Engine.Kt fun clear() { world = World(Vec2(0f, 0f), false) borders.forEach { if(world.isLocked) world.destroyBody(it.itemBody) } bodies.forEach { if(world.isLocked)world.destroyBody(it.physicalBody) } borders.clear() bodies.clear() }

sezginozgurr commented 3 years ago

@rohit6027 thank you so much. I solved a big problem thanks to you.

lazy-coder-10 commented 3 years ago

@sezginozgurr I am glad I could help you. You can change this bug status to closed if it is fixed.