package com.as.viewpager;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class asviewpager 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, "com.as.viewpager.asviewpager");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", com.as.viewpager.asviewpager.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public String _meventname = "";
public Object _mcallback = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _mbase = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public b4a.example3.customlistview _xclv_main = null;
public int _current_index = 0;
public float _g_x = 0f;
public float _g_y = 0f;
public float _g_dv = 0f;
public float _g_ad = 0f;
public long _g_ms = 0L;
public boolean _isfirstmove = false;
public boolean _g_ignorepagechangedevent = false;
public String _g_orientation = "";
public boolean _g_carousel = false;
public boolean _ismoving = false;
public Object _tag = null;
public com.as.viewpager.main _main = null;
public com.as.viewpager.starter _starter = null;
public com.as.viewpager.b4xpages _b4xpages = null;
public com.as.viewpager.b4xcollections _b4xcollections = null;
public String  _addpage(anywheresoftware.b4a.objects.B4XViewWrapper _xpnl_layout,Object _value) throws Exception{
 //BA.debugLineNum = 201;BA.debugLine="Public Sub AddPage(xpnl_layout As B4XView,value As";
 //BA.debugLineNum = 202;BA.debugLine="xclv_main.Add(xpnl_layout,value)";
_xclv_main._add(_xpnl_layout,_value);
 //BA.debugLineNum = 203;BA.debugLine="End Sub";
return "";
}
public String  _addpageat(int _index,anywheresoftware.b4a.objects.B4XViewWrapper _xpnl_layout,Object _value) throws Exception{
 //BA.debugLineNum = 205;BA.debugLine="Public Sub AddPageAt(index As Int,xpnl_layout As B";
 //BA.debugLineNum = 207;BA.debugLine="If index <= current_index Then";
if (_index<=_current_index) { 
 //BA.debugLineNum = 208;BA.debugLine="current_index = current_index +1";
_current_index = (int) (_current_index+1);
 };
 //BA.debugLineNum = 217;BA.debugLine="xclv_main.ScrollToItem(current_index)";
_xclv_main._scrolltoitem(_current_index);
 //BA.debugLineNum = 220;BA.debugLine="xclv_main.InsertAt(index,xpnl_layout,value)";
_xclv_main._insertat(_index,_xpnl_layout,_value);
 //BA.debugLineNum = 222;BA.debugLine="End Sub";
return "";
}
public String  _base_resize(double _width,double _height) throws Exception{
boolean _change_widthorheight = false;
int _i = 0;
 //BA.debugLineNum = 167;BA.debugLine="Public Sub Base_Resize (Width As Double, Height As";
 //BA.debugLineNum = 169;BA.debugLine="Dim change_widthorheight As Boolean = False";
_change_widthorheight = __c.False;
 //BA.debugLineNum = 170;BA.debugLine="If  g_orientation = \"Horizontal\" And Width <> mBa";
if ((_g_orientation).equals("Horizontal") && _width!=_mbase.getWidth()) { 
 //BA.debugLineNum = 171;BA.debugLine="change_widthorheight = True";
_change_widthorheight = __c.True;
 }else if((_g_orientation).equals("Vertical") && _height!=_mbase.getHeight()) { 
 //BA.debugLineNum = 173;BA.debugLine="change_widthorheight = True";
_change_widthorheight = __c.True;
 };
 //BA.debugLineNum = 176;BA.debugLine="mBase.Width = Width";
_mbase.setWidth((int) (_width));
 //BA.debugLineNum = 177;BA.debugLine="mBase.Height = Height";
_mbase.setHeight((int) (_height));
 //BA.debugLineNum = 179;BA.debugLine="xclv_main.AsView.Height = Height";
_xclv_main._asview().setHeight((int) (_height));
 //BA.debugLineNum = 180;BA.debugLine="xclv_main.AsView.Width = Width";
_xclv_main._asview().setWidth((int) (_width));
 //BA.debugLineNum = 181;BA.debugLine="xclv_main.Base_Resize(Width,Height)";
_xclv_main._base_resize(_width,_height);
 //BA.debugLineNum = 183;BA.debugLine="If change_widthorheight = True Then";
if (_change_widthorheight==__c.True) { 
 //BA.debugLineNum = 184;BA.debugLine="For i = 0 To xclv_main.Size -1";
{
final int step13 = 1;
final int limit13 = (int) (_xclv_main._getsize()-1);
_i = (int) (0) ;
for (;_i <= limit13 ;_i = _i + step13 ) {
 //BA.debugLineNum = 185;BA.debugLine="If g_orientation = \"Horizontal\" Then";
if ((_g_orientation).equals("Horizontal")) { 
 //BA.debugLineNum = 186;BA.debugLine="xclv_main.ResizeItem(i,Width)";
_xclv_main._resizeitem(_i,(int) (_width));
 }else {
 //BA.debugLineNum = 188;BA.debugLine="xclv_main.ResizeItem(i,Height)";
_xclv_main._resizeitem(_i,(int) (_height));
 };
 }
};
 };
 //BA.debugLineNum = 193;BA.debugLine="If xclv_main.Size > 0 Then xclv_main.JumpToItem(c";
if (_xclv_main._getsize()>0) { 
_xclv_main._jumptoitem(_current_index);};
 //BA.debugLineNum = 195;BA.debugLine="End Sub";
return "";
}
public String  _checkcarousel() throws Exception{
 //BA.debugLineNum = 435;BA.debugLine="Private Sub CheckCarousel";
 //BA.debugLineNum = 436;BA.debugLine="If g_Carousel = True Then";
if (_g_carousel==__c.True) { 
 //BA.debugLineNum = 437;BA.debugLine="If current_index = xclv_main.Size -1 Then";
if (_current_index==_xclv_main._getsize()-1) { 
 //BA.debugLineNum = 438;BA.debugLine="setCurrentIndex2(0)";
_setcurrentindex2((int) (0));
 }else if(_current_index==0) { 
 //BA.debugLineNum = 440;BA.debugLine="setCurrentIndex2(xclv_main.Size -1)";
_setcurrentindex2((int) (_xclv_main._getsize()-1));
 };
 };
 //BA.debugLineNum = 443;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 66;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 67;BA.debugLine="Private mEventName As String 'ignore";
_meventname = "";
 //BA.debugLineNum = 68;BA.debugLine="Private mCallBack As Object 'ignore";
_mcallback = new Object();
 //BA.debugLineNum = 69;BA.debugLine="Private mBase As B4XView 'ignore";
_mbase = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 70;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 75;BA.debugLine="Private xclv_main As CustomListView";
_xclv_main = new b4a.example3.customlistview();
 //BA.debugLineNum = 78;BA.debugLine="Private current_index As Int = 0'ignore";
_current_index = (int) (0);
 //BA.debugLineNum = 80;BA.debugLine="Private g_x,g_y,g_dv,g_ad As Float";
_g_x = 0f;
_g_y = 0f;
_g_dv = 0f;
_g_ad = 0f;
 //BA.debugLineNum = 81;BA.debugLine="Private g_ms As Long";
_g_ms = 0L;
 //BA.debugLineNum = 82;BA.debugLine="Private  isfirstmove As Boolean = False";
_isfirstmove = __c.False;
 //BA.debugLineNum = 87;BA.debugLine="Private g_ignorepagechangedevent As Boolean = Fal";
_g_ignorepagechangedevent = __c.False;
 //BA.debugLineNum = 88;BA.debugLine="Private g_orientation As String";
_g_orientation = "";
 //BA.debugLineNum = 89;BA.debugLine="Private g_Carousel As Boolean";
_g_carousel = false;
 //BA.debugLineNum = 91;BA.debugLine="Private ismoving As Boolean = False";
_ismoving = __c.False;
 //BA.debugLineNum = 93;BA.debugLine="Public Tag As Object";
_tag = new Object();
 //BA.debugLineNum = 95;BA.debugLine="End Sub";
return "";
}
public String  _clear() throws Exception{
 //BA.debugLineNum = 313;BA.debugLine="Public Sub Clear";
 //BA.debugLineNum = 314;BA.debugLine="xclv_main.Clear";
_xclv_main._clear();
 //BA.debugLineNum = 315;BA.debugLine="current_index = 0";
_current_index = (int) (0);
 //BA.debugLineNum = 316;BA.debugLine="End Sub";
return "";
}
public String  _designercreateview(Object _base,anywheresoftware.b4a.objects.LabelWrapper _lbl,anywheresoftware.b4a.objects.collections.Map _props) throws Exception{
 //BA.debugLineNum = 103;BA.debugLine="Public Sub DesignerCreateView (Base As Object, Lbl";
 //BA.debugLineNum = 104;BA.debugLine="mBase = Base";
_mbase = (anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_base));
 //BA.debugLineNum = 105;BA.debugLine="Tag = mBase.Tag";
