Italian New upgrade IMLibrary - ClassMyDialog

ivanomonti

Expert
Licensed User
Longtime User
Ecco una nuova aggiunta, finestre di dialogo personalizzate, semplici e molto efficaci

esempio codice

B4X:
#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

End Sub

Sub Globals
   Dim imd As ClassMyDialog
   Dim iml As ClassMyLayout
   Dim Button1 As Button
   Dim Button2 As Button
   Dim Button3 As Button
   Dim Button4 As Button
   Dim Button5 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("Main")
   iml.Initialize
   imd.Initialize(Colors.Red,Colors.Black)
   iml.SettingLayout(Activity)
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
   Dim btn As Button
   btn.Initialize("btn1")
   btn.Text = "Close"
   Dim s, ss As String
   s = "Basic4Android"
   ss = "Have you Liked any post today? Each post has a small Like link. Somebody helped you? Like the post. It doesn't add clutter like posting 'Thank you' and this will also help the search engine return better results."
   imd.Dialog01(Activity,s,ss,btn)
End Sub

Sub btn1_Click
   imd.DialogClose()
End Sub


Sub Button2_Click
   Dim btn1,btn2 As Button
 
   btn1.Initialize("btn1")
   btn1.Text = "Close"
 
   btn2.Initialize("btn1")
   btn2.Text = "Save"
 
   Dim s, ss As String
   s = "Basic4Android"
   ss = "Have you Liked any post today? Each post has a small Like link. Somebody helped you? Like the post. It doesn't add clutter like posting 'Thank you' and this will also help the search engine return better results."
   imd.Dialog02(Activity,s,ss,btn1,btn2)
End Sub

Sub Button3_Click
   Dim listV As ListView
   listV.Initialize("ListV")
   For i = 0 To 10
     listV.AddSingleLine("Line " & i)
   Next
   imd.Dialog03(Activity,listV)
End Sub

Sub Button4_Click
   Dim listV As ListView
   listV.Initialize("ListV")
   listV.TwoLinesLayout.Label.TextSize = 14
   listV.TwoLinesLayout.Label.TextColor = Colors.Yellow
   listV.TwoLinesLayout.Label.Typeface = Typeface.DEFAULT_BOLD
   listV.TwoLinesLayout.SecondLabel.TextSize = 12
   listV.TwoLinesLayout.SecondLabel.TextColor = Colors.White
   listV.TwoLinesLayout.SecondLabel.Typeface = Typeface.DEFAULT
   For i = 0 To 10
     listV.AddTwoLines("Line " & i,"Questo esempio non e formattato")
   Next
   imd.Dialog03(Activity,listV)
End Sub

Sub Button5_Click
   Dim bmp As Bitmap
   bmp.InitializeSample(File.DirAssets,"Android.png",32,32)
   Dim listV As ListView
   listV.Initialize("ListV")
   listV.TwoLinesAndBitmap.Label.TextSize = 14
   listV.TwoLinesAndBitmap.Label.TextColor = Colors.Yellow
   listV.TwoLinesAndBitmap.Label.Typeface = Typeface.DEFAULT_BOLD
   listV.TwoLinesAndBitmap.SecondLabel.TextSize = 12
   listV.TwoLinesAndBitmap.SecondLabel.TextColor = Colors.White
   listV.TwoLinesAndBitmap.SecondLabel.Typeface = Typeface.DEFAULT
   For i = 0 To 10
     listV.AddTwoLinesAndBitmap("Line " & i,"Questo esempio non e formattato",bmp)
   Next
   imd.Initialize(Colors.Black,Colors.ARGB(255,50,100,150))
   imd.Dialog03(Activity,listV)
End Sub

Sub ListV_ItemClick (Position As Int, Value As Object)
   imd.DialogClose()
End Sub


Sotto trovate anche lo screen, poi appena finisco di scrivere help metto in linea
 

Attachments

  • 2013-10-23_104840.png
    2013-10-23_104840.png
    73.3 KB · Views: 289
  • Libraries.zip
    32.2 KB · Views: 225
  • Screenshot_2013-10-23-16-34-50.png
    Screenshot_2013-10-23-16-34-50.png
    116.1 KB · Views: 218
  • Screenshot_2013-10-23-17-05-58.png
    Screenshot_2013-10-23-17-05-58.png
    120.8 KB · Views: 218
  • Screenshot_2013-10-23-17-18-46.png
    Screenshot_2013-10-23-17-18-46.png
    63.2 KB · Views: 218
  • 603564_595299067200870_1363697325_n.jpg
    603564_595299067200870_1363697325_n.jpg
    44.6 KB · Views: 304
  • 1383545_595299157200861_81969202_n.jpg
    1383545_595299157200861_81969202_n.jpg
    47.1 KB · Views: 234
Last edited:

luke2012

Well-Known Member
Licensed User
Longtime User
Ottimo lavoro Ivano !
Devo dire che questo tocco estetico era propio quello che mancava alle dialog di B4A :)

Penso che proverò molto presto il button2!
 

ivanomonti

Expert
Licensed User
Longtime User
Grazie, cmq la Libreria si chiama IMLibrary 1.02 dove trovi tutte le classi che piano piano commento e metto nel suo core.

  • ClassMyButton
  • ClassMyIntent
  • ClassMyLayout
  • ClassMyDialog
  • ClassMyBattery
  • ClassMyProcess
  • ClassMySensor
  • ClassMyServerClient
  • ClassMyXml
  • ClassMyToolBar
 

luke2012

Well-Known Member
Licensed User
Longtime User
Grazie, cmq la Libreria si chiama IMLibrary 1.02 dove trovi tutte le classi che piano piano commento e metto nel suo core.

  • ClassMyButton
  • ClassMyIntent
  • ClassMyLayout
  • ClassMyDialog
  • ClassMyBattery
  • ClassMyProcess
  • ClassMySensor
  • ClassMyServerClient
  • ClassMyXml
  • ClassMyToolBar

Ivano ma quindi per implementare per esempio la sub button4 basta usare il metodo .Dialog03 e non serve implementare un file di layout ?
 

ivanomonti

Expert
Licensed User
Longtime User
dichiari la variabile

dim cd as ClassMyDialog

La istanzi

cd.initialize

La pubblichi

cd.Dialog03(parametro, parametro)
 
Top