package gunav2.keymon.com.mx;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class c_historicobat extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "gunav2.keymon.com.mx.c_historicobat");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.keymon.com.mx.c_historicobat.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public String _ruta = "";
public anywheresoftware.b4a.objects.ButtonWrapper _regresar = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.ButtonWrapper _borra = null;
public String _existe = "";
public String _result = "";
public anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_desc = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview2 = null;
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_nota = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_productohist = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_s1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_s2 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_s3 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_s4 = null;
public b4a.example3.customlistview _customlistview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_promediohist = null;
public b4a.example.dateutils _dateutils = null;
public gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.starter _starter = null;
public gunav2.keymon.com.mx.subs _subs = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _b4xpage_appear() throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _prohit = null;
int _sfdf = 0;
String _nombreproducto = "";
String _cant_sem4 = "";
String _cant_sem3 = "";
String _cant_sem2 = "";
String _cant_sem1 = "";
String _sql = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _prohit2 = null;
double _promx = 0;
int _c1 = 0;
int _c2 = 0;
int _c3 = 0;
int _c4 = 0;
 //BA.debugLineNum = 54;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 57;BA.debugLine="Panel1.Visible = False";
_panel1.setVisible(__c.False);
 //BA.debugLineNum = 58;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
 //BA.debugLineNum = 59;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
 //BA.debugLineNum = 60;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
 //BA.debugLineNum = 62;BA.debugLine="L_CANT.Text =\"\"";
_l_cant.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 63;BA.debugLine="L_TOTAL.Text=\"\"";
_l_total.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 64;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select count(";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as EXISTE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 65;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 66;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 67;BA.debugLine="C.Close";
_c.Close();
 //BA.debugLineNum = 68;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select HVD_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT, HVD_FECHA from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) order by HVD_FECHA asc")));
 //BA.debugLineNum = 69;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 70;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 71;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step15 = 1;
final int limit15 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit15 ;_i = _i + step15 ) {
 //BA.debugLineNum = 72;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 73;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 74;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 75;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 76;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 77;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 78;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 79;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
 //BA.debugLineNum = 80;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 81;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"HVD_PRONOMBR";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("HVD_PRONOMBRE")),BA.ObjectToCharSequence("Cantidad #"+_c.GetString("HVD_CANT")+" SubTotal $"+_c.GetString("HVD_COSTO_TOT")+"      Fecha: "+_c.GetString("HVD_FECHA")));
 }
};
 };
 //BA.debugLineNum = 84;BA.debugLine="If Existe <> 0 Then";
