package keymon.lat.medicomed;


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

public class preoptimizedclv 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 anywheresoftware.b4a.ShellBA(_ba, this, htSubs, "keymon.lat.medicomed.preoptimizedclv");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", keymon.lat.medicomed.preoptimizedclv.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
public anywheresoftware.b4a.keywords.Common __c = null;
public b4a.example3.customlistview _mclv = null;
public anywheresoftware.b4a.objects.collections.List _items = null;
public anywheresoftware.b4a.objects.collections.List _panelscache = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _stubpanel = null;
public boolean _horizontal = false;
public keymon.lat.medicomed.b4xset[] _assigneditems = null;
public int _assigneditemsasindex = 0;
public anywheresoftware.b4j.object.JavaObject _jclv = null;
public int _extraitems = 0;
public anywheresoftware.b4a.objects.collections.List _listofitemsthatshouldbeupdated = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public boolean _showscrollbar = false;
public keymon.lat.medicomed.b4xseekbar _b4xseekbar1 = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _pnloverlay = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _lblhint = null;
public int _lastuserchangeindex = 0;
public int _numberofsteps = 0;
public int _delaybeforehidingoverlay = 0;
public Object _mcallback = null;
public String _meventname = "";
public b4a.example.dateutils _dateutils = null;
public keymon.lat.medicomed.main _main = null;
public keymon.lat.medicomed.starter _starter = null;
public keymon.lat.medicomed.subs _subs = null;
public keymon.lat.medicomed.appupdater _appupdater = null;
public keymon.lat.medicomed.mapa_rutas _mapa_rutas = null;
public keymon.lat.medicomed.tracker _tracker = null;
public keymon.lat.medicomed.newinst2 _newinst2 = null;
public keymon.lat.medicomed.b4xpages _b4xpages = null;
public keymon.lat.medicomed.b4xcollections _b4xcollections = null;
public keymon.lat.medicomed.httputils2service _httputils2service = null;
public keymon.lat.medicomed.xuiviewsutils _xuiviewsutils = null;
public String  _initialize(keymon.lat.medicomed.preoptimizedclv __ref,anywheresoftware.b4a.BA _ba,Object _callback,String _eventname,b4a.example3.customlistview _clv) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "initialize", true))
	 {return ((String) Debug.delegate(ba, "initialize", new Object[] {_ba,_callback,_eventname,_clv}));}
RDebugUtils.currentLine=65404928;
 //BA.debugLineNum = 65404928;BA.debugLine="Public Sub Initialize (Callback As Object, EventNa";
RDebugUtils.currentLine=65404929;
 //BA.debugLineNum = 65404929;BA.debugLine="mCLV = CLV";
__ref._mclv /*b4a.example3.customlistview*/  = _clv;
RDebugUtils.currentLine=65404930;
 //BA.debugLineNum = 65404930;BA.debugLine="jclv = mCLV 'ignore";
__ref._jclv /*anywheresoftware.b4j.object.JavaObject*/  = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(__ref._mclv /*b4a.example3.customlistview*/ ));
RDebugUtils.currentLine=65404935;
 //BA.debugLineNum = 65404935;BA.debugLine="items = jclv.GetFieldJO(\"_items\").RunMethod(\"getO";
__ref._items /*anywheresoftware.b4a.objects.collections.List*/  = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(__ref._jclv /*anywheresoftware.b4j.object.JavaObject*/ .GetFieldJO("_items").RunMethod("getObject",(Object[])(__c.Null))));
RDebugUtils.currentLine=65404936;
 //BA.debugLineNum = 65404936;BA.debugLine="horizontal = jclv.GetField(\"_horizontal\")";
__ref._horizontal /*boolean*/  = BA.ObjectToBoolean(__ref._jclv /*anywheresoftware.b4j.object.JavaObject*/ .GetField("_horizontal"));
RDebugUtils.currentLine=65404938;
 //BA.debugLineNum = 65404938;BA.debugLine="PanelsCache.Initialize";
__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=65404939;
 //BA.debugLineNum = 65404939;BA.debugLine="StubPanel = CreatePanel";
__ref._stubpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = __ref._createpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ (null);
RDebugUtils.currentLine=65404940;
 //BA.debugLineNum = 65404940;BA.debugLine="StubPanel.AddView(xui.CreatePanel(\"\"), 0, 0, 10di";
__ref._stubpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .AddView((android.view.View)(__ref._xui /*anywheresoftware.b4a.objects.B4XViewWrapper.XUI*/ .CreatePanel(ba,"").getObject()),(int) (0),(int) (0),__c.DipToCurrent((int) (10)),__c.DipToCurrent((int) (10)));
RDebugUtils.currentLine=65404941;
 //BA.debugLineNum = 65404941;BA.debugLine="AssignedItems = Array As B4XSet(B4XCollections.Cr";
__ref._assigneditems /*keymon.lat.medicomed.b4xset[]*/  = new keymon.lat.medicomed.b4xset[]{_b4xcollections._createset /*keymon.lat.medicomed.b4xset*/ (ba),_b4xcollections._createset /*keymon.lat.medicomed.b4xset*/ (ba)};
RDebugUtils.currentLine=65404942;
 //BA.debugLineNum = 65404942;BA.debugLine="ListOfItemsThatShouldBeUpdated.Initialize";
__ref._listofitemsthatshouldbeupdated /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=65404943;
 //BA.debugLineNum = 65404943;BA.debugLine="mCLV.AsView.LoadLayout(\"PCLVSeekBar\")";
__ref._mclv /*b4a.example3.customlistview*/ ._asview().LoadLayout("PCLVSeekBar",ba);
RDebugUtils.currentLine=65404944;
 //BA.debugLineNum = 65404944;BA.debugLine="B4XSeekBar1.Size1 = 1dip";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._size1 /*int*/  = __c.DipToCurrent((int) (1));
RDebugUtils.currentLine=65404945;
 //BA.debugLineNum = 65404945;BA.debugLine="B4XSeekBar1.Size2 = 1dip";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._size2 /*int*/  = __c.DipToCurrent((int) (1));
RDebugUtils.currentLine=65404946;
 //BA.debugLineNum = 65404946;BA.debugLine="B4XSeekBar1.Radius1 = 8dip";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._radius1 /*int*/  = __c.DipToCurrent((int) (8));
RDebugUtils.currentLine=65404947;
 //BA.debugLineNum = 65404947;BA.debugLine="B4XSeekBar1.Update";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._update /*String*/ (null);
RDebugUtils.currentLine=65404948;
 //BA.debugLineNum = 65404948;BA.debugLine="mCallback = Callback";
__ref._mcallback /*Object*/  = _callback;
RDebugUtils.currentLine=65404949;
 //BA.debugLineNum = 65404949;BA.debugLine="mEventName = EventName";
__ref._meventname /*String*/  = _eventname;
RDebugUtils.currentLine=65404950;
 //BA.debugLineNum = 65404950;BA.debugLine="End Sub";
return "";
}
public String  _commit(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "commit", true))
	 {return ((String) Debug.delegate(ba, "commit", null));}
int _dividersize = 0;
int _totalsize = 0;
int _i = 0;
b4a.example3.customlistview._clvitem _it = null;
RDebugUtils.currentLine=65536000;
 //BA.debugLineNum = 65536000;BA.debugLine="Public Sub Commit";
RDebugUtils.currentLine=65536001;
 //BA.debugLineNum = 65536001;BA.debugLine="ClearAssignedItems";
__ref._clearassigneditems /*String*/ (null);
RDebugUtils.currentLine=65536002;
 //BA.debugLineNum = 65536002;BA.debugLine="Dim DividerSize As Int = mCLV.DividerSize";
_dividersize = (int) (__ref._mclv /*b4a.example3.customlistview*/ ._getdividersize());
RDebugUtils.currentLine=65536003;
 //BA.debugLineNum = 65536003;BA.debugLine="Dim TotalSize As Int = DividerSize";
_totalsize = _dividersize;
RDebugUtils.currentLine=65536004;
 //BA.debugLineNum = 65536004;BA.debugLine="For i = 0 To items.Size - 1";
{
final int step4 = 1;
final int limit4 = (int) (__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .getSize()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=65536005;
 //BA.debugLineNum = 65536005;BA.debugLine="Dim it As CLVItem = items.Get(i)";
_it = (b4a.example3.customlistview._clvitem)(__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .Get(_i));
RDebugUtils.currentLine=65536006;
 //BA.debugLineNum = 65536006;BA.debugLine="it.Offset = TotalSize";
_it.Offset = _totalsize;
RDebugUtils.currentLine=65536007;
 //BA.debugLineNum = 65536007;BA.debugLine="TotalSize = TotalSize + it.Size + DividerSize";
_totalsize = (int) (_totalsize+_it.Size+_dividersize);
 }
};
RDebugUtils.currentLine=65536009;
 //BA.debugLineNum = 65536009;BA.debugLine="If horizontal Then";
if (__ref._horizontal /*boolean*/ ) { 
RDebugUtils.currentLine=65536010;
 //BA.debugLineNum = 65536010;BA.debugLine="mCLV.sv.ScrollViewContentWidth = TotalSize";
__ref._mclv /*b4a.example3.customlistview*/ ._sv.setScrollViewContentWidth(_totalsize);
 }else {
RDebugUtils.currentLine=65536012;
 //BA.debugLineNum = 65536012;BA.debugLine="mCLV.sv.ScrollViewContentHeight = TotalSize";
__ref._mclv /*b4a.example3.customlistview*/ ._sv.setScrollViewContentHeight(_totalsize);
 };
RDebugUtils.currentLine=65536014;
 //BA.debugLineNum = 65536014;BA.debugLine="B4XSeekBar1.mBase.Visible = ShowScrollBar";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._mbase /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setVisible(__ref._showscrollbar /*boolean*/ );
RDebugUtils.currentLine=65536015;
 //BA.debugLineNum = 65536015;BA.debugLine="If ShowScrollBar Then";