_tag = _mbase.getTag();
 //BA.debugLineNum = 106;BA.debugLine="mBase.Tag = Me";
_mbase.setTag(this);
 //BA.debugLineNum = 108;BA.debugLine="g_orientation = Props.Get(\"Orientation\")";
_g_orientation = BA.ObjectToString(_props.Get((Object)("Orientation")));
 //BA.debugLineNum = 109;BA.debugLine="g_Carousel = Props.Get(\"Carousel\")";
_g_carousel = BA.ObjectToBoolean(_props.Get((Object)("Carousel")));
 //BA.debugLineNum = 111;BA.debugLine="If xclv_main.IsInitialized = False Then";
if (_xclv_main.IsInitialized()==__c.False) { 
 //BA.debugLineNum = 112;BA.debugLine="ini_xclv";
_ini_xclv();
 };
 //BA.debugLineNum = 116;BA.debugLine="Base_Resize(mBase.Width,mBase.Height)";
_base_resize(_mbase.getWidth(),_mbase.getHeight());
 //BA.debugLineNum = 125;BA.debugLine="End Sub";
return "";
}
public String  _ff(float _x,float _y) throws Exception{
 //BA.debugLineNum = 324;BA.debugLine="Private Sub ff(x As Float,y As Float)";
 //BA.debugLineNum = 325;BA.debugLine="isfirstmove = True";
_isfirstmove = __c.True;
 //BA.debugLineNum = 326;BA.debugLine="g_ms=DateTime.Now";
_g_ms = __c.DateTime.getNow();
 //BA.debugLineNum = 327;BA.debugLine="g_x=X";
_g_x = _x;
 //BA.debugLineNum = 328;BA.debugLine="g_y=Y";
_g_y = _y;
 //BA.debugLineNum = 329;BA.debugLine="If g_orientation = \"Horizontal\" Then";
if ((_g_orientation).equals("Horizontal")) { 
 //BA.debugLineNum = 330;BA.debugLine="g_dv = (xclv_main.GetBase.Width)/2";
_g_dv = (float) ((_xclv_main._getbase().getWidth())/(double)2);
 }else {
 //BA.debugLineNum = 332;BA.debugLine="g_dv = (xclv_main.GetBase.Height)/2";
_g_dv = (float) ((_xclv_main._getbase().getHeight())/(double)2);
 };
 //BA.debugLineNum = 334;BA.debugLine="g_ad = 0";
_g_ad = (float) (0);
 //BA.debugLineNum = 335;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.B4XViewWrapper  _getbase() throws Exception{
 //BA.debugLineNum = 197;BA.debugLine="Public Sub getBase As B4XView";
 //BA.debugLineNum = 198;BA.debugLine="Return mBase";
if (true) return _mbase;
 //BA.debugLineNum = 199;BA.debugLine="End Sub";
return null;
}
public int  _getcurrentindex() throws Exception{
 //BA.debugLineNum = 291;BA.debugLine="Public Sub getCurrentIndex As Int";
 //BA.debugLineNum = 292;BA.debugLine="Return current_index'xclv_main.FirstVisibleIndex";
if (true) return _current_index;
 //BA.debugLineNum = 293;BA.debugLine="End Sub";
return 0;
}
public b4a.example3.customlistview  _getcustomlistview() throws Exception{
 //BA.debugLineNum = 309;BA.debugLine="Public Sub getCustomListView As CustomListView";
 //BA.debugLineNum = 310;BA.debugLine="Return xclv_main";
if (true) return _xclv_main;
 //BA.debugLineNum = 311;BA.debugLine="End Sub";
return null;
}
public int  _getsize() throws Exception{
 //BA.debugLineNum = 305;BA.debugLine="Public Sub getSize As Int";
 //BA.debugLineNum = 306;BA.debugLine="Return xclv_main.Size";
if (true) return _xclv_main._getsize();
 //BA.debugLineNum = 307;BA.debugLine="End Sub";
return 0;
}
public boolean  _handletouch(int _action,float _x,float _y) throws Exception{
int _i = 0;
 //BA.debugLineNum = 337;BA.debugLine="Private Sub HandleTouch(Action As Int,x As Float,y";
 //BA.debugLineNum = 342;BA.debugLine="Select Action";
switch (_action) {
case 2: {
 //BA.debugLineNum = 344;BA.debugLine="TouchBeginEvent";
_touchbeginevent();
 //BA.debugLineNum = 345;BA.debugLine="ismoving = True";
_ismoving = __c.True;
 //BA.debugLineNum = 346;BA.debugLine="If isfirstmove = False Then";
if (_isfirstmove==__c.False) { 
 //BA.debugLineNum = 348;BA.debugLine="ff(X,y)";
_ff(_x,_y);
 }else {
 };
 break; }
case 1: {
 //BA.debugLineNum = 374;BA.debugLine="TouchEndEvent";
_touchendevent();
 //BA.debugLineNum = 375;BA.debugLine="ismoving = False";
_ismoving = __c.False;
 //BA.debugLineNum = 376;BA.debugLine="isfirstmove = False";
_isfirstmove = __c.False;
 //BA.debugLineNum = 377;BA.debugLine="If g_orientation = \"Horizontal\" Then";
if ((_g_orientation).equals("Horizontal")) { 
 //BA.debugLineNum = 378;BA.debugLine="If ((DateTime.Now-g_ms)<300) And (Abs(X - g_x)";
if (((__c.DateTime.getNow()-_g_ms)<300) && (__c.Abs(_x-_g_x)>(__c.DipToCurrent((int) (1))))) { 
 //BA.debugLineNum = 380;BA.debugLine="g_dv =1dip";
_g_dv = (float) (__c.DipToCurrent((int) (1)));
 //BA.debugLineNum = 382;BA.debugLine="If X < g_x Then g_ad = 1";
if (_x<_g_x) { 
_g_ad = (float) (1);};
 };
 }else {
 //BA.debugLineNum = 388;BA.debugLine="If ((DateTime.Now-g_ms)<300)  And (Abs(y - g_y";
if (((__c.DateTime.getNow()-_g_ms)<300) && (__c.Abs(_y-_g_y)>(__c.DipToCurrent((int) (1))))) { 
 //BA.debugLineNum = 389;BA.debugLine="g_dv =1dip";
_g_dv = (float) (__c.DipToCurrent((int) (1)));
 //BA.debugLineNum = 392;BA.debugLine="If y < g_y Then g_ad = 1";
if (_y<_g_y) { 
_g_ad = (float) (1);};
 };
 };
 //BA.debugLineNum = 399;BA.debugLine="For i = 0 To xclv_main.Size -1";
{
final int step24 = 1;
final int limit24 = (int) (_xclv_main._getsize()-1);
_i = (int) (0) ;
for (;_i <= limit24 ;_i = _i + step24 ) {
 //BA.debugLineNum = 400;BA.debugLine="If g_orientation = \"Horizontal\" Then";
if ((_g_orientation).equals("Horizontal")) { 
 //BA.debugLineNum = 401;BA.debugLine="If (((i+1)*xclv_main.GetBase.Width) - xclv_ma";
if ((((_i+1)*_xclv_main._getbase().getWidth())-_xclv_main._sv.getScrollViewOffsetX())>(_g_dv)) { 
 //BA.debugLineNum = 407;BA.debugLine="If (i+g_ad) > (xclv_main.Size -1) Or xclv_ma";
if ((_i+_g_ad)>(_xclv_main._getsize()-1) || _xclv_main._sv.getScrollViewOffsetX()<=0) { 
 //BA.debugLineNum = 408;BA.debugLine="CheckCarousel";
_checkcarousel();
 //BA.debugLineNum = 409;BA.debugLine="Return False";
if (true) return __c.False;
 };
 //BA.debugLineNum = 412;BA.debugLine="xclv_main.ScrollToItem(i+g_ad)";
_xclv_main._scrolltoitem((int) (_i+_g_ad));
 //BA.debugLineNum = 413;BA.debugLine="If current_index <> (i+g_ad) Then PageChange";
if (_current_index!=(_i+_g_ad)) { 
_pagechangeevent((int) (_i+_g_ad));};
 //BA.debugLineNum = 414;BA.debugLine="Return True";
if (true) return __c.True;
 };
 }else {
 //BA.debugLineNum = 417;BA.debugLine="If (((i+1)*xclv_main.GetBase.Height) - xclv_m";
if ((((_i+1)*_xclv_main._getbase().getHeight())-_xclv_main._sv.getScrollViewOffsetY())>(_g_dv)) { 
 //BA.debugLineNum = 422;BA.debugLine="If (i+g_ad) > xclv_main.Size-1 Or  xclv_main";
if ((_i+_g_ad)>_xclv_main._getsize()-1 || _xclv_main._sv.getScrollViewOffsetY()<=0) { 
if (true) return __c.False;};
 //BA.debugLineNum = 424;BA.debugLine="xclv_main.ScrollToItem(i+g_ad)";
_xclv_main._scrolltoitem((int) (_i+_g_ad));
 //BA.debugLineNum = 425;BA.debugLine="If current_index <> (i+g_ad) Then PageChange";
if (_current_index!=(_i+_g_ad)) { 
_pagechangeevent((int) (_i+_g_ad));};
 //BA.debugLineNum = 426;BA.debugLine="Return True";
if (true) return __c.True;
 };
 };
 }
};
 break; }
}
;
 //BA.debugLineNum = 431;BA.debugLine="Return False";
if (true) return __c.False;
 //BA.debugLineNum = 432;BA.debugLine="End Sub";
return false;
}
public Object  _iif(boolean _c,Object _trueres,Object _falseres) throws Exception{
 //BA.debugLineNum = 495;BA.debugLine="Private Sub IIF(c As Boolean, TrueRes As Object, F";
 //BA.debugLineNum = 496;BA.debugLine="If c Then Return TrueRes Else Return FalseRes";
if (_c) { 
if (true) return _trueres;}
else {
if (true) return _falseres;};
 //BA.debugLineNum = 497;BA.debugLine="End Sub";
return null;
}
public String  _ini_xclv() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _tmplbl = null;
anywheresoftware.b4a.objects.collections.Map _tmpmap = null;
anywheresoftware.b4a.agraham.reflection.Reflection _objpages = null;
 //BA.debugLineNum = 127;BA.debugLine="Private Sub ini_xclv";
 //BA.debugLineNum = 128;BA.debugLine="Dim tmplbl As Label";
