#Region Project Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: My App
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
'#DebuggerForceStandardAssets: true
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Public Sub CreateButtonColor(FocusedColor As Int, EnabledColor As Int, DisabledColor As Int, PressedColor As Int) As StateListDrawable
Dim res As StateListDrawable
res.Initialize
Dim drwFocusedColor, drwEnabledColor, drwDisabledColor, drwPressedColor As ColorDrawable
'drwFocusedColor.Initialize2(FocusedColor, 5, 0, Colors.LightGray) 'border roundness, thickness, and color on Android TV
'drwEnabledColor.Initialize2(EnabledColor, 5, 0, Colors.DarkGray)
'drwDisabledColor.Initialize2(DisabledColor, 5, 0, Colors.White)
'drwPressedColor.Initialize2(PressedColor, 5, 0, Colors.Black)
drwFocusedColor.Initialize2(FocusedColor, 0, 1, Colors.RGB(110,110,110))
drwEnabledColor.Initialize2(EnabledColor, 0, 0, Colors.RGB(110,110,110))
drwDisabledColor.Initialize2(DisabledColor, 0, 0, Colors.RGB(110,110,110))
drwPressedColor.Initialize2(PressedColor, 0, 0, Colors.RGB(110,110,110))
res.AddState(res.State_Focused, drwFocusedColor)
res.AddState(res.State_Pressed, drwPressedColor)
res.AddState(res.State_Enabled, drwEnabledColor)
res.AddState(res.State_Disabled, drwDisabledColor)
res.AddCatchAllState(drwEnabledColor)
Return res
End Sub
Sub Globals
Private CreateShortcut As Button
Private Help As Button
Private Exit As Button
Private Panel1 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("myappmain")
Dim re1 As RippleView 'RippleEffect for buttons that stay on same screen
re1.Initialize(CreateShortcut, Colors.Blue, 300, False) 'True will center the ripple, False will start the ripple where tapped
Dim re2 As RippleView
re2.Initialize(Help, Colors.Blue, 300, False)
Dim re3 As RippleView
re3.Initialize(Panel1, Colors.Green, 300, False)
'ExitB.Background = CreateButtonColor(Colors.RGB(0,51,102), Colors.RGB(0,33,88), Colors.White, Colors.RGB(0,76,153)) '<--from Public Subs
'Help.Background = CreateButtonColor(Colors.LightGray, Colors.DarkGray, Colors.White, Colors.Black) '<--from Public Subs
'Help.Background = CreateButtonColor(Colors.RGB(96,96,96), Colors.DarkGray, Colors.White, Colors.RGB(120,120,120)) '<--from Public Subs
Help.Background = CreateButtonColor(Colors.RGB(0,51,102), Colors.RGB(0,33,88), Colors.White, Colors.RGB(0,76,153)) '<--from Public Subs
CreateShortcut.Background = CreateButtonColor(Colors.RGB(0,51,102), Colors.RGB(0,33,88), Colors.White, Colors.RGB(0,76,153)) '<--from Public Subs
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Help_Click
StartActivity("Help1")
End Sub
Sub Exit_Click
ExitApplication
End Sub
Sub CreateShortCut_Click
Dim shortcutIntent As Intent
shortcutIntent.Initialize("", "")
shortcutIntent.SetComponent("My.App/.main") '<------change My.App for your own app file name here, like "My.Game", look into Tools, Build Configurations for your app's name
Dim in As Intent
in.Initialize("", "")
in.PutExtra("duplicate",False)
in.PutExtra("android.intent.extra.shortcut.INTENT", shortcutIntent)
in.PutExtra("android.intent.extra.shortcut.NAME", "My App") '<-----Type here the name of the shortcut, "My App" for "Your App"
in.PutExtra("android.intent.extra.shortcut.ICON", LoadBitmap(File.DirAssets, "color01.png")) '<----your app image here, "color01.png" for "yourpic.png"
in.Action = "com.android.launcher.action.INSTALL_SHORTCUT"
Dim p As Phone
p.SendBroadcastIntent(in)
DoEvents
End Sub