if (__ref._showscrollbar /*boolean*/ ) { 
RDebugUtils.currentLine=65536016;
 //BA.debugLineNum = 65536016;BA.debugLine="B4XSeekBar1.MaxValue = items.Size";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._maxvalue /*int*/  = __ref._items /*anywheresoftware.b4a.objects.collections.List*/ .getSize();
RDebugUtils.currentLine=65536017;
 //BA.debugLineNum = 65536017;BA.debugLine="B4XSeekBar1.Interval = items.Size / NumberOfStep";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._interval /*int*/  = (int) (__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .getSize()/(double)__ref._numberofsteps /*int*/ );
 };
RDebugUtils.currentLine=65536019;
 //BA.debugLineNum = 65536019;BA.debugLine="RaiseVisibleRangeEvent";
__ref._raisevisiblerangeevent /*String*/ (null);
RDebugUtils.currentLine=65536021;
 //BA.debugLineNum = 65536021;BA.debugLine="End Sub";
return "";
}
public String  _additem(keymon.lat.medicomed.preoptimizedclv __ref,int _size,int _clr,Object _value) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "additem", true))
	 {return ((String) Debug.delegate(ba, "additem", new Object[] {_size,_clr,_value}));}
b4a.example3.customlistview._clvitem _newitem = null;
RDebugUtils.currentLine=65470464;
 //BA.debugLineNum = 65470464;BA.debugLine="Public Sub AddItem (Size As Int, Clr As Int, Value";
RDebugUtils.currentLine=65470465;
 //BA.debugLineNum = 65470465;BA.debugLine="Dim NewItem As CLVItem";
_newitem = new b4a.example3.customlistview._clvitem();
RDebugUtils.currentLine=65470466;
 //BA.debugLineNum = 65470466;BA.debugLine="NewItem.Color = Clr";
_newitem.Color = _clr;
RDebugUtils.currentLine=65470467;
 //BA.debugLineNum = 65470467;BA.debugLine="NewItem.Panel = StubPanel";
_newitem.Panel = __ref._stubpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ ;
RDebugUtils.currentLine=65470468;
 //BA.debugLineNum = 65470468;BA.debugLine="NewItem.Value = Value";
_newitem.Value = _value;
RDebugUtils.currentLine=65470469;
 //BA.debugLineNum = 65470469;BA.debugLine="NewItem.Size = Size";
_newitem.Size = _size;
RDebugUtils.currentLine=65470470;
 //BA.debugLineNum = 65470470;BA.debugLine="items.Add(NewItem)";
__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .Add((Object)(_newitem));
RDebugUtils.currentLine=65470471;
 //BA.debugLineNum = 65470471;BA.debugLine="End Sub";
return "";
}
public void  _b4xseekbar1_touchstatechanged(keymon.lat.medicomed.preoptimizedclv __ref,boolean _pressed) throws Exception{
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "b4xseekbar1_touchstatechanged", true))
	 {Debug.delegate(ba, "b4xseekbar1_touchstatechanged", new Object[] {_pressed}); return;}
ResumableSub_B4XSeekBar1_TouchStateChanged rsub = new ResumableSub_B4XSeekBar1_TouchStateChanged(this,__ref,_pressed);
rsub.resume(ba, null);
}
public static class ResumableSub_B4XSeekBar1_TouchStateChanged extends BA.ResumableSub {
public ResumableSub_B4XSeekBar1_TouchStateChanged(keymon.lat.medicomed.preoptimizedclv parent,keymon.lat.medicomed.preoptimizedclv __ref,boolean _pressed) {
this.parent = parent;
this.__ref = __ref;
this._pressed = _pressed;
this.__ref = parent;
}
keymon.lat.medicomed.preoptimizedclv __ref;
keymon.lat.medicomed.preoptimizedclv parent;
boolean _pressed;
anywheresoftware.b4j.object.JavaObject _jo = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="preoptimizedclv";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=66060289;
 //BA.debugLineNum = 66060289;BA.debugLine="If Pressed = False Then";
if (true) break;

case 1:
//if
this.state = 6;
if (_pressed==parent.__c.False) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
RDebugUtils.currentLine=66060290;
 //BA.debugLineNum = 66060290;BA.debugLine="mCLV.JumpToItem(LastUserChangeIndex)";
__ref._mclv /*b4a.example3.customlistview*/ ._jumptoitem(__ref._lastuserchangeindex /*int*/ );
RDebugUtils.currentLine=66060291;
 //BA.debugLineNum = 66060291;BA.debugLine="Sleep(DelayBeforeHidingOverlay)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "preoptimizedclv", "b4xseekbar1_touchstatechanged"),__ref._delaybeforehidingoverlay /*int*/ );
this.state = 7;
return;
case 7:
//C
this.state = 6;
;
RDebugUtils.currentLine=66060292;
 //BA.debugLineNum = 66060292;BA.debugLine="pnlOverlay.Visible = False";
__ref._pnloverlay /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setVisible(parent.__c.False);
 if (true) break;

case 5:
//C
this.state = 6;
RDebugUtils.currentLine=66060294;
 //BA.debugLineNum = 66060294;BA.debugLine="pnlOverlay.Visible = True";
__ref._pnloverlay /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setVisible(parent.__c.True);
RDebugUtils.currentLine=66060296;
 //BA.debugLineNum = 66060296;BA.debugLine="Dim jo As JavaObject = mCLV.sv";
_jo = new anywheresoftware.b4j.object.JavaObject();
_jo = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(__ref._mclv /*b4a.example3.customlistview*/ ._sv.getObject()));
RDebugUtils.currentLine=66060297;
 //BA.debugLineNum = 66060297;BA.debugLine="jo.RunMethod(\"fling\", Array(0))";