if ((_existe).equals(BA.NumberToString(0)) == false) { 
 //BA.debugLineNum = 85;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select SUM(H";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select SUM(HVD_CANT) AS PC_NOART, SUM(HVD_COSTO_TOT) AS PC_MONTO from HIST_VENTAS where HVD_CLIENTE in (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 86;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 87;BA.debugLine="L_CANT.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 88;BA.debugLine="L_TOTAL.Text = c.GetString(\"PC_MONTO\")";
_l_total.setText(BA.ObjectToCharSequence(_c.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 90;BA.debugLine="ListView1.Visible = False";
_listview1.setVisible(__c.False);
 //BA.debugLineNum = 92;BA.debugLine="CustomListView1.AsView.Height = Root.Height * 0.4";
_customlistview1._asview().setHeight((int) (_root.getHeight()*0.45));
 //BA.debugLineNum = 93;BA.debugLine="CustomListView1.Clear";
_customlistview1._clear();
 //BA.debugLineNum = 94;BA.debugLine="Dim prohit As Cursor = B4XPages.MainPage.skmt.Exe";
_prohit = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_prohit = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select distinct HVD_PRONOMBRE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) order by HVD_PRONOMBRE asc")));
 //BA.debugLineNum = 96;BA.debugLine="If prohit.RowCount > 0 Then";
if (_prohit.getRowCount()>0) { 
 //BA.debugLineNum = 99;BA.debugLine="For sfdf = 0 To prohit.RowCount - 1";
{
final int step39 = 1;
final int limit39 = (int) (_prohit.getRowCount()-1);
_sfdf = (int) (0) ;
for (;_sfdf <= limit39 ;_sfdf = _sfdf + step39 ) {
 //BA.debugLineNum = 100;BA.debugLine="prohit.Position = sfdf";
_prohit.setPosition(_sfdf);
 //BA.debugLineNum = 101;BA.debugLine="Dim nombreProducto As String = prohit.GetString";
_nombreproducto = _prohit.GetString("HVD_PRONOMBRE");
 //BA.debugLineNum = 105;BA.debugLine="Dim cant_sem4 As String = \"0\"";
_cant_sem4 = "0";
 //BA.debugLineNum = 106;BA.debugLine="Dim cant_sem3 As String = \"0\"";
_cant_sem3 = "0";
 //BA.debugLineNum = 107;BA.debugLine="Dim cant_sem2 As String = \"0\"";
_cant_sem2 = "0";
 //BA.debugLineNum = 108;BA.debugLine="Dim cant_sem1 As String = \"0\"";
_cant_sem1 = "0";
 //BA.debugLineNum = 141;BA.debugLine="Dim sql As String = $\"     WITH FechasObjetivo";
_sql = ("\n"+"    WITH FechasObjetivo (Fecha) AS (\n"+"        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-28 days'))\n"+"        UNION ALL\n"+"        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-21 days'))\n"+"        UNION ALL\n"+"        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-14 days'))\n"+"        UNION ALL\n"+"        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-7 days'))\n"+"    )\n"+"    SELECT \n"+"        COALESCE(SUM(H.HVD_CANT), 0) AS HVD_CANT_TOTAL,\n"+"        -- Si el mes de la fecha es igual al mes actual, devuelve 1, si no 0\n"+"        CASE WHEN SUBSTR(F.Fecha, 4, 2) = strftime('%m', 'now', 'localtime') THEN 1 ELSE 0 END AS EsMesActual\n"+"    FROM \n"+"        FechasObjetivo AS F\n"+"    LEFT JOIN \n"+"        HIST_VENTAS AS H \n"+"        ON F.Fecha = H.HVD_FECHA\n"+"        AND H.HVD_CLIENTE IN (SELECT CUENTA FROM cuentaa)\n"+"        AND H.HVD_PRONOMBRE = '"+__c.SmartStringFormatter("",(Object)(_nombreproducto))+"'\n"+"    GROUP BY F.Fecha\n"+"    ORDER BY SUBSTR(F.Fecha, 7, 4), SUBSTR(F.Fecha, 4, 2), SUBSTR(F.Fecha, 1, 2)\n"+"");
 //BA.debugLineNum = 169;BA.debugLine="Dim prohit2 As Cursor = B4XPages.MainPage.skmt.";
_prohit2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_prohit2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(_sql)));
 //BA.debugLineNum = 193;BA.debugLine="Dim promx As Double = (cant_sem4 +  cant_sem3 +";
_promx = ((double)(Double.parseDouble(_cant_sem4))+(double)(Double.parseDouble(_cant_sem3))+(double)(Double.parseDouble(_cant_sem2))+(double)(Double.parseDouble(_cant_sem1)))/(double)4;
 //BA.debugLineNum = 200;BA.debugLine="Dim c1, c2, c3, c4 As Int";
_c1 = 0;
_c2 = 0;
_c3 = 0;
_c4 = 0;
 //BA.debugLineNum = 202;BA.debugLine="If prohit2.RowCount = 4 Then";
if (_prohit2.getRowCount()==4) { 
 //BA.debugLineNum = 203;BA.debugLine="prohit2.Position = 0";
_prohit2.setPosition((int) (0));
 //BA.debugLineNum = 204;BA.debugLine="cant_sem4 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
_cant_sem4 = _prohit2.GetString("HVD_CANT_TOTAL");
 //BA.debugLineNum = 205;BA.debugLine="c1 = prohit2.GetInt(\"EsMesActual\")";
_c1 = _prohit2.GetInt("EsMesActual");
 //BA.debugLineNum = 207;BA.debugLine="prohit2.Position = 1";
_prohit2.setPosition((int) (1));
 //BA.debugLineNum = 208;BA.debugLine="cant_sem3 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
_cant_sem3 = _prohit2.GetString("HVD_CANT_TOTAL");
 //BA.debugLineNum = 209;BA.debugLine="c2 = prohit2.GetInt(\"EsMesActual\")";
_c2 = _prohit2.GetInt("EsMesActual");
 //BA.debugLineNum = 211;BA.debugLine="prohit2.Position = 2";
_prohit2.setPosition((int) (2));
 //BA.debugLineNum = 212;BA.debugLine="cant_sem2 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
_cant_sem2 = _prohit2.GetString("HVD_CANT_TOTAL");
 //BA.debugLineNum = 213;BA.debugLine="c3 = prohit2.GetInt(\"EsMesActual\")";
_c3 = _prohit2.GetInt("EsMesActual");
 //BA.debugLineNum = 215;BA.debugLine="prohit2.Position = 3";
_prohit2.setPosition((int) (3));
 //BA.debugLineNum = 216;BA.debugLine="cant_sem1 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
_cant_sem1 = _prohit2.GetString("HVD_CANT_TOTAL");
 //BA.debugLineNum = 217;BA.debugLine="c4 = prohit2.GetInt(\"EsMesActual\")";
_c4 = _prohit2.GetInt("EsMesActual");
 }else {
 //BA.debugLineNum = 219;BA.debugLine="Log(\"Error en filas\")";
__c.LogImpl("436372645","Error en filas",0);
 };
 //BA.debugLineNum = 221;BA.debugLine="prohit2.Close";
_prohit2.Close();
 //BA.debugLineNum = 224;BA.debugLine="CustomListView1.Add(CreateListItem(nombreProduc";
_customlistview1._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_nombreproducto,(int)(Double.parseDouble(_cant_sem4)),(int)(Double.parseDouble(_cant_sem3)),(int)(Double.parseDouble(_cant_sem2)),(int)(Double.parseDouble(_cant_sem1)),_promx,_c1,_c2,_c3,_c4).getObject())),(Object)(1));
 }
};
 //BA.debugLineNum = 228;BA.debugLine="prohit.Close ' Cerramos el cursor externo";
