Hi corwin42, i have used your awesome library in my project, unfortunately i didn't implemented it in proper way, the progress dialogue shown at the end not in the beginning of processing, any advice?
Sub Activity_Create(FirstTime As Boolean)
objWFI.JavaDebug = True
objWFI.PingHostOnReceive = True
objWFI.Initialize("objWFI")
LogColor("[isConnectedToInternet]" & objWFI.isConnectedToInternet() ,Colors.Blue)
If objWFI.isConnectedToInternet() = True Then
'***********************************
Mng.Initialize("DialogManager")
Dim Builder As MaterialDialogBuilder
Builder.Initialize("Dialog")
Builder.Title("Progress Dialog")
Builder.Content("Please wait...")
Builder.Progress(True, 0)
Builder.ProgressIndeterminateStyle(True)
Builder.Show
'***********************************
Dim xml As XmlLayoutBuilder
NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)
Activity.LoadLayout("layout1")
NavDrawer.InitDrawerToggle
ToolBar.InitMenuListener
Dim bd As BitmapDrawable
bd = xml.GetDrawable("ic_refresh_white_24dp")
Activity.AddMenuItem3("Refresh", "Menu", bd.Bitmap, True)
NavDrawer.NavigationView.LoadLayout( "navheaderLayout.bal", NavDrawer.DefaultHeaderHeight)
NavDrawer.NavigationView.Menu.AddWithGroup2(1, 1, 1, "Home", xml.GetDrawable("ic_home_black_24dp")).Checked = True
Dim actionViewItem As ACMenuItem
actionViewItem = NavDrawer.NavigationView.Menu.AddWithGroup2(1, 2, 2, "A Switch", xml.GetDrawable("ic_android_black_24dp"))
Switch.Initialize("")
actionViewItem.ActionView = Switch
NavDrawer.NavigationView.Menu.SetGroupCheckable(1, True, True)
actionViewItem.Checkable = False
NavDrawer.NavigationView.Menu.AddWithGroup2(2, 10, 1000, "Settings", xml.GetDrawable("ic_settings_black_24dp"))
NavDrawer.NavigationView.Menu.AddWithGroup2(2, 11, 1100, "Feedback", xml.GetDrawable("ic_feedback_black_24dp"))
NavDrawer.NavigationView.Menu.AddWithGroup2(2, 12, 1200, "Help", xml.GetDrawable("ic_help_black_24dp"))
NavDrawer.NavigationView.Menu.SetGroupCheckable(2, True, True)
NavDrawer.AddSecondaryDrawer(150dip, NavDrawer.GRAVITY_END)
NavDrawer.SecondaryNavigationView.LoadLayout("navHeaderLayout2", 100dip)
HeaderLabel.Text = "Fist Header"
NavDrawer.SecondaryNavigationView.LoadLayout("navHeaderLayout2", 50dip)
HeaderLabel.Text = "Second Header"
NavDrawer.SecondaryNavigationView.ItemIconColor = Colors.Red
NavDrawer.SecondaryNavigationView.SetItemTextColors(Colors.Gray, Colors.Red, Colors.Red, Colors.LightGray)
Dim subMenu As ACSubMenu
subMenu = NavDrawer.SecondaryNavigationView.Menu.AddSubMenu(3, 20, 20, "Pages")
'
dbCursor = Starter.dbSQL.ExecQuery("SELECT * FROM " & Starter.DBTblNamebanks)
If FirstTime Then
DisableStrictMode
ALEX
AAIB
MISR
CA
ALBARAKA
CBE
NBE
EG
ABK
BLOM
CAIRE
SC
HDB
ADIB
NBG
End If
If clv1.IsInitialized = False Then
clv1.Initialize(Me, "clv1")
End If
clv1.AsView.Color = Colors.Transparent
headerpnl.Initialize("")
PC.Initialize
Dim p, p1 As Panel
p.Initialize("")
p1.Initialize("")
p.Color = Colors.rgb(234, 234, 224)
Dim pageName, pageName1 As String
pageName = "سعر الدولار حاليا"
pageName1 = "متوسط سعر الذهب"
headerpnl.Color = Colors.rgb(234, 234, 224)
Dim LeftPos As Int
For i = 0 To 2
Dim cd As ColorDrawable
cd.Initialize(Colors.rgb(161, 150, 132), 4%x)
lblG(i).Initialize("")
lblG(i).Background = cd
If Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1) >=5 And Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1) < 6 Then
TextSize = GetDeviceLayoutValues.ApproximateScreenSize / 5
lblG(i).TextSize = 18 * TextSize
Else If Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1) >= 4 And Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1) < 5 Then
TextSize = GetDeviceLayoutValues.ApproximateScreenSize / 4
lblG(i).TextSize = 18 * TextSize
Else If Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1) >= 3 And Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1) < 4 Then
TextSize = GetDeviceLayoutValues.ApproximateScreenSize / 3
lblG(i).TextSize = 18 * TextSize
End If
' Log(Density)
' Log(GetDeviceLayoutValues)
' Log(Round2(GetDeviceLayoutValues.ApproximateScreenSize * 1.24,1))
' Log(GetDeviceLayoutValues.ApproximateScreenSize )
' Log(GetDeviceLayoutValues.Scale)
lblG(i).TextColor = Colors.Black
lblG(i).Typeface=Typeface.LoadFromAssets("az-topaz.ttf")
lblG(i).Gravity = Gravity.CENTER_HORIZONTAL + Gravity.CENTER_VERTICAL
Select i
Case 2: lblG(i).Text = "اسم البنك"
Case 1: lblG(i).Text = "سعر البيع"
Case 0: lblG(i).Text = "سعر الشراء"
End Select
lblG(i).Tag = i
headerpnl.AddView(lblG(i), LeftPos + 3 * DividerWidth , 0.5%y, Widths(i) - DividerWidth, 6%y)
LeftPos = LeftPos + Widths(i)
Next
p.AddView(headerpnl,1%x,2dip,98%x,7%y)
p.AddView(clv1.AsView, 1%x, 8%y, 98%X, 70%y)
PC.AddPage(p, pageName)
PC.AddPage(p1, pageName1)
subMenu.AddWithGroup2(3, 100+0, 100+0, pageName, xml.GetDrawable("ic_bookmark_black_24dp"))
subMenu.AddWithGroup2(3, 100+1, 100+1, pageName1, xml.GetDrawable("ic_bookmark_black_24dp"))
NavDrawer.SecondaryNavigationView.CheckedItem = 100
subMenu.SetGroupCheckable(3, True, True)
VP.PageContainer = PC
Dim Ac As AppCompat
TabLayout.Color = Ac.GetThemeAttribute("colorPrimary")
TabLayout.SetViewPager(VP)
For i = 0 To dbCursor.RowCount - 1
dbCursor.Position = i
clv1.Add(CreateListItem($"Item #${i}"$, clv1.AsView.Width, 8%y), 9%y, $"Item #${i}"$)
Next
Else
ToastMessageShow("من فضلك تأكد من انك متصل بالانترنت لتحديث الاسعار" , True)
End If
End Sub