jfeinstein10 SlidingMenu library

Status
Not open for further replies.

Emilio Morales A

New Member
Licensed User
Longtime User
This is a wrapper for jfeinstein10 SlidingMenu open source project. This is a popular implementation of sliding menus. Note that you can add any layout you like in each of the side menus.

View attachment 21810

View attachment 21809

It requires B4A v6+

Example code:
B4X:
Sub Process_Globals
End Sub

Sub Globals
   Dim sm As SlidingMenu
End Sub

Sub Activity_Create(FirstTime As Boolean)
   sm.Initialize("sm")
   Dim offset As Int = 100dip
   sm.BehindOffset = offset
   sm.Mode = sm.BOTH
   Dim lv1 As ListView
   lv1.Initialize("lv1")
   For i = 1 To 10
     lv1.AddSingleLine("Action "  & i)
   Next
   sm.SecondaryMenu.AddView(lv1, 0, 0, 100%x - offset, 100%y)
   Dim b1, b2 As Button
   b1.Initialize("b1")
   b2.Initialize("b2")
   b1.Text = "Button1"
   b2.Text = "Button2"
   sm.Menu.AddView(b1, 10dip, 10dip, 100%x - offset - 20dip, 50dip)
   sm.Menu.AddView(b2, 10dip, 60dip, 100%x - offset - 20dip, 50dip)
End Sub
Sub lv1_ItemClick (Position As Int, Value As Object)
   Log(Value)
   sm.HideMenus
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
   If KeyCode = KeyCodes.KEYCODE_BACK AND sm.Visible Then
     sm.HideMenus
     Return True
   End If
   Return False
End Sub
Sub B1_Click
   Log("b1_click")
   sm.HideMenus
End Sub
Sub B2_Click
   Log("b2 click")
   sm.HideMenus
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Whatever you want to say. You should start a new thread in the questionforum for your question.
 

ermiakhan

Member
B4X:
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:181)
    at anywheresoftware.b4a.objects.SlidingMenuWrapper.Initialize(SlidingMenuWrapper.java:25)
    at b4a.example.main._activity_create(main.java:384)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    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:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6694)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.ViewConfigurationCompat" on path: DexPathList[[zip file "/data/app/b4a.example-fbvwjfmCftbuRW4HHz1HlQ==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-fbvwjfmCftbuRW4HHz1HlQ==/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 24 more
 

Ferdari

Active Member
Licensed User
Longtime User
B4X:
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
    at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
    at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:181)
    at anywheresoftware.b4a.objects.SlidingMenuWrapper.Initialize(SlidingMenuWrapper.java:25)
    at b4a.example.main._activity_create(main.java:384)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    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:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6694)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.ViewConfigurationCompat" on path: DexPathList[[zip file "/data/app/b4a.example-fbvwjfmCftbuRW4HHz1HlQ==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-fbvwjfmCftbuRW4HHz1HlQ==/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 24 more
It says the class android.support.v4.view.ViewConfigurationCompat is not in your project, try to include with #AdditionalJar: android-support-v4.jar
remember it must be in you additional libs folder.
 
Status
Not open for further replies.
Top