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
You may use it in your Android apps provided that you cite this project and include the license in your app.
#AdditionalRes: #AdditionalRes: C:\Users\ธีระ\Desktop\New Folder (2)\SlidingMenu-master\library\src\com\jeremyfeinstein\slidingmenu\lib , com.jeremyfeinstein.slidingmenu.lib, com.jeremyfeinstein.slidingmenu.lib
SlidingMenu\library\res\values\ids.xml:3: error: Resource at selected_view appears in overlay but not in the base package; use <add-resource> to add.
I will be waiting for new version.Generating R file. Error
C:\android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\ads_attrs.xml:10: error: Attribute "adSize" has already been defined
C:\android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\ads_attrs.xml:13: error: Attribute "adUnitId" has already been defined
C:\android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\attrs.xml:20: error: Attribute "mode" has already been defined
.....
#Region Project Attributes
#ApplicationLabel: Dagbok
#VersionCode: 241
#VersionName: 2.4.1
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: True
#AdditionalRes: C:\AndroidApps\DagbokVit\SlidingMenu\library\res, com.jeremyfeinstein.slidingmenu.lib
#End Region
Try this:
Code:
Dim jo As JavaObject = SlidingMenu1
jo.RunMethod("setTouchmodeMarginThreshold", Array(50%x))
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#AdditionalRes: C:\Users\Douglas\Documents\SlidingMenu-master\library\res, com.jeremyfeinstein.slidingmenu.lib
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
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 = 200dip
sm.BehindOffset = offset
sm.Mode = sm.LEFT
Dim jo As JavaObject = sm
jo.RunMethod("setTouchmodeMarginThreshold", Array(50%x))
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
sm.Menu.AddView(smScroll,10dip, 10dip, 200dip, 100%y)
sm.Menu.AddView(smScroll.AsView,10dip, 10dip, 200dip, 100%y)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?