I use this code to create a collapsible banner. It works, but I have some issues and questions:
1 - When I open the page, the banner is expanded (this is the default behavior) and show the button to collapse it.
But if I back to the previous screen, with the banner in expanded state, it still show in the screen.
See the below images and the example that demonstrate the problem.
2 - I try to use this code in an Activity old project (I have many projects in this format). I get this error:
In the project example I create an activity module that demonstrate the problem too.
1 - When I open the page, the banner is expanded (this is the default behavior) and show the button to collapse it.
But if I back to the previous screen, with the banner in expanded state, it still show in the screen.
See the below images and the example that demonstrate the problem.
2 - I try to use this code in an Activity old project (I have many projects in this format). I get this error:
B4X:
** Activity (actbanner) Create (first time) **
actbanner_activity_create (java line: 369)
java.lang.IllegalArgumentException: Expected receiver of type b4a.example.collapsiblebanner.actbanner, but got java.lang.Class<b4a.example.collapsiblebanner.actbanner>
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4a.example.collapsiblebanner.actbanner._activity_create(actbanner.java:369)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at b4a.example.collapsiblebanner.actbanner.afterFirstLayout(actbanner.java:108)
at b4a.example.collapsiblebanner.actbanner.access$000(actbanner.java:20)
at b4a.example.collapsiblebanner.actbanner$WaitForLayout.run(actbanner.java:86)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:225)
at android.app.ActivityThread.main(ActivityThread.java:7563)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)
In the project example I create an activity module that demonstrate the problem too.