B4J Question AnotherProgressBar forzen during "Do While"

lumbanico

Member
Hello:

I have a AnotherProgressBar in a B4xDialog that I show while I add data from a sqlite datebase to a TableView. It lasts about 2-3 seconds.

The AnotherProgressBar works fine, but when a "Do While" begins to work the animation of the AnotherProgressBar get forzen.

B4X:
Private Sub FillTableView
   
    Dim w As Int = (MainForm.Width/100) * 60
    Dim h As Int = 150
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, w, h)
    p.LoadLayout("frmProgreso")
    lblB4XDTitulo.Text = "Title"
    lblB4XDTexto.Text = "Text"
    B4XDProgreso.BorderWidth = 0
    B4XDProgreso.ButtonsHeight = 0
    B4XDProgreso.ShowCustom(p, "", "", "")

    tbvPrincipal.SetColumns(Array As String("Id expte.", "Activo", "Fase", "Número", "Ref. SP", "Asunto", "Municipio", "Estado", "CUOTEX"))
    tbvPrincipal.Items.Clear
    Dim cur As ResultSet
    Dim senderfilter As Object = miBD.ExecQueryAsync("SQL", "SELECT tblExp_EX.ExpActivo, tblExp_EX.IdExp, tblFases.FasDenominacion, tblExp_EX.ExpNumero, tblExp_EX.ExpRefSP, tblExp_EX.ExpAsunto, tblMun_EX.MunDenominacion, tblEst_EX.EstDenominacion, STRFTIME('%d/%m/%Y', tblExp_EX.ExpCUOTEX) AS ExpCUOTEX FROM ((tblExp_EX INNER JOIN tblMun_EX ON tblExp_EX.ExpIdMunicipio = tblMun_EX.IdMun) INNER JOIN tblEst_EX ON tblExp_EX.ExpIdEstado = tblEst_EX.IdEst) INNER JOIN tblFases ON tblExp_EX.ExpIdFase = tblFases.IdFase;", Null)
    Wait For (senderfilter) SQL_QueryComplete (success As Boolean, rs As ResultSet)
    cur = rs
   
    Dim cols As List
    cols.Initialize
    For i = 0 To cur.ColumnCount - 1
        cols.Add(cur.GetColumnName(i))
    Next
    tbvPrincipal.SetColumns(cols)
   
    Do While cur.NextRow
       
        Dim values(cur.ColumnCount) As String
        For col = 0 To cur.ColumnCount - 1
            values(col) = cur.GetString2(col)
        Next
        tbvPrincipal.Items.Add(values)
    Loop

    cur.Close
   
    B4XDProgreso.Close(xui.DialogResponse_Cancel)

End Sub

Is there any way to do the animation works?

Thanks.
 
Top