_jo.RunMethod("fling",new Object[]{(Object)(0)});
 if (true) break;

case 6:
//C
this.state = -1;
;
RDebugUtils.currentLine=66060300;
 //BA.debugLineNum = 66060300;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xseekbar1_valuechanged(keymon.lat.medicomed.preoptimizedclv __ref,int _value) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "b4xseekbar1_valuechanged", true))
	 {return ((String) Debug.delegate(ba, "b4xseekbar1_valuechanged", new Object[] {_value}));}
Object _t = null;
RDebugUtils.currentLine=66125824;
 //BA.debugLineNum = 66125824;BA.debugLine="Sub B4XSeekBar1_ValueChanged (Value As Int)";
RDebugUtils.currentLine=66125825;
 //BA.debugLineNum = 66125825;BA.debugLine="LastUserChangeIndex = Max(0, items.Size - 1 - Val";
__ref._lastuserchangeindex /*int*/  = (int) (__c.Max(0,__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .getSize()-1-_value));
RDebugUtils.currentLine=66125826;
 //BA.debugLineNum = 66125826;BA.debugLine="If LastUserChangeIndex < B4XSeekBar1.Interval The";
if (__ref._lastuserchangeindex /*int*/ <__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._interval /*int*/ ) { 
__ref._lastuserchangeindex /*int*/  = (int) (0);};
RDebugUtils.currentLine=66125827;
 //BA.debugLineNum = 66125827;BA.debugLine="lblHint.Text = \"\"";
__ref._lblhint /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=66125828;
 //BA.debugLineNum = 66125828;BA.debugLine="If xui.SubExists(mCallback, mEventName & \"_HintRe";
if (__ref._xui /*anywheresoftware.b4a.objects.B4XViewWrapper.XUI*/ .SubExists(ba,__ref._mcallback /*Object*/ ,__ref._meventname /*String*/ +"_HintRequested",(int) (1))) { 
RDebugUtils.currentLine=66125829;
 //BA.debugLineNum = 66125829;BA.debugLine="Dim t As Object = CallSub2(mCallback, mEventName";
_t = __c.CallSubNew2(ba,__ref._mcallback /*Object*/ ,__ref._meventname /*String*/ +"_HintRequested",(Object)(__ref._lastuserchangeindex /*int*/ ));
RDebugUtils.currentLine=66125830;
 //BA.debugLineNum = 66125830;BA.debugLine="If t <> Null Then";
if (_t!= null) { 
RDebugUtils.currentLine=66125831;
 //BA.debugLineNum = 66125831;BA.debugLine="InternalSetTextOrCSBuilderToLabel(lblHint, t)";
__ref._internalsettextorcsbuildertolabel /*String*/ (null,__ref._lblhint /*anywheresoftware.b4a.objects.B4XViewWrapper*/ ,_t);
 };
 };
RDebugUtils.currentLine=66125834;
 //BA.debugLineNum = 66125834;BA.debugLine="End Sub";
return "";
}
public String  _internalsettextorcsbuildertolabel(keymon.lat.medicomed.preoptimizedclv __ref,anywheresoftware.b4a.objects.B4XViewWrapper _xlbl,Object _text) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "internalsettextorcsbuildertolabel", true))
	 {return ((String) Debug.delegate(ba, "internalsettextorcsbuildertolabel", new Object[] {_xlbl,_text}));}
RDebugUtils.currentLine=66191360;
 //BA.debugLineNum = 66191360;BA.debugLine="Private Sub InternalSetTextOrCSBuilderToLabel(xlbl";
RDebugUtils.currentLine=66191362;
 //BA.debugLineNum = 66191362;BA.debugLine="xlbl.Text = Text";
_xlbl.setText(BA.ObjectToCharSequence(_text));
RDebugUtils.currentLine=66191372;
 //BA.debugLineNum = 66191372;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
RDebugUtils.currentLine=65339392;
 //BA.debugLineNum = 65339392;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=65339393;
 //BA.debugLineNum = 65339393;BA.debugLine="Private mCLV As CustomListView";
_mclv = new b4a.example3.customlistview();
RDebugUtils.currentLine=65339394;
 //BA.debugLineNum = 65339394;BA.debugLine="Private items As List";
_items = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=65339395;
 //BA.debugLineNum = 65339395;BA.debugLine="Private PanelsCache As List";
