#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: False
#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
Dim painel As Panel
Dim et_descricao As EditText
Dim tv_fabric As Label
Dim IME As IME
Dim scroll As ScrollView
Dim posicao_tela As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.Color = Colors.RGB(255,112,67)
IME.Initialize("IME")
IME.AddHeightChangedEvent
scroll.Initialize2(81%y,"scroll")
painel.Initialize("painel")
painel.Color = Colors.White
et_descricao.Initialize("et_descricao")
et_descricao.Hint = "Descrição"
et_descricao.ForceDoneButton = True
et_descricao.SingleLine = True
tv_fabric.Initialize("tv_fabric")
tv_fabric.Text = "Cadastro de fornecedor"
tv_fabric.Gravity = Gravity.CENTER
tv_fabric.TextSize = 20
tv_fabric.Typeface = Typeface.CreateNew(Typeface.MONOSPACE,Typeface.STYLE_BOLD)
painel.AddView(et_descricao,1%x,70%y,98%x,75)
Activity.AddView(tv_fabric,0,0,100%x,9%y)
Activity.AddView(scroll,0,9%y,100%x,81%y)
scroll.Panel.AddView(painel,0,0,100%x,81%y)
End Sub
Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
Dim rol_scrol As Int
If NewHeight = 100%y Then
scroll.Panel.Height = 81%y + 100%y - NewHeight
Else
scroll.Panel.Height = 71%y + 100%y - NewHeight
End If
rol_scrol = posicao_tela - (NewHeight - 9%y)
scroll.ScrollToNow(rol_scrol)
End Sub
Sub et_descricao_FocusChanged (HasFocus As Boolean)
If HasFocus Then
posicao_tela = et_descricao.Top + et_descricao.Height
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub