Android Question side swipe panel

Addo

Well-Known Member
Licensed User
Longtime User
i am trying from yesterday to achieve a side swipe panel

i have tried class sliding panel library but i have totally faild to use it with xcustomelistview

i have create question about it here but not lucky to get answered

https://www.b4x.com/android/forum/threads/class-slidingsidebar-with-customlistview.91361/

also i have tried

https://www.b4x.com/android/forum/threads/sd-panel-extra-slide-swap-scroll.83673/

but the size of the swipe is very small and uncontrollable and have some kind of flicking


is there any other library that can show panels or layouts side by side with swipe ?
 

Star-Dust

Expert
Licensed User
Longtime User
See this example. The standard value is 200dip.
You can modify it with this method
B4X:
SlidePanel1.SlidePanelWidth = 300dip
Always check the properties of the classes carefully. Usually you find everything you need

SlidePanel ' Slide Up/Down/Left/Right
  • Events:
    • Close (FromCode As Boolean)
    • Open (FromCode As Boolean)
  • Fields:
    • PanelSlide As Panel
    • SlidePanelAnchor As Int
  • Functions:
    • Class_Globals As String
    • CloseSlidePanel As String
    • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
    • GetBase As Panel
    • Initialize (vCallback As Object, vEventName As String) As String
    • Invalidate As String
    • IsInitialized As Boolean
    • OpenSlidePanel As String
    • SetSlideLeft As String
    • SetSlideRight As String
    • SetSlideUp As String
    • SetSlideDown As String
  • Properties:
    • SlidePanelWidth As Int
    • SlidePanelHeight As Int
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
this raise an exception project attached



B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Left 0
slidepanel_invalidate (java line: 202)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
    at android.view.ViewGroup.addViewInner(ViewGroup.java:4326)
    at android.view.ViewGroup.addView(ViewGroup.java:4162)
    at android.view.ViewGroup.addView(ViewGroup.java:4134)
    at anywheresoftware.b4a.objects.PanelWrapper.AddView(PanelWrapper.java:65)
    at b4a.example.slidepanel._invalidate(slidepanel.java:202)
    at b4a.example.slidepanel._setvvvvvvvvv0(slidepanel.java:507)
    at b4a.example.main._activity_create(main.java:348)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:743)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:150)
    at android.app.ActivityThread.main(ActivityThread.java:5621)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
    at android.view.ViewGroup.addViewInner(ViewGroup.java:4326)
    at android.view.ViewGroup.addView(ViewGroup.java:4162)
    at android.view.ViewGroup.addView(ViewGroup.java:4134)
    at anywheresoftware.b4a.objects.PanelWrapper.AddView(PanelWrapper.java:65)
    at b4a.example.slidepanel._invalidate(slidepanel.java:202)
    at b4a.example.slidepanel._setvvvvvvvvv0(slidepanel.java:507)
    at b4a.example.main._activity_create(main.java:348)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:743)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:150)
    at android.app.ActivityThread.main(ActivityThread.java:5621)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
 

Attachments

  • test.zip
    25.7 KB · Views: 312
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
in fact any access to its property raise an exception

B4X:
SlidePanel1.SetSlideRight
SlidePanel1.SlidePanelWidth
.... and so on

and its flicking too much while swiping
 
Last edited:
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Download the corrected source code. Also update the library with the newly published version 0.07.

PS. if the images contained in the project are not useful to you, remove them, occupy only space
 

Attachments

  • test.zip
    26.1 KB · Views: 331
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I need to check. I will let you know.
But it will probably require an update
 
Upvote 0

Addo

Well-Known Member
Licensed User
Longtime User
if the flicker will be fixed this library will be fascinating i have test it now on 3 phones works great but for better user experience this flicking should be fixed

currently if the layout visible and click on it it disappear it should not disappear unless the slider close is called and on touch it get disappear as will
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
See this example, which shows you how to use slidePanel.

There are two methods to open a day.
1. Drag your finger from the selected edge (right, top, bottom) of the screen to the center of the display
2. Use the command from code.

In the example there are both methods. Examine it carefully, and kindly if you have doubts open a new thread
 

Attachments

  • Sample2 SlidePanel.zip
    24 KB · Views: 337
Upvote 0
Top