_panelscache = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=65339396;
 //BA.debugLineNum = 65339396;BA.debugLine="Private StubPanel As B4XView";
_stubpanel = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=65339397;
 //BA.debugLineNum = 65339397;BA.debugLine="Private horizontal As Boolean";
_horizontal = false;
RDebugUtils.currentLine=65339398;
 //BA.debugLineNum = 65339398;BA.debugLine="Private AssignedItems() As B4XSet";
_assigneditems = new keymon.lat.medicomed.b4xset[(int) (0)];
{
int d0 = _assigneditems.length;
for (int i0 = 0;i0 < d0;i0++) {
_assigneditems[i0] = new keymon.lat.medicomed.b4xset();
}
}
;
RDebugUtils.currentLine=65339399;
 //BA.debugLineNum = 65339399;BA.debugLine="Private AssignedItemsAsIndex As Int";
_assigneditemsasindex = 0;
RDebugUtils.currentLine=65339403;
 //BA.debugLineNum = 65339403;BA.debugLine="Private jclv As JavaObject";
_jclv = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=65339405;
 //BA.debugLineNum = 65339405;BA.debugLine="Public ExtraItems As Int = 3";
_extraitems = (int) (3);
RDebugUtils.currentLine=65339406;
 //BA.debugLineNum = 65339406;BA.debugLine="Private ListOfItemsThatShouldBeUpdated As List";
_listofitemsthatshouldbeupdated = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=65339407;
 //BA.debugLineNum = 65339407;BA.debugLine="Private xui As XUI";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=65339408;
 //BA.debugLineNum = 65339408;BA.debugLine="Public ShowScrollBar As Boolean = True";
_showscrollbar = __c.True;
RDebugUtils.currentLine=65339409;
 //BA.debugLineNum = 65339409;BA.debugLine="Public B4XSeekBar1 As B4XSeekBar";
_b4xseekbar1 = new keymon.lat.medicomed.b4xseekbar();
RDebugUtils.currentLine=65339410;
 //BA.debugLineNum = 65339410;BA.debugLine="Public pnlOverlay As B4XView";
_pnloverlay = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=65339411;
 //BA.debugLineNum = 65339411;BA.debugLine="Public lblHint As B4XView";
_lblhint = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=65339412;
 //BA.debugLineNum = 65339412;BA.debugLine="Private LastUserChangeIndex As Int";
_lastuserchangeindex = 0;
RDebugUtils.currentLine=65339413;
 //BA.debugLineNum = 65339413;BA.debugLine="Public NumberOfSteps As Int = 20";
_numberofsteps = (int) (20);
RDebugUtils.currentLine=65339414;
 //BA.debugLineNum = 65339414;BA.debugLine="Public DelayBeforeHidingOverlay As Int = 50";
_delaybeforehidingoverlay = (int) (50);
RDebugUtils.currentLine=65339415;
 //BA.debugLineNum = 65339415;BA.debugLine="Private mCallback As Object";
_mcallback = new Object();
RDebugUtils.currentLine=65339416;
 //BA.debugLineNum = 65339416;BA.debugLine="Private mEventName As String";
_meventname = "";
RDebugUtils.currentLine=65339417;
 //BA.debugLineNum = 65339417;BA.debugLine="End Sub";
return "";
}
public String  _clearassigneditems(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "clearassigneditems", true))
	 {return ((String) Debug.delegate(ba, "clearassigneditems", null));}
keymon.lat.medicomed.b4xset _s = null;
RDebugUtils.currentLine=65929216;
 //BA.debugLineNum = 65929216;BA.debugLine="Private Sub ClearAssignedItems";
RDebugUtils.currentLine=65929217;
 //BA.debugLineNum = 65929217;BA.debugLine="For Each s As B4XSet In AssignedItems";
{
final keymon.lat.medicomed.b4xset[] group1 = __ref._assigneditems /*keymon.lat.medicomed.b4xset[]*/ ;
final int groupLen1 = group1.length
;int index1 = 0;
;
for (; index1 < groupLen1;index1++){
_s = group1[index1];
RDebugUtils.currentLine=65929218;
 //BA.debugLineNum = 65929218;BA.debugLine="s.Clear";
_s._clear /*String*/ (null);
 }
};
RDebugUtils.currentLine=65929220;
 //BA.debugLineNum = 65929220;BA.debugLine="End Sub";
return "";
}
public String  _raisevisiblerangeevent(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "raisevisiblerangeevent", true))
	 {return ((String) Debug.delegate(ba, "raisevisiblerangeevent", null));}
RDebugUtils.currentLine=65601536;
 //BA.debugLineNum = 65601536;BA.debugLine="Private Sub RaiseVisibleRangeEvent";
RDebugUtils.currentLine=65601537;
 //BA.debugLineNum = 65601537;BA.debugLine="jclv.RunMethod(\"_resetvisibles\", Null)";