_prohit.Close();
 };
 //BA.debugLineNum = 235;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 44;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 45;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 47;BA.debugLine="Root.LoadLayout(\"nota2\")";
_root.LoadLayout("nota2",ba);
 //BA.debugLineNum = 48;BA.debugLine="borra.Visible = False";
_borra.setVisible(__c.False);
 //BA.debugLineNum = 49;BA.debugLine="Titulo.Text = \"Acumulado\"";
_titulo.setText(BA.ObjectToCharSequence("Acumulado"));
 //BA.debugLineNum = 50;BA.debugLine="b_desc.Visible = False";
_b_desc.setVisible(__c.False);
 //BA.debugLineNum = 51;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 5;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 6;BA.debugLine="Dim clie_id As String";
_clie_id = "";
 //BA.debugLineNum = 7;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 8;BA.debugLine="Dim usuario As String";
_usuario = "";
 //BA.debugLineNum = 10;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 12;BA.debugLine="Dim Regresar As Button";
_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 15;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 18;BA.debugLine="Dim borra As Button";
_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 19;BA.debugLine="Dim Existe As String";
_existe = "";
 //BA.debugLineNum = 20;BA.debugLine="Dim result As String";
_result = "";
 //BA.debugLineNum = 23;BA.debugLine="Private Titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Private b_desc As Button";
_b_desc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Private ListView2 As ListView";
_listview2 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 26;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
 //BA.debugLineNum = 27;BA.debugLine="Private p_nota As Panel";
_p_nota = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 28;BA.debugLine="Private Panel1 As Panel";
_panel1 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 29;BA.debugLine="Private l_productohist As Label";
_l_productohist = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 30;BA.debugLine="Private l_s1 As Label";
_l_s1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 31;BA.debugLine="Private l_s2 As Label";
_l_s2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 32;BA.debugLine="Private l_s3 As Label";
_l_s3 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 33;BA.debugLine="Private l_s4 As Label";
_l_s4 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 34;BA.debugLine="Private CustomListView1 As CustomListView";
_customlistview1 = new b4a.example3.customlistview();
 //BA.debugLineNum = 35;BA.debugLine="Private L_PROMEDIOHIST As Label";
_l_promediohist = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 36;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(String _prodhis,int _s1,int _s2,int _s3,int _s4,double _prom,int _m1,int _m2,int _m3,int _m4) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
 //BA.debugLineNum = 253;BA.debugLine="Sub CreateListItem(prodhis As String, s1 As Int, s";
 //BA.debugLineNum = 254;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 256;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, 288dip, 170dip)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),__c.DipToCurrent((int) (288)),__c.DipToCurrent((int) (170)));
 //BA.debugLineNum = 257;BA.debugLine="p.LoadLayout(\"historicobat\")";