_tmplbl = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 129;BA.debugLine="tmplbl.Initialize(\"\")";
_tmplbl.Initialize(ba,"");
 //BA.debugLineNum = 131;BA.debugLine="Dim tmpmap As Map";
_tmpmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 132;BA.debugLine="tmpmap.Initialize";
_tmpmap.Initialize();
 //BA.debugLineNum = 133;BA.debugLine="tmpmap.Put(\"DividerColor\",0x00FFFFFF)";
_tmpmap.Put((Object)("DividerColor"),(Object)(0x00ffffff));
 //BA.debugLineNum = 134;BA.debugLine="tmpmap.Put(\"DividerHeight\",0)";
_tmpmap.Put((Object)("DividerHeight"),(Object)(0));
 //BA.debugLineNum = 135;BA.debugLine="tmpmap.Put(\"PressedColor\",0x00FFFFFF)";
_tmpmap.Put((Object)("PressedColor"),(Object)(0x00ffffff));
 //BA.debugLineNum = 136;BA.debugLine="tmpmap.Put(\"InsertAnimationDuration\",0)";
_tmpmap.Put((Object)("InsertAnimationDuration"),(Object)(0));
 //BA.debugLineNum = 137;BA.debugLine="tmpmap.Put(\"ListOrientation\",g_orientation)";