__ref._jclv /*anywheresoftware.b4j.object.JavaObject*/ .RunMethod("_resetvisibles",(Object[])(__c.Null));
RDebugUtils.currentLine=65601538;
 //BA.debugLineNum = 65601538;BA.debugLine="jclv.RunMethod(\"_updatevisiblerange\", Null)";
__ref._jclv /*anywheresoftware.b4j.object.JavaObject*/ .RunMethod("_updatevisiblerange",(Object[])(__c.Null));
RDebugUtils.currentLine=65601539;
 //BA.debugLineNum = 65601539;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.B4XViewWrapper  _createpanel(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "createpanel", true))
	 {return ((anywheresoftware.b4a.objects.B4XViewWrapper) Debug.delegate(ba, "createpanel", null));}
RDebugUtils.currentLine=65667072;
 //BA.debugLineNum = 65667072;BA.debugLine="Private Sub CreatePanel As B4XView";
RDebugUtils.currentLine=65667076;
 //BA.debugLineNum = 65667076;BA.debugLine="Return jclv.RunMethodJO(\"_createpanel\", Array(\"Pa";
if (true) return (anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__ref._jclv /*anywheresoftware.b4j.object.JavaObject*/ .RunMethodJO("_createpanel",new Object[]{(Object)("Panel")}).RunMethod("getObject",(Object[])(__c.Null))));
RDebugUtils.currentLine=65667078;
 //BA.debugLineNum = 65667078;BA.debugLine="End Sub";
return null;
}
public anywheresoftware.b4a.objects.B4XViewWrapper  _getpanel(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "getpanel", true))
	 {return ((anywheresoftware.b4a.objects.B4XViewWrapper) Debug.delegate(ba, "getpanel", null));}
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
RDebugUtils.currentLine=65863680;
 //BA.debugLineNum = 65863680;BA.debugLine="Private Sub GetPanel As B4XView";
RDebugUtils.currentLine=65863681;
 //BA.debugLineNum = 65863681;BA.debugLine="If PanelsCache.Size = 0 Then Return CreatePanel";
if (__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .getSize()==0) { 
if (true) return __ref._createpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ (null);};
RDebugUtils.currentLine=65863682;
 //BA.debugLineNum = 65863682;BA.debugLine="Dim p As B4XView = PanelsCache.Get(PanelsCache.Si";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = (anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .Get((int) (__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .getSize()-1))));
RDebugUtils.currentLine=65863683;
 //BA.debugLineNum = 65863683;BA.debugLine="PanelsCache.RemoveAt(PanelsCache.Size - 1)";
__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .RemoveAt((int) (__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .getSize()-1));
RDebugUtils.currentLine=65863684;
 //BA.debugLineNum = 65863684;BA.debugLine="Return p";
if (true) return _p;
RDebugUtils.currentLine=65863685;
 //BA.debugLineNum = 65863685;BA.debugLine="End Sub";
return null;
}
public String  _handlescrollbar(keymon.lat.medicomed.preoptimizedclv __ref,int _firstvisible) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "handlescrollbar", true))
	 {return ((String) Debug.delegate(ba, "handlescrollbar", new Object[] {_firstvisible}));}
RDebugUtils.currentLine=65798144;
 //BA.debugLineNum = 65798144;BA.debugLine="Private Sub HandleScrollBar (FirstVisible As Int)";
RDebugUtils.currentLine=65798145;
 //BA.debugLineNum = 65798145;BA.debugLine="If ShowScrollBar = False Then Return";
if (__ref._showscrollbar /*boolean*/ ==__c.False) { 
if (true) return "";};
RDebugUtils.currentLine=65798146;
 //BA.debugLineNum = 65798146;BA.debugLine="B4XSeekBar1.Value = items.Size - FirstVisible";
__ref._b4xseekbar1 /*keymon.lat.medicomed.b4xseekbar*/ ._setvalue /*int*/ (null,(int) (__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .getSize()-_firstvisible));
RDebugUtils.currentLine=65798147;
 //BA.debugLineNum = 65798147;BA.debugLine="End Sub";
return "";
}
public void  _listchangedexternally(keymon.lat.medicomed.preoptimizedclv __ref) throws Exception{
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "listchangedexternally", true))
	 {Debug.delegate(ba, "listchangedexternally", null); return;}