_p.LoadLayout("historicobat",ba);
 //BA.debugLineNum = 259;BA.debugLine="l_productohist.Text = prodhis";
_l_productohist.setText(BA.ObjectToCharSequence(_prodhis));
 //BA.debugLineNum = 260;BA.debugLine="l_s1.Text = s1";
_l_s1.setText(BA.ObjectToCharSequence(_s1));
 //BA.debugLineNum = 261;BA.debugLine="l_s2.Text = s2";
_l_s2.setText(BA.ObjectToCharSequence(_s2));
 //BA.debugLineNum = 262;BA.debugLine="l_s3.Text = s3";
_l_s3.setText(BA.ObjectToCharSequence(_s3));
 //BA.debugLineNum = 263;BA.debugLine="l_s4.Text = s4";
_l_s4.setText(BA.ObjectToCharSequence(_s4));
 //BA.debugLineNum = 267;BA.debugLine="l_s1.Color = IIf(m1 = 1, xui.Color_Blue, xui.Colo";
_l_s1.setColor((int)(BA.ObjectToNumber(((_m1==1) ? ((Object)(_xui.Color_Blue)) : ((Object)(_xui.Color_Yellow))))));
 //BA.debugLineNum = 268;BA.debugLine="l_s2.Color = IIf(m2 = 1, xui.Color_Blue, xui.Colo";
_l_s2.setColor((int)(BA.ObjectToNumber(((_m2==1) ? ((Object)(_xui.Color_Blue)) : ((Object)(_xui.Color_Yellow))))));
 //BA.debugLineNum = 269;BA.debugLine="l_s3.Color = IIf(m3 = 1, xui.Color_Blue, xui.Colo";
_l_s3.setColor((int)(BA.ObjectToNumber(((_m3==1) ? ((Object)(_xui.Color_Blue)) : ((Object)(_xui.Color_Yellow))))));
 //BA.debugLineNum = 270;BA.debugLine="l_s4.Color = IIf(m4 = 1, xui.Color_Blue, xui.Colo";
_l_s4.setColor((int)(BA.ObjectToNumber(((_m4==1) ? ((Object)(_xui.Color_Blue)) : ((Object)(_xui.Color_Yellow))))));
 //BA.debugLineNum = 273;BA.debugLine="l_s1.TextColor = IIf(m1 = 1, xui.Color_White, xui";
_l_s1.setTextColor((int)(BA.ObjectToNumber(((_m1==1) ? ((Object)(_xui.Color_White)) : ((Object)(_xui.Color_Black))))));
 //BA.debugLineNum = 274;BA.debugLine="l_s2.TextColor = IIf(m2 = 1, xui.Color_White, xui";
_l_s2.setTextColor((int)(BA.ObjectToNumber(((_m2==1) ? ((Object)(_xui.Color_White)) : ((Object)(_xui.Color_Black))))));
 //BA.debugLineNum = 275;BA.debugLine="l_s3.TextColor = IIf(m3 = 1, xui.Color_White, xui";
_l_s3.setTextColor((int)(BA.ObjectToNumber(((_m3==1) ? ((Object)(_xui.Color_White)) : ((Object)(_xui.Color_Black))))));
 //BA.debugLineNum = 276;BA.debugLine="l_s4.TextColor = IIf(m4 = 1, xui.Color_White, xui";
_l_s4.setTextColor((int)(BA.ObjectToNumber(((_m4==1) ? ((Object)(_xui.Color_White)) : ((Object)(_xui.Color_Black))))));
 //BA.debugLineNum = 278;BA.debugLine="L_PROMEDIOHIST.Text = \"Promedio \" & NumberFormat(";
_l_promediohist.setText(BA.ObjectToCharSequence("Promedio "+__c.NumberFormat(_prom,(int) (1),(int) (2))));
 //BA.debugLineNum = 280;BA.debugLine="Return p";
if (true) return (anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(_p.getObject()));
 //BA.debugLineNum = 281;BA.debugLine="End Sub";
return null;
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 39;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 40;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 41;BA.debugLine="End Sub";
return null;
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