_tmpmap.Put((Object)("ListOrientation"),(Object)(_g_orientation));
 //BA.debugLineNum = 138;BA.debugLine="tmpmap.Put(\"ShowScrollBar\",False)";
_tmpmap.Put((Object)("ShowScrollBar"),(Object)(__c.False));
 //BA.debugLineNum = 139;BA.debugLine="xclv_main.Initialize(Me,\"xclv_main\")";
_xclv_main._initialize(ba,this,"xclv_main");
 //BA.debugLineNum = 140;BA.debugLine="xclv_main.DesignerCreateView(mBase,tmplbl,tmpmap)";
_xclv_main._designercreateview((Object)(_mbase.getObject()),_tmplbl,_tmpmap);
 //BA.debugLineNum = 142;BA.debugLine="Private objPages As Reflector";
_objpages = new anywheresoftware.b4a.agraham.reflection.Reflection();
 //BA.debugLineNum = 143;BA.debugLine="objPages.Target = xclv_main.sv";
_objpages.Target = (Object)(_xclv_main._sv.getObject());
 //BA.debugLineNum = 144;BA.debugLine="objPages.SetOnTouchListener(\"xpnl_PageArea2_Touch";
_objpages.SetOnTouchListener(ba,"xpnl_PageArea2_Touch");
 //BA.debugLineNum = 165;BA.debugLine="End Sub";