ResumableSub_ListChangedExternally rsub = new ResumableSub_ListChangedExternally(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_ListChangedExternally extends BA.ResumableSub {
public ResumableSub_ListChangedExternally(keymon.lat.medicomed.preoptimizedclv parent,keymon.lat.medicomed.preoptimizedclv __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
keymon.lat.medicomed.preoptimizedclv __ref;
keymon.lat.medicomed.preoptimizedclv parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="preoptimizedclv";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = -1;
RDebugUtils.currentLine=65994753;
 //BA.debugLineNum = 65994753;BA.debugLine="ClearAssignedItems";
__ref._clearassigneditems /*String*/ (null);
RDebugUtils.currentLine=65994754;
 //BA.debugLineNum = 65994754;BA.debugLine="Sleep(0)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "preoptimizedclv", "listchangedexternally"),(int) (0));
this.state = 1;
return;
case 1:
//C
this.state = -1;
;
RDebugUtils.currentLine=65994755;
 //BA.debugLineNum = 65994755;BA.debugLine="RaiseVisibleRangeEvent";
__ref._raisevisiblerangeevent /*String*/ (null);
RDebugUtils.currentLine=65994756;
 //BA.debugLineNum = 65994756;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.objects.collections.List  _visiblerangechanged(keymon.lat.medicomed.preoptimizedclv __ref,int _firstindex,int _lastindex) throws Exception{
__ref = this;
RDebugUtils.currentModule="preoptimizedclv";
if (Debug.shouldDelegate(ba, "visiblerangechanged", true))
	 {return ((anywheresoftware.b4a.objects.collections.List) Debug.delegate(ba, "visiblerangechanged", new Object[] {_firstindex,_lastindex}));}
int _fromindex = 0;
int _toindex = 0;
keymon.lat.medicomed.b4xset _prevset = null;
keymon.lat.medicomed.b4xset _nextset = null;
int _i = 0;
b4a.example3.customlistview._clvitem _it = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
RDebugUtils.currentLine=65732608;
 //BA.debugLineNum = 65732608;BA.debugLine="Public Sub VisibleRangeChanged (FirstIndex As Int,";
RDebugUtils.currentLine=65732609;
 //BA.debugLineNum = 65732609;BA.debugLine="Dim FromIndex As Int = Max(0, FirstIndex - ExtraI";
_fromindex = (int) (__c.Max(0,_firstindex-__ref._extraitems /*int*/ ));
RDebugUtils.currentLine=65732610;
 //BA.debugLineNum = 65732610;BA.debugLine="Dim ToIndex As Int = Min(mCLV.Size - 1, LastIndex";
_toindex = (int) (__c.Min(__ref._mclv /*b4a.example3.customlistview*/ ._getsize()-1,_lastindex+__ref._extraitems /*int*/ ));
RDebugUtils.currentLine=65732611;
 //BA.debugLineNum = 65732611;BA.debugLine="Dim PrevSet As B4XSet = AssignedItems(AssignedIte";
_prevset = __ref._assigneditems /*keymon.lat.medicomed.b4xset[]*/ [__ref._assigneditemsasindex /*int*/ ];
RDebugUtils.currentLine=65732612;
 //BA.debugLineNum = 65732612;BA.debugLine="AssignedItemsAsIndex = (AssignedItemsAsIndex + 1)";
__ref._assigneditemsasindex /*int*/  = (int) ((__ref._assigneditemsasindex /*int*/ +1)%2);
RDebugUtils.currentLine=65732613;
 //BA.debugLineNum = 65732613;BA.debugLine="Dim NextSet As B4XSet = AssignedItems(AssignedIte";
_nextset = __ref._assigneditems /*keymon.lat.medicomed.b4xset[]*/ [__ref._assigneditemsasindex /*int*/ ];
RDebugUtils.currentLine=65732614;
 //BA.debugLineNum = 65732614;BA.debugLine="NextSet.Clear";
_nextset._clear /*String*/ (null);
RDebugUtils.currentLine=65732615;
 //BA.debugLineNum = 65732615;BA.debugLine="ListOfItemsThatShouldBeUpdated.Initialize";
__ref._listofitemsthatshouldbeupdated /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=65732616;
 //BA.debugLineNum = 65732616;BA.debugLine="For i = FromIndex To ToIndex";
{
final int step8 = 1;
final int limit8 = _toindex;
_i = _fromindex ;
for (;_i <= limit8 ;_i = _i + step8 ) {
RDebugUtils.currentLine=65732617;
 //BA.debugLineNum = 65732617;BA.debugLine="Dim it As CLVItem = items.Get(i)";
_it = (b4a.example3.customlistview._clvitem)(__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .Get(_i));
RDebugUtils.currentLine=65732618;
 //BA.debugLineNum = 65732618;BA.debugLine="If it.Panel = StubPanel Then";
if ((_it.Panel).equals(__ref._stubpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ )) { 
RDebugUtils.currentLine=65732619;
 //BA.debugLineNum = 65732619;BA.debugLine="it.Panel = GetPanel";
_it.Panel = __ref._getpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ (null);
RDebugUtils.currentLine=65732620;
 //BA.debugLineNum = 65732620;BA.debugLine="it.Panel.Tag = i";
_it.Panel.setTag((Object)(_i));
RDebugUtils.currentLine=65732621;
 //BA.debugLineNum = 65732621;BA.debugLine="it.Panel.Color = it.Color";
_it.Panel.setColor(_it.Color);
RDebugUtils.currentLine=65732622;
 //BA.debugLineNum = 65732622;BA.debugLine="If horizontal Then";
if (__ref._horizontal /*boolean*/ ) { 
RDebugUtils.currentLine=65732623;
 //BA.debugLineNum = 65732623;BA.debugLine="mCLV.sv.ScrollViewInnerPanel.AddView(it.Panel,";
__ref._mclv /*b4a.example3.customlistview*/ ._sv.getScrollViewInnerPanel().AddView((android.view.View)(_it.Panel.getObject()),_it.Offset,(int) (0),_it.Size,__ref._mclv /*b4a.example3.customlistview*/ ._sv.getHeight());
 }else {
RDebugUtils.currentLine=65732625;
 //BA.debugLineNum = 65732625;BA.debugLine="mCLV.sv.ScrollViewInnerPanel.AddView(it.Panel,";
__ref._mclv /*b4a.example3.customlistview*/ ._sv.getScrollViewInnerPanel().AddView((android.view.View)(_it.Panel.getObject()),(int) (0),_it.Offset,__ref._mclv /*b4a.example3.customlistview*/ ._sv.getWidth(),_it.Size);
 };
RDebugUtils.currentLine=65732627;
 //BA.debugLineNum = 65732627;BA.debugLine="NextSet.Add(it.Panel)";
_nextset._add /*String*/ (null,(Object)(_it.Panel.getObject()));
RDebugUtils.currentLine=65732628;
 //BA.debugLineNum = 65732628;BA.debugLine="ListOfItemsThatShouldBeUpdated.Add(i)";
__ref._listofitemsthatshouldbeupdated /*anywheresoftware.b4a.objects.collections.List*/ .Add((Object)(_i));
 }else 
{RDebugUtils.currentLine=65732629;
 //BA.debugLineNum = 65732629;BA.debugLine="Else if PrevSet.Contains(it.Panel) Then";
if (_prevset._contains /*boolean*/ (null,(Object)(_it.Panel.getObject()))) { 
RDebugUtils.currentLine=65732630;
 //BA.debugLineNum = 65732630;BA.debugLine="NextSet.Add(it.Panel)";
_nextset._add /*String*/ (null,(Object)(_it.Panel.getObject()));
 }}
;
 }
};
RDebugUtils.currentLine=65732633;
 //BA.debugLineNum = 65732633;BA.debugLine="For Each pnl As B4XView In PrevSet.AsList";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
{
final anywheresoftware.b4a.BA.IterableList group25 = _prevset._aslist /*anywheresoftware.b4a.objects.collections.List*/ (null);
final int groupLen25 = group25.getSize()
;int index25 = 0;
;
for (; index25 < groupLen25;index25++){
_pnl = (anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(group25.Get(index25)));
RDebugUtils.currentLine=65732634;
 //BA.debugLineNum = 65732634;BA.debugLine="If NextSet.Contains(pnl) = False Then";
if (_nextset._contains /*boolean*/ (null,(Object)(_pnl.getObject()))==__c.False) { 
RDebugUtils.currentLine=65732635;
 //BA.debugLineNum = 65732635;BA.debugLine="If pnl.Parent.IsInitialized Then";
if (_pnl.getParent().IsInitialized()) { 
RDebugUtils.currentLine=65732636;
 //BA.debugLineNum = 65732636;BA.debugLine="pnl.RemoveViewFromParent";
_pnl.RemoveViewFromParent();
RDebugUtils.currentLine=65732637;
 //BA.debugLineNum = 65732637;BA.debugLine="pnl.GetView(0).RemoveAllViews";
_pnl.GetView((int) (0)).RemoveAllViews();
RDebugUtils.currentLine=65732638;
 //BA.debugLineNum = 65732638;BA.debugLine="pnl.RemoveAllViews";
_pnl.RemoveAllViews();
RDebugUtils.currentLine=65732639;
 //BA.debugLineNum = 65732639;BA.debugLine="PanelsCache.Add(pnl)";
__ref._panelscache /*anywheresoftware.b4a.objects.collections.List*/ .Add((Object)(_pnl.getObject()));
RDebugUtils.currentLine=65732640;
 //BA.debugLineNum = 65732640;BA.debugLine="Dim it As CLVItem = items.Get(pnl.Tag)";
_it = (b4a.example3.customlistview._clvitem)(__ref._items /*anywheresoftware.b4a.objects.collections.List*/ .Get((int)(BA.ObjectToNumber(_pnl.getTag()))));
RDebugUtils.currentLine=65732641;
 //BA.debugLineNum = 65732641;BA.debugLine="it.Panel = StubPanel";
_it.Panel = __ref._stubpanel /*anywheresoftware.b4a.objects.B4XViewWrapper*/ ;
 };
 };
 }
};
RDebugUtils.currentLine=65732645;
 //BA.debugLineNum = 65732645;BA.debugLine="HandleScrollBar (FirstIndex)";
__ref._handlescrollbar /*String*/ (null,_firstindex);
RDebugUtils.currentLine=65732646;
 //BA.debugLineNum = 65732646;BA.debugLine="Return ListOfItemsThatShouldBeUpdated";
if (true) return __ref._listofitemsthatshouldbeupdated /*anywheresoftware.b4a.objects.collections.List*/ ;
RDebugUtils.currentLine=65732647;
 //BA.debugLineNum = 65732647;BA.debugLine="End Sub";
return null;
}
}