سلام دوباره امروز با کامل ترین سورس و آموزش متریال با شما هستیم. این سورس را هیچ جای دیگر پیدا نخواهید کرد چون به تازه گی توسط خودم نوشته شده و کامل کامل هستش همراه با تمامی ریسورس ها و کتابخانه ها اگر ین سورس را در جای دیگر دیدید به ما اطلاع دهید
#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: SlidingSidebar demo
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim PanelWithSidebar As ClsSlidingSidebar
Dim lblInfo As Label
Dim ivHandle, ivShadow As ImageView
Dim pnlDarken As Panel
Dim lvMenu As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim LightBrown As Int
LightBrown = Colors.RGB(220, 200, 200)
Activity.Color = LightBrown
PanelWithSidebar.Initialize(Activity, 100%y - 70dip, 3, 2, 400, 400)
PanelWithSidebar.ContentPanel.Color = LightBrown
PanelWithSidebar.Sidebar.Color = Colors.RGB(117, 65, 54)
PanelWithSidebar.SetOnChangeListeners(Me, "Drawer_onFullyOpen", "Drawer_onFullyClosed", "Drawer_onMove")
lblInfo.Initialize("")
lblInfo.Text = "Drag the handle to open/close the drawer."
lblInfo.TextColor = Colors.Black
lblInfo.TextSize = 24
PanelWithSidebar.ContentPanel.AddView(lblInfo, 30dip, 30dip, 100%x - 60dip, 100%y - 60dip)
ivHandle.Initialize("")
ivHandle.Background = LoadNinePatchDrawable("handle")
PanelWithSidebar.AddOpenCloseHandle(ivHandle, 0, 100%x, 70dip, 0)
lvMenu.Initialize("lvMenu")
lvMenu.AddSingleLine("1st option")
lvMenu.AddSingleLine("2nd option")
lvMenu.AddSingleLine("3rd option")
lvMenu.AddSingleLine("4th option")
lvMenu.AddSingleLine("5th option")
lvMenu.AddSingleLine("6th option")
lvMenu.AddSingleLine("7th option")
lvMenu.AddSingleLine("8th option")
lvMenu.Color = Colors.Transparent
lvMenu.ScrollingBackgroundColor = Colors.Transparent
PanelWithSidebar.Sidebar.AddView(lvMenu, 15dip, 15dip, PanelWithSidebar.Sidebar.Width - 30dip, PanelWithSidebar.Sidebar.Height - 30dip)
ivShadow.Initialize("")
ivShadow.Background = PanelWithSidebar.LoadDrawable("code_lock_bottom")
PanelWithSidebar.Sidebar.AddView(ivShadow, 0, 0, -1, 7dip)
pnlDarken.Initialize("")
pnlDarken.Color = Colors.ARGB(200, 0, 0, 0)
PanelWithSidebar.Sidebar.AddView(pnlDarken, 0, 0, -1, -1)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'Gets a 9-patch drawable from the application resources
Sub LoadNinePatchDrawable(ImageName As String) As Object
Dim r As Reflector
Dim package As String
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
Dim ID_Drawable As Int
ID_Drawable = r.GetStaticField(package & ".R$drawable", ImageName)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Return r.RunMethod2("getDrawable", ID_Drawable, "java.lang.int")
End Sub
Sub lvMenu_ItemClick (Position As Int, Value As Object)
lblInfo.Text = "LAST SELECTION: " & Value
PanelWithSidebar.CloseSidebar
End Sub
Sub Drawer_onFullyOpen
Log("FULLY OPEN")
End Sub
Sub Drawer_onFullyClosed
Log("FULLY CLOSED")
End Sub
Sub Drawer_onMove(IsOpening As Boolean)
Log("MOVE IsOpening=" & IsOpening)
Dim Transparency As Float
Transparency = 1 - ((100%y - PanelWithSidebar.Sidebar.Top) / PanelWithSidebar.Sidebar.Height)
pnlDarken.Color = Colors.ARGB(Transparency * 200, 0, 0, 0)
End Sub
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private ScrollView1 As ScrollView
Dim t As TextSetting
Dim l As Label
Dim F As Int
Private Button1 As Button
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
t.Initialize
'l.Initialize("l")
ScrollView1.Panel.LoadLayout("2")
'l.Text="111111111111112222222222222222223333333333333333333333333323333444444445555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555"
Label1.Text="111111111111112222222222222222223333333333333333333333333323333444444445555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555"
'ScrollView1.Panel.AddView(l,0+10dip,0,100%x-200dip,100%y)
Label1.TextSize=20
F=20
Start
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Start
t.LongText(Label1,Label1.Text,F,ScrollView1,1.5)
' l.Color=Colors.Transparent
ScrollView1.Color=Colors.Transparent
' l.TextColor=Colors.Green
End Sub
Sub Button1_Click
F=F+5
Start
End Sub