return "";
}
public String  _initialize(anywheresoftware.b4a.BA _ba,Object _callback,String _eventname) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 97;BA.debugLine="Public Sub Initialize (Callback As Object, EventNa";
 //BA.debugLineNum = 98;BA.debugLine="mEventName = EventName";
_meventname = _eventname;
 //BA.debugLineNum = 99;BA.debugLine="mCallBack = Callback";
_mcallback = _callback;
 //BA.debugLineNum = 100;BA.debugLine="End Sub";
return "";
}
public String  _nextpage() throws Exception{
 //BA.debugLineNum = 251;BA.debugLine="Public Sub NextPage";
 //BA.debugLineNum = 252;BA.debugLine="If (current_index +1) < xclv_main.Size Then";
if ((_current_index+1)<_xclv_main._getsize()) { 
 //BA.debugLineNum = 253;BA.debugLine="PageChangeEvent(current_index +1)";
_pagechangeevent((int) (_current_index+1));
 //BA.debugLineNum = 254;BA.debugLine="xclv_main.ScrollToItem(current_index)";
_xclv_main._scrolltoitem(_current_index);
 }else if(_g_carousel==__c.True) { 
 //BA.debugLineNum = 256;BA.debugLine="CheckCarousel";
_checkcarousel();
 };
 //BA.debugLineNum = 258;BA.debugLine="End Sub";
return "";
}
public String  _nextpage2() throws Exception{
 //BA.debugLineNum = 260;BA.debugLine="Public Sub NextPage2";
 //BA.debugLineNum = 261;BA.debugLine="If (current_index +1) < xclv_main.Size Then";
if ((_current_index+1)<_xclv_main._getsize()) { 
 //BA.debugLineNum = 262;BA.debugLine="PageChangeEvent(current_index +1)";
_pagechangeevent((int) (_current_index+1));
 //BA.debugLineNum = 263;BA.debugLine="xclv_main.JumpToItem(current_index)";
_xclv_main._jumptoitem(_current_index);
 }else if(_g_carousel==__c.True) { 
 //BA.debugLineNum = 265;BA.debugLine="CheckCarousel";
_checkcarousel();
 };
 //BA.debugLineNum = 267;BA.debugLine="End Sub";
return "";
}
public String  _pagechangeevent(int _index) throws Exception{
 //BA.debugLineNum = 514;BA.debugLine="Private Sub PageChangeEvent(index As Int)";
 //BA.debugLineNum = 515;BA.debugLine="current_index = index";
_current_index = _index;
 //BA.debugLineNum = 516;BA.debugLine="If g_ignorepagechangedevent = False Then";
if (_g_ignorepagechangedevent==__c.False) { 
 //BA.debugLineNum = 517;BA.debugLine="If xui.SubExists(mCallBack, mEventName & \"_PageCh";
if (_xui.SubExists(ba,_mcallback,_meventname+"_PageChanged",(int) (1))) { 
 //BA.debugLineNum = 518;BA.debugLine="CallSub2(mCallBack, mEventName & \"_PageChanged\",";
__c.CallSubNew2(ba,_mcallback,_meventname+"_PageChanged",(Object)(_index));
 };
 };
 //BA.debugLineNum = 521;BA.debugLine="End Sub";
return "";
}
public String  _previouspage() throws Exception{
 //BA.debugLineNum = 233;BA.debugLine="Public Sub PreviousPage";
 //BA.debugLineNum = 234;BA.debugLine="If (current_index -1) > -1 Then";
if ((_current_index-1)>-1) { 
 //BA.debugLineNum = 235;BA.debugLine="PageChangeEvent(current_index -1)";
_pagechangeevent((int) (_current_index-1));
 //BA.debugLineNum = 236;BA.debugLine="xclv_main.ScrollToItem(current_index)";
_xclv_main._scrolltoitem(_current_index);
 }else if(_g_carousel==__c.True) { 
 //BA.debugLineNum = 238;BA.debugLine="CheckCarousel";
_checkcarousel();
 };
 //BA.debugLineNum = 240;BA.debugLine="End Sub";
return "";
}
public String  _previouspage2() throws Exception{
 //BA.debugLineNum = 242;BA.debugLine="Public Sub PreviousPage2";
 //BA.debugLineNum = 243;BA.debugLine="If (current_index -1) > -1 Then";
if ((_current_index-1)>-1) { 
 //BA.debugLineNum = 244;BA.debugLine="PageChangeEvent(current_index -1)";
_pagechangeevent((int) (_current_index-1));
 //BA.debugLineNum = 245;BA.debugLine="xclv_main.JumpToItem(current_index)";
_xclv_main._jumptoitem(_current_index);
 }else if(_g_carousel==__c.True) { 
 //BA.debugLineNum = 247;BA.debugLine="CheckCarousel";
_checkcarousel();
 };
 //BA.debugLineNum = 249;BA.debugLine="End Sub";
return "";
}
public String  _removepage(int _index) throws Exception{
 //BA.debugLineNum = 224;BA.debugLine="Public Sub RemovePage(index As Int)";
 //BA.debugLineNum = 225;BA.debugLine="xclv_main.RemoveAt(index)";
_xclv_main._removeat(_index);
 //BA.debugLineNum = 226;BA.debugLine="If g_orientation = \"Horizontal\" Then";
if ((_g_orientation).equals("Horizontal")) { 
 //BA.debugLineNum = 227;BA.debugLine="current_index = xclv_main.FindIndexFromOffset(xc";
_current_index = _xclv_main._findindexfromoffset(_xclv_main._sv.getScrollViewOffsetX());
 }else {
 //BA.debugLineNum = 229;BA.debugLine="current_index = xclv_main.FindIndexFromOffset(xc";
_current_index = _xclv_main._findindexfromoffset(_xclv_main._sv.getScrollViewOffsetY());
 };
 //BA.debugLineNum = 231;BA.debugLine="End Sub";
return "";
}
public String  _setcurrentindex(int _index) throws Exception{
 //BA.debugLineNum = 295;BA.debugLine="Public Sub setCurrentIndex(index As Int)";
 //BA.debugLineNum = 296;BA.debugLine="PageChangeEvent(index)";
_pagechangeevent(_index);
 //BA.debugLineNum = 297;BA.debugLine="xclv_main.ScrollToItem(index)";
_xclv_main._scrolltoitem(_index);
 //BA.debugLineNum = 298;BA.debugLine="End Sub";
return "";
}
public String  _setcurrentindex2(int _index) throws Exception{
 //BA.debugLineNum = 300;BA.debugLine="Public Sub setCurrentIndex2(index As Int)";
 //BA.debugLineNum = 301;BA.debugLine="PageChangeEvent(index)";
_pagechangeevent(_index);
 //BA.debugLineNum = 302;BA.debugLine="xclv_main.JumpToItem(index)";
_xclv_main._jumptoitem(_index);
 //BA.debugLineNum = 303;BA.debugLine="End Sub";
return "";
}
public String  _setignorepagechangedevent(boolean _ignore) throws Exception{
 //BA.debugLineNum = 287;BA.debugLine="Public Sub setIgnorePageChangedEvent(ignore As Boo";
 //BA.debugLineNum = 288;BA.debugLine="g_ignorepagechangedevent = ignore";
_g_ignorepagechangedevent = _ignore;
 //BA.debugLineNum = 289;BA.debugLine="End Sub";
return "";
}
public String  _touchbeginevent() throws Exception{
 //BA.debugLineNum = 523;BA.debugLine="Private Sub TouchBeginEvent";
 //BA.debugLineNum = 524;BA.debugLine="If ismoving = False Then";
if (_ismoving==__c.False) { 
 //BA.debugLineNum = 525;BA.debugLine="If xui.SubExists(mCallBack, mEventName & \"_TouchB";
if (_xui.SubExists(ba,_mcallback,_meventname+"_TouchBegin",(int) (0))) { 
 //BA.debugLineNum = 526;BA.debugLine="CallSub(mCallBack, mEventName & \"_TouchBegin\")";
__c.CallSubNew(ba,_mcallback,_meventname+"_TouchBegin");
 };
 };
 //BA.debugLineNum = 529;BA.debugLine="End Sub";
return "";
}
public String  _touchendevent() throws Exception{
 //BA.debugLineNum = 531;BA.debugLine="Private Sub TouchEndEvent";
 //BA.debugLineNum = 532;BA.debugLine="If xui.SubExists(mCallBack, mEventName & \"_TouchE";
if (_xui.SubExists(ba,_mcallback,_meventname+"_TouchEnd",(int) (0))) { 
 //BA.debugLineNum = 533;BA.debugLine="CallSub(mCallBack, mEventName & \"_TouchEnd\")";
__c.CallSubNew(ba,_mcallback,_meventname+"_TouchEnd");
 };
 //BA.debugLineNum = 535;BA.debugLine="End Sub";
return "";
}
public String  _xclv_main_reachend() throws Exception{
 //BA.debugLineNum = 508;BA.debugLine="Private Sub xclv_main_ReachEnd";
 //BA.debugLineNum = 509;BA.debugLine="If xui.SubExists(mCallBack, mEventName & \"_ReachE";
if (_xui.SubExists(ba,_mcallback,_meventname+"_ReachEnd",(int) (0))) { 
 //BA.debugLineNum = 510;BA.debugLine="CallSub(mCallBack, mEventName & \"_ReachEnd\")";
__c.CallSubNew(ba,_mcallback,_meventname+"_ReachEnd");
 };
 //BA.debugLineNum = 512;BA.debugLine="End Sub";
return "";
}
public String  _xclv_main_scrollchanged(int _offset) throws Exception{
 //BA.debugLineNum = 499;BA.debugLine="Private Sub xclv_main_ScrollChanged (Offset As Int";
 //BA.debugLineNum = 500;BA.debugLine="If xclv_main.FindIndexFromOffset(Offset) <> curre";
if (_xclv_main._findindexfromoffset(_offset)!=_current_index && _offset==(double)(BA.ObjectToNumber(_iif((_g_orientation).equals("Vertical"),(Object)(_mbase.getHeight()),(Object)(_mbase.getWidth()))))*_xclv_main._findindexfromoffset(_offset)) { 
 //BA.debugLineNum = 501;BA.debugLine="PageChangeEvent(xclv_main.FindIndexFromOffset(Of";
_pagechangeevent(_xclv_main._findindexfromoffset(_offset));
 };
 //BA.debugLineNum = 503;BA.debugLine="If xui.SubExists(mCallBack, mEventName & \"_Scroll";
if (_xui.SubExists(ba,_mcallback,_meventname+"_ScrollChanged",(int) (1))) { 
 //BA.debugLineNum = 504;BA.debugLine="CallSub2(mCallBack, mEventName & \"_ScrollChanged";
__c.CallSubNew2(ba,_mcallback,_meventname+"_ScrollChanged",(Object)(_offset));
 };
 //BA.debugLineNum = 506;BA.debugLine="End Sub";
return "";
}
public boolean  _xpnl_pagearea2_touch(Object _viewtag,int _action,float _x,float _y,Object _motionevent) throws Exception{
 //BA.debugLineNum = 446;BA.debugLine="Private Sub xpnl_PageArea2_Touch(ViewTag As Object";
 //BA.debugLineNum = 447;BA.debugLine="Return HandleTouch(Action,x,y)";
if (true) return _handletouch(_action,_x,_y);
 //BA.debugLineNum = 448;BA.debugLine="End Sub";
return false;
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
return BA.SubDelegator.SubNotFound;
}
}
