package student.tutorial;


import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class frmgame2 extends Activity implements B4AActivity{
	public static frmgame2 mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	public static final boolean fullScreen = true;
	public static final boolean includeTitle = false;
    public static WeakReference<Activity> previousOne;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		if (isFirst) {
			processBA = new BA(this.getApplicationContext(), null, null, "student.tutorial", "student.tutorial.frmgame2");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
            
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                BA.LogInfo("Killing previous instance (frmgame2).");
				p.finish();
			}
		}
        processBA.runHook("oncreate", this, null);
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		mostCurrent = this;
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
		BA.handler.postDelayed(new WaitForLayout(), 5);

	}
	private static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent == null)
				return;
            
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
        if (this != mostCurrent)
			return;
		activityBA = new BA(this, layout, processBA, "student.tutorial", "student.tutorial.frmgame2");
        
        processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (BA.isShellModeRuntimeCheck(processBA)) {
			if (isFirst)
				processBA.raiseEvent2(null, true, "SHELL", false);
			processBA.raiseEvent2(null, true, "CREATE", true, "student.tutorial.frmgame2", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (frmgame2) Create, isFirst = " + isFirst + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (frmgame2) Resume **");
        processBA.raiseEvent(null, "activity_resume");
        if (android.os.Build.VERSION.SDK_INT >= 11) {
			try {
				android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
        try {
            if (processBA.subExists("activity_actionbarhomeclick")) {
                Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
                    getClass().getMethod("getActionBar").invoke(this), true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
            return true;
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
            if (android.os.Build.VERSION.SDK_INT >= 11) {
				try {
                    if (bmi.addToBar) {
				        android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
                    }
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
        
		return true;
	}   
 @Override
 public boolean onOptionsItemSelected(android.view.MenuItem item) {
    if (item.getItemId() == 16908332) {
        processBA.raiseEvent(null, "activity_actionbarhomeclick");
        return true;
    }
    else
        return super.onOptionsItemSelected(item); 
}
@Override
 public boolean onPrepareOptionsMenu(android.view.Menu menu) {
    super.onPrepareOptionsMenu(menu);
    processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
    return true;
    
 }
 protected void onStart() {
    super.onStart();
    processBA.runHook("onstart", this, null);
}
 protected void onStop() {
    super.onStop();
    processBA.runHook("onstop", this, null);
}
    public void onWindowFocusChanged(boolean hasFocus) {
       super.onWindowFocusChanged(hasFocus);
       if (processBA.subExists("activity_windowfocuschanged"))
           processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
    }
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEvent(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return frmgame2.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
					android.os.Build.VERSION.SDK_INT >= 18) {
				HandleKeyDelayed hk = new HandleKeyDelayed();
				hk.kc = keyCode;
				BA.handler.post(hk);
				return true;
			}
			else {
				boolean res = new HandleKeyDelayed().runDirectly(keyCode);
				if (res)
					return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
	private class HandleKeyDelayed implements Runnable {
		int kc;
		public void run() {
			runDirectly(kc);
		}
		public boolean runDirectly(int keyCode) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true) {
                return true;
            }
            else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
				finish();
				return true;
			}
            return false;
		}
		
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
        super.onNewIntent(intent);
		this.setIntent(intent);
        processBA.runHook("onnewintent", this, new Object[] {intent});
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null) //workaround for emulator bug (Issue 2423)
            return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        BA.LogInfo("** Activity (frmgame2) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        processBA.setActivityPaused(true);
        mostCurrent = null;
        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        processBA.runHook("onpause", this, null);
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
        processBA.runHook("ondestroy", this, null);
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
        processBA.runHook("onresume", this, null);
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
			if (mostCurrent == null || mostCurrent != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (frmgame2) Resume **");
		    processBA.raiseEvent(mostCurrent._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
        processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}

public anywheresoftware.b4a.keywords.Common __c = null;
public static String _defaultlang = "";
public anywheresoftware.b4a.objects.ImageViewWrapper _imgbg = null;
public anywheresoftware.b4a.objects.ButtonWrapper[] _btnnumber = null;
public anywheresoftware.b4a.objects.drawable.ColorDrawable[] _mycolor = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbltitle = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblresult = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblmenu = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblabout = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblsetting = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblsound = null;
public static int _num1 = 0;
public static boolean _blnnumber1 = false;
public anywheresoftware.b4a.objects.Timer _tmr = null;
public static int _res = 0;
public static int _num2 = 0;
public anywheresoftware.b4a.objects.MediaPlayerWrapper _media = null;
public static String[] _arrint = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblexpersion = null;
public anywheresoftware.b4a.objects.MediaPlayerWrapper _bgmedia = null;
public anywheresoftware.b4a.objects.SpinnerWrapper _spinner1 = null;
public static int _x1 = 0;
public static int _y1 = 0;
public anywheresoftware.b4a.keywords.LayoutValues _lv = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _ck2 = null;
public static String _sresults = "";
public student.tutorial.main _main = null;
public student.tutorial.frmgame1 _frmgame1 = null;
public student.tutorial.common _common = null;
public student.tutorial.settings _settings = null;
public student.tutorial.frmgame1_result _frmgame1_result = null;
public student.tutorial.frmgame1_final _frmgame1_final = null;
public student.tutorial.frmgame3 _frmgame3 = null;
public student.tutorial.frmgame4 _frmgame4 = null;
public student.tutorial.frmgame5 _frmgame5 = null;
public student.tutorial.frmgame6 _frmgame6 = null;
public student.tutorial.frmgame7 _frmgame7 = null;
public student.tutorial.frmcontact _frmcontact = null;
public student.tutorial.frmgame8 _frmgame8 = null;
public student.tutorial.frmabout _frmabout = null;
public student.tutorial.frmgame9 _frmgame9 = null;
public student.tutorial.setting _setting = null;
public student.tutorial.frmstatistic _frmstatistic = null;

public static void initializeProcessGlobals() {
             try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
}
public static String  _activity_create(boolean _firsttime) throws Exception{
int _i = 0;
 //BA.debugLineNum = 31;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
 //BA.debugLineNum = 32;BA.debugLine="lv = GetDeviceLayoutValues";
mostCurrent._lv = anywheresoftware.b4a.keywords.Common.GetDeviceLayoutValues(mostCurrent.activityBA);
 //BA.debugLineNum = 33;BA.debugLine="loadColor";
_loadcolor();
 //BA.debugLineNum = 34;BA.debugLine="Activity.RemoveAllViews";
mostCurrent._activity.RemoveAllViews();
 //BA.debugLineNum = 35;BA.debugLine="blnNumber1 = False";
_blnnumber1 = anywheresoftware.b4a.keywords.Common.False;
 //BA.debugLineNum = 36;BA.debugLine="For i=0 To 10";
{
final int step27 = 1;
final int limit27 = (int) (10);
for (_i = (int) (0); (step27 > 0 && _i <= limit27) || (step27 < 0 && _i >= limit27); _i = ((int)(0 + _i + step27))) {
 //BA.debugLineNum = 37;BA.debugLine="arrInt(i) = i";
mostCurrent._arrint[_i] = BA.NumberToString(_i);
 }
};
 //BA.debugLineNum = 40;BA.debugLine="ShuffleArray(arrInt)";
_shufflearray(mostCurrent._arrint);
 //BA.debugLineNum = 42;BA.debugLine="defaultLang = \"fa\"";
_defaultlang = "fa";
 //BA.debugLineNum = 43;BA.debugLine="initializeComponent";
_initializecomponent();
 //BA.debugLineNum = 44;BA.debugLine="LoadButton";
_loadbutton();
 //BA.debugLineNum = 45;BA.debugLine="media.Initialize2(\"mp2\")";
mostCurrent._media.Initialize2(processBA,"mp2");
 //BA.debugLineNum = 46;BA.debugLine="loadMenu";
_loadmenu();
 //BA.debugLineNum = 47;BA.debugLine="End Sub";
return "";
}
public static boolean  _activity_keypress(int _keycode) throws Exception{
 //BA.debugLineNum = 351;BA.debugLine="Sub Activity_KeyPress (KeyCode As Int) As Boolean";
 //BA.debugLineNum = 352;BA.debugLine="If KeyCode = KeyCodes.KEYCODE_BACK Then";
if (_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_BACK) { 
 //BA.debugLineNum = 353;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 354;BA.debugLine="StartActivity(Main)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._main.getObject()));
 };
 //BA.debugLineNum = 356;BA.debugLine="If KeyCode = KeyCodes.KEYCODE_MENU Then";
if (_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_MENU) { 
 //BA.debugLineNum = 357;BA.debugLine="Activity.OpenMenu";
mostCurrent._activity.OpenMenu();
 };
 //BA.debugLineNum = 359;BA.debugLine="End Sub";
return false;
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 348;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 349;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
 //BA.debugLineNum = 344;BA.debugLine="Sub Activity_Resume";
 //BA.debugLineNum = 345;BA.debugLine="Activity_Create(False)";
_activity_create(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 346;BA.debugLine="End Sub";
return "";
}
public static String  _btnabout_click() throws Exception{
 //BA.debugLineNum = 57;BA.debugLine="Sub btnabout_Click";
 //BA.debugLineNum = 58;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 59;BA.debugLine="StartActivity(frmabout)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._frmabout.getObject()));
 //BA.debugLineNum = 60;BA.debugLine="End Sub";
return "";
}
public static String  _btnlanguage_click() throws Exception{
 //BA.debugLineNum = 296;BA.debugLine="Sub btnLanguage_Click";
 //BA.debugLineNum = 297;BA.debugLine="defaultLang = \"en\"";
_defaultlang = "en";
 //BA.debugLineNum = 298;BA.debugLine="RemoveButton";
_removebutton();
 //BA.debugLineNum = 299;BA.debugLine="initializeComponent";
_initializecomponent();
 //BA.debugLineNum = 300;BA.debugLine="LoadButton";
_loadbutton();
 //BA.debugLineNum = 301;BA.debugLine="End Sub";
return "";
}
public static String  _btnnumber_click() throws Exception{
anywheresoftware.b4a.objects.ButtonWrapper _button1 = null;
anywheresoftware.b4a.agraham.threading.Threading _thr = null;
 //BA.debugLineNum = 217;BA.debugLine="Sub btnNumber_Click";
 //BA.debugLineNum = 218;BA.debugLine="Dim button1 As Button";
_button1 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 219;BA.debugLine="Dim thr As Thread";
_thr = new anywheresoftware.b4a.agraham.threading.Threading();
 //BA.debugLineNum = 220;BA.debugLine="button1 = Sender";
_button1.setObject((android.widget.Button)(anywheresoftware.b4a.keywords.Common.Sender(mostCurrent.activityBA)));
 //BA.debugLineNum = 221;BA.debugLine="button1.Color = Colors.Blue";
_button1.setColor(anywheresoftware.b4a.keywords.Common.Colors.Blue);
 //BA.debugLineNum = 222;BA.debugLine="playAudio(button1.Tag)";
_playaudio(BA.ObjectToString(_button1.getTag()));
 //BA.debugLineNum = 223;BA.debugLine="If blnNumber1 = False Then";
if (_blnnumber1==anywheresoftware.b4a.keywords.Common.False) { 
 //BA.debugLineNum = 224;BA.debugLine="lblExpersion.Text = \"\"";
mostCurrent._lblexpersion.setText((Object)(""));
 //BA.debugLineNum = 225;BA.debugLine="lblExpersion.TextColor = Colors.Black";
mostCurrent._lblexpersion.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 226;BA.debugLine="If defaultLang = \"fa\" Then";
if ((_defaultlang).equals("fa")) { 
 //BA.debugLineNum = 227;BA.debugLine="lblExpersion.Text = \" nkMo† \" & button1.Text";
mostCurrent._lblexpersion.setText((Object)(" nkMo† "+_button1.getText()));
 }else {
 //BA.debugLineNum = 229;BA.debugLine="lblExpersion.Text = button1.Text & \" Plus \"";
mostCurrent._lblexpersion.setText((Object)(_button1.getText()+" Plus "));
 };
 //BA.debugLineNum = 231;BA.debugLine="num1 = button1.Text";
_num1 = (int)(Double.parseDouble(_button1.getText()));
 //BA.debugLineNum = 232;BA.debugLine="blnNumber1 = True";
_blnnumber1 = anywheresoftware.b4a.keywords.Common.True;
 }else {
 //BA.debugLineNum = 234;BA.debugLine="If defaultLang = \"fa\" Then";
if ((_defaultlang).equals("fa")) { 
 //BA.debugLineNum = 235;BA.debugLine="lblExpersion.Text =  \" j¼zÃ¶ \" & button1.Tag &";
mostCurrent._lblexpersion.setText((Object)(" j¼zÃ¶ "+BA.ObjectToString(_button1.getTag())+mostCurrent._lblexpersion.getText()));
 }else {
 //BA.debugLineNum = 237;BA.debugLine="lblExpersion.Text =  lblExpersion.Text  & butto";
mostCurrent._lblexpersion.setText((Object)(mostCurrent._lblexpersion.getText()+BA.ObjectToString(_button1.getTag())+" Is "));
 };
 //BA.debugLineNum = 239;BA.debugLine="tmr.Initialize(\"tmr\",800)";
mostCurrent._tmr.Initialize(processBA,"tmr",(long) (800));
 //BA.debugLineNum = 240;BA.debugLine="num2 = button1.Tag";
_num2 = (int)(BA.ObjectToNumber(_button1.getTag()));
 //BA.debugLineNum = 241;BA.debugLine="res = num1 * button1.Tag";
_res = (int) (_num1*(double)(BA.ObjectToNumber(_button1.getTag())));
 //BA.debugLineNum = 242;BA.debugLine="tmr.Enabled = True";
mostCurrent._tmr.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 243;BA.debugLine="blnNumber1 = False";
_blnnumber1 = anywheresoftware.b4a.keywords.Common.False;
 };
 //BA.debugLineNum = 245;BA.debugLine="End Sub";
return "";
}
public static String  _btnsetting_click() throws Exception{
 //BA.debugLineNum = 53;BA.debugLine="Sub btnsetting_Click";
 //BA.debugLineNum = 54;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 55;BA.debugLine="StartActivity(setting)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._setting.getObject()));
 //BA.debugLineNum = 56;BA.debugLine="End Sub";
return "";
}
public static String  _ck2_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 124;BA.debugLine="Sub ck2_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 125;BA.debugLine="If Checked = True Then";
if (_checked==anywheresoftware.b4a.keywords.Common.True) { 
 };
 //BA.debugLineNum = 128;BA.debugLine="End Sub";
return "";
}
public static String  _exit1_click() throws Exception{
int _i = 0;
 //BA.debugLineNum = 61;BA.debugLine="Sub exit1_Click";
 //BA.debugLineNum = 62;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 63;BA.debugLine="i = Msgbox2(\"آیا مایل به خروج هستید؟\",\"خروج\",\"آری\"";
_i = anywheresoftware.b4a.keywords.Common.Msgbox2("آیا مایل به خروج هستید؟","خروج","آری","خیر","",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null),mostCurrent.activityBA);
 //BA.debugLineNum = 64;BA.debugLine="If i = DialogResponse.POSITIVE Then";
if (_i==anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE) { 
 //BA.debugLineNum = 65;BA.debugLine="ExitApplication";
anywheresoftware.b4a.keywords.Common.ExitApplication();
 };
 //BA.debugLineNum = 67;BA.debugLine="End Sub";
return "";
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 11;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 12;BA.debugLine="Dim imgBG As ImageView";
mostCurrent._imgbg = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Dim btnNumber(11) As  Button";
mostCurrent._btnnumber = new anywheresoftware.b4a.objects.ButtonWrapper[(int) (11)];
{
int d0 = mostCurrent._btnnumber.length;
for (int i0 = 0;i0 < d0;i0++) {
mostCurrent._btnnumber[i0] = new anywheresoftware.b4a.objects.ButtonWrapper();
}
}
;
 //BA.debugLineNum = 14;BA.debugLine="Dim myColor(11) As ColorDrawable";
mostCurrent._mycolor = new anywheresoftware.b4a.objects.drawable.ColorDrawable[(int) (11)];
{
int d0 = mostCurrent._mycolor.length;
for (int i0 = 0;i0 < d0;i0++) {
mostCurrent._mycolor[i0] = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
}
}
;
 //BA.debugLineNum = 15;BA.debugLine="Dim lblTitle,lblResult,lblMenu,lblAbout,lblSetting";
mostCurrent._lbltitle = new anywheresoftware.b4a.objects.LabelWrapper();
mostCurrent._lblresult = new anywheresoftware.b4a.objects.LabelWrapper();
mostCurrent._lblmenu = new anywheresoftware.b4a.objects.LabelWrapper();
mostCurrent._lblabout = new anywheresoftware.b4a.objects.LabelWrapper();
mostCurrent._lblsetting = new anywheresoftware.b4a.objects.LabelWrapper();
mostCurrent._lblsound = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim num1 As Int";
_num1 = 0;
 //BA.debugLineNum = 17;BA.debugLine="Dim blnNumber1 As Boolean";
_blnnumber1 = false;
 //BA.debugLineNum = 18;BA.debugLine="Dim tmr As Timer";
mostCurrent._tmr = new anywheresoftware.b4a.objects.Timer();
 //BA.debugLineNum = 19;BA.debugLine="Dim res,num1,num2 As Int";
_res = 0;
_num1 = 0;
_num2 = 0;
 //BA.debugLineNum = 20;BA.debugLine="Dim media As MediaPlayer";
mostCurrent._media = new anywheresoftware.b4a.objects.MediaPlayerWrapper();
 //BA.debugLineNum = 21;BA.debugLine="Dim arrInt(11) As String";
mostCurrent._arrint = new String[(int) (11)];
java.util.Arrays.fill(mostCurrent._arrint,"");
 //BA.debugLineNum = 22;BA.debugLine="Dim lblExpersion As Label";
mostCurrent._lblexpersion = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Dim bgMedia As MediaPlayer";
mostCurrent._bgmedia = new anywheresoftware.b4a.objects.MediaPlayerWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Dim spinner1 As Spinner";
mostCurrent._spinner1 = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Dim x1,y1 As Int";
_x1 = 0;
_y1 = 0;
 //BA.debugLineNum = 26;BA.debugLine="Dim lv As LayoutValues";
mostCurrent._lv = new anywheresoftware.b4a.keywords.LayoutValues();
 //BA.debugLineNum = 27;BA.debugLine="Dim ck2 As CheckBox";
mostCurrent._ck2 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
 //BA.debugLineNum = 28;BA.debugLine="Dim sResults As String";
mostCurrent._sresults = "";
 //BA.debugLineNum = 29;BA.debugLine="End Sub";
return "";
}
public static String  _initializecomponent() throws Exception{
anywheresoftware.b4a.objects.drawable.GradientDrawable _gc = null;
int[] _clr = null;
int _fontadjust = 0;
 //BA.debugLineNum = 129;BA.debugLine="Sub initializeComponent";
 //BA.debugLineNum = 130;BA.debugLine="Dim gc As GradientDrawable";
_gc = new anywheresoftware.b4a.objects.drawable.GradientDrawable();
 //BA.debugLineNum = 131;BA.debugLine="Dim clr(4),fontAdjust As Int";
_clr = new int[(int) (4)];
;
_fontadjust = 0;
 //BA.debugLineNum = 132;BA.debugLine="clr(0) = Colors.RGB(245,212,243)";
_clr[(int) (0)] = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (245),(int) (212),(int) (243));
 //BA.debugLineNum = 133;BA.debugLine="clr(1) = Colors.RGB(205,45,197)";
_clr[(int) (1)] = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (205),(int) (45),(int) (197));
 //BA.debugLineNum = 134;BA.debugLine="clr(2) = Colors.RGB(243,229,242)";
_clr[(int) (2)] = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (243),(int) (229),(int) (242));
 //BA.debugLineNum = 135;BA.debugLine="clr(3) = Colors.RGB(224,161,221)";
_clr[(int) (3)] = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (224),(int) (161),(int) (221));
 //BA.debugLineNum = 136;BA.debugLine="gc.Initialize(\"TOP_BOTTOM\",clr)";
_gc.Initialize(BA.getEnumFromString(android.graphics.drawable.GradientDrawable.Orientation.class,"TOP_BOTTOM"),_clr);
 //BA.debugLineNum = 137;BA.debugLine="gc.CornerRadius = 20dip";
_gc.setCornerRadius((float) (anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20))));
 //BA.debugLineNum = 138;BA.debugLine="Activity.Background = gc";
mostCurrent._activity.setBackground((android.graphics.drawable.Drawable)(_gc.getObject()));
 //BA.debugLineNum = 139;BA.debugLine="Activity.Color = Colors.RGB(231,231,231)";
mostCurrent._activity.setColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (231),(int) (231),(int) (231)));
 //BA.debugLineNum = 140;BA.debugLine="Activity.SetBackgroundImage(LoadBitmap(File.DirAss";
mostCurrent._activity.SetBackgroundImage((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"login.jpg").getObject()));
 //BA.debugLineNum = 143;BA.debugLine="lblTitle.Initialize(\"\")";
mostCurrent._lbltitle.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 144;BA.debugLine="lblTitle.Text = \"·I¨j¼¨ Jo† Ï»k]\"";
mostCurrent._lbltitle.setText((Object)("·I¨j¼¨ Jo† Ï»k]"));
 //BA.debugLineNum = 145;BA.debugLine="fontAdjust = ((100%x + 100%y) / (320dip + 480dip)";
_fontadjust = (int) (((anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)+anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (100),mostCurrent.activityBA))/(double)(anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (320))+anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (480)))-1)*3);
 //BA.debugLineNum = 146;BA.debugLine="lblTitle.TextSize = lblTitle.TextSize + 5";
mostCurrent._lbltitle.setTextSize((float) (mostCurrent._lbltitle.getTextSize()+5));
 //BA.debugLineNum = 147;BA.debugLine="lblTitle.TextColor = Colors.Black";
mostCurrent._lbltitle.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 148;BA.debugLine="lblTitle.Gravity = Gravity.RIGHT";
mostCurrent._lbltitle.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.RIGHT);
 //BA.debugLineNum = 149;BA.debugLine="lblTitle.Typeface = Typeface.LoadFromAssets(\"nj_na";
mostCurrent._lbltitle.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets("nj_nazani.ttf"));
 //BA.debugLineNum = 150;BA.debugLine="Activity.AddView(lblTitle,0dip,15dip,88%x,115dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._lbltitle.getObject()),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (0)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (15)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (88),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (115)));
 //BA.debugLineNum = 153;BA.debugLine="lblExpersion.Initialize(\"\")";
mostCurrent._lblexpersion.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 154;BA.debugLine="lblExpersion.TextSize = lblExpersion.TextSize + fo";
mostCurrent._lblexpersion.setTextSize((float) (mostCurrent._lblexpersion.getTextSize()+_fontadjust+anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (6))));
 //BA.debugLineNum = 155;BA.debugLine="lblExpersion.TextColor = Colors.Black";
mostCurrent._lblexpersion.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 156;BA.debugLine="If defaultLang = \"fa\" Then";
if ((_defaultlang).equals("fa")) { 
 //BA.debugLineNum = 157;BA.debugLine="lblExpersion.Gravity = Gravity.RIGHT";
mostCurrent._lblexpersion.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.RIGHT);
 //BA.debugLineNum = 158;BA.debugLine="lblExpersion.Typeface = Typeface.LoadFromAssets(";
mostCurrent._lblexpersion.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets("nj_nazani.ttf"));
 //BA.debugLineNum = 159;BA.debugLine="Activity.AddView(lblExpersion,1%x,56dip,80%x,40d";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._lblexpersion.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (1),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (56)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (80),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40)));
 }else {
 //BA.debugLineNum = 161;BA.debugLine="lblExpersion.Gravity = Gravity.LEFT";
mostCurrent._lblexpersion.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.LEFT);
 //BA.debugLineNum = 162;BA.debugLine="Activity.AddView(lblExpersion,28%x,56dip,80%x,40";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._lblexpersion.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (28),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (56)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (80),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40)));
 };
 //BA.debugLineNum = 166;BA.debugLine="lblResult.Initialize(\"\")";
mostCurrent._lblresult.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 167;BA.debugLine="lblResult.TextColor = Colors.Blue";
mostCurrent._lblresult.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Blue);
 //BA.debugLineNum = 168;BA.debugLine="lblResult.TextSize = lblResult.TextSize + fontAdju";
mostCurrent._lblresult.setTextSize((float) (mostCurrent._lblresult.getTextSize()+_fontadjust+anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (5))));
 //BA.debugLineNum = 169;BA.debugLine="If defaultLang = \"fa\" Then";
if ((_defaultlang).equals("fa")) { 
 //BA.debugLineNum = 170;BA.debugLine="lblResult.Text = \": ¾\\ÃTº\"";
mostCurrent._lblresult.setText((Object)(": ¾\\ÃTº"));
 //BA.debugLineNum = 171;BA.debugLine="lblResult.Typeface = Typeface.LoadFromAssets(\"nj";
mostCurrent._lblresult.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets("nj_nazani.ttf"));
 //BA.debugLineNum = 172;BA.debugLine="Activity.AddView(lblResult,82%x,56dip,140dip,50d";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._lblresult.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (82),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (56)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (140)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (50)));
 }else {
 //BA.debugLineNum = 174;BA.debugLine="lblResult.Text = \"Result: \"";
mostCurrent._lblresult.setText((Object)("Result: "));
 //BA.debugLineNum = 175;BA.debugLine="Activity.AddView(lblResult,4%x,56dip,140dip,50di";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._lblresult.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (4),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (56)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (140)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (50)));
 };
 //BA.debugLineNum = 178;BA.debugLine="End Sub";
return "";
}
public static String  _lblmenu_click() throws Exception{
int _i = 0;
 //BA.debugLineNum = 289;BA.debugLine="Sub lblMenu_Click";
 //BA.debugLineNum = 290;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 291;BA.debugLine="i = Msgbox2(\"آیا مایل به خروج هستید؟\",\"خروج\",\"بله";
_i = anywheresoftware.b4a.keywords.Common.Msgbox2("آیا مایل به خروج هستید؟","خروج","بله متاسفانه","نه خوشبختانه","",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null),mostCurrent.activityBA);
 //BA.debugLineNum = 292;BA.debugLine="If i = DialogResponse.POSITIVE Then";
if (_i==anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE) { 
 //BA.debugLineNum = 293;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 };
 //BA.debugLineNum = 295;BA.debugLine="End Sub";
return "";
}
public static String  _loadbutton() throws Exception{
double _ileft = 0;
double _itop = 0;
int _fontadjust = 0;
int _i = 0;
 //BA.debugLineNum = 179;BA.debugLine="Sub LoadButton";
 //BA.debugLineNum = 181;BA.debugLine="Dim iLeft As Double";
_ileft = 0;
 //BA.debugLineNum = 182;BA.debugLine="Dim iTop As Double";
_itop = 0;
 //BA.debugLineNum = 183;BA.debugLine="Dim res,fontAdjust As Int";
_res = 0;
_fontadjust = 0;
 //BA.debugLineNum = 184;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 185;BA.debugLine="iLeft = 10%x";
_ileft = anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (10),mostCurrent.activityBA);
 //BA.debugLineNum = 186;BA.debugLine="iTop  = 19%y";
_itop = anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (19),mostCurrent.activityBA);
 //BA.debugLineNum = 187;BA.debugLine="fontAdjust = ((100%x + 100%y) / (320dip + 480dip)";
_fontadjust = (int) (((anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)+anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (100),mostCurrent.activityBA))/(double)(anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (320))+anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (480)))-1)*3);
 //BA.debugLineNum = 188;BA.debugLine="loadColor";
_loadcolor();
 //BA.debugLineNum = 189;BA.debugLine="For i = 0 To 10";
{
final int step169 = 1;
final int limit169 = (int) (10);
for (_i = (int) (0); (step169 > 0 && _i <= limit169) || (step169 < 0 && _i >= limit169); _i = ((int)(0 + _i + step169))) {
 //BA.debugLineNum = 190;BA.debugLine="btnNumber(i).Initialize(\"btnNumber\")";
mostCurrent._btnnumber[_i].Initialize(mostCurrent.activityBA,"btnNumber");
 //BA.debugLineNum = 191;BA.debugLine="btnNumber(i).Background = myColor(i)";
mostCurrent._btnnumber[_i].setBackground((android.graphics.drawable.Drawable)(mostCurrent._mycolor[_i].getObject()));
 //BA.debugLineNum = 192;BA.debugLine="btnNumber(i).TextColor = Colors.Black";
mostCurrent._btnnumber[_i].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 193;BA.debugLine="btnNumber(i).TextSize = btnNumber(i).TextSize + 1";
mostCurrent._btnnumber[_i].setTextSize((float) (mostCurrent._btnnumber[_i].getTextSize()+11));
 //BA.debugLineNum = 194;BA.debugLine="If defaultLang = \"fa\" Then";
if ((_defaultlang).equals("fa")) { 
 //BA.debugLineNum = 195;BA.debugLine="btnNumber(i).Typeface =  Typeface.LoadFromAsset";
mostCurrent._btnnumber[_i].setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets("nj_nazani.ttf"));
 };
 //BA.debugLineNum = 197;BA.debugLine="res = arrInt(i) + 1";
_res = (int) ((double)(Double.parseDouble(mostCurrent._arrint[_i]))+1);
 //BA.debugLineNum = 198;BA.debugLine="btnNumber(i).Tag  = res";
mostCurrent._btnnumber[_i].setTag((Object)(_res));
 //BA.debugLineNum = 199;BA.debugLine="btnNumber(i).Text = res";
mostCurrent._btnnumber[_i].setText((Object)(_res));
 //BA.debugLineNum = 200;BA.debugLine="If i <> 0 Then";
if (_i!=0) { 
 //BA.debugLineNum = 201;BA.debugLine="If i Mod 3 = 0 Then";
if (_i%3==0) { 
 //BA.debugLineNum = 202;BA.debugLine="iLeft = 10%x";
_ileft = anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (10),mostCurrent.activityBA);
 //BA.debugLineNum = 203;BA.debugLine="iTop  = iTop + 14%y";
_itop = _itop+anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (14),mostCurrent.activityBA);
 };
 };
 //BA.debugLineNum = 206;BA.debugLine="Activity.AddView(btnNumber(i),iLeft,iTop,20%x,12%";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._btnnumber[_i].getObject()),(int) (_ileft),(int) (_itop),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (20),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (12),mostCurrent.activityBA));
 //BA.debugLineNum = 207;BA.debugLine="iLeft = iLeft + 29%x";
_ileft = _ileft+anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (29),mostCurrent.activityBA);
 }
};
 //BA.debugLineNum = 209;BA.debugLine="btnNumber(10).Text = \"0\"";
mostCurrent._btnnumber[(int) (10)].setText((Object)("0"));
 //BA.debugLineNum = 210;BA.debugLine="btnNumber(10).Tag = \"0\"";
mostCurrent._btnnumber[(int) (10)].setTag((Object)("0"));
 //BA.debugLineNum = 211;BA.debugLine="End Sub";
return "";
}
public static String  _loadcheckbox() throws Exception{
 //BA.debugLineNum = 117;BA.debugLine="Sub loadCheckbox";
 //BA.debugLineNum = 118;BA.debugLine="ck2.Initialize(\"chk1\")";
mostCurrent._ck2.Initialize(mostCurrent.activityBA,"chk1");
 //BA.debugLineNum = 119;BA.debugLine="ck2.Text = \"خودم به سوال پاسخ میدهم\"";
mostCurrent._ck2.setText((Object)("خودم به سوال پاسخ میدهم"));
 //BA.debugLineNum = 120;BA.debugLine="ck2.TextSize = ck2.TextSize + 5";
mostCurrent._ck2.setTextSize((float) (mostCurrent._ck2.getTextSize()+5));
 //BA.debugLineNum = 121;BA.debugLine="ck2.TextColor = Colors.Black";
mostCurrent._ck2.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 122;BA.debugLine="Activity.AddView(ck2,5%x,69%y,90%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._ck2.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (5),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (69),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (50)));
 //BA.debugLineNum = 123;BA.debugLine="End Sub";
return "";
}
public static String  _loadcolor() throws Exception{
anywheresoftware.b4a.objects.collections.Map _map1 = null;
int _r = 0;
int _g = 0;
int _b = 0;
String _scolor = "";
String _skey = "";
int _i = 0;
 //BA.debugLineNum = 92;BA.debugLine="Sub loadColor";
 //BA.debugLineNum = 93;BA.debugLine="Dim map1 As Map";
_map1 = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 94;BA.debugLine="Dim R,G,B As Int";
_r = 0;
_g = 0;
_b = 0;
 //BA.debugLineNum = 95;BA.debugLine="Dim sColor,sKey As String";
_scolor = "";
_skey = "";
 //BA.debugLineNum = 96;BA.debugLine="map1.Initialize";
_map1.Initialize();
 //BA.debugLineNum = 97;BA.debugLine="Reset_Setting";
_reset_setting();
 //BA.debugLineNum = 98;BA.debugLine="map1 = File.ReadMap(File.DirInternal,\"setting.map\"";
_map1 = anywheresoftware.b4a.keywords.Common.File.ReadMap(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"setting.map");
 //BA.debugLineNum = 99;BA.debugLine="For i = 0 To 10";
{
final int step88 = 1;
final int limit88 = (int) (10);
for (_i = (int) (0); (step88 > 0 && _i <= limit88) || (step88 < 0 && _i >= limit88); _i = ((int)(0 + _i + step88))) {
 //BA.debugLineNum = 100;BA.debugLine="sKey = i";
_skey = BA.NumberToString(_i);
 //BA.debugLineNum = 101;BA.debugLine="If map1.Get(sKey) <> Null Then";
if (_map1.Get((Object)(_skey))!= null) { 
 //BA.debugLineNum = 102;BA.debugLine="sColor = map1.Get(sKey)";
_scolor = BA.ObjectToString(_map1.Get((Object)(_skey)));
 }else {
 //BA.debugLineNum = 104;BA.debugLine="sColor = \"255239254\"";
_scolor = "255239254";
 };
 //BA.debugLineNum = 106;BA.debugLine="If sColor.Length = 8 Then";
if (_scolor.length()==8) { 
 //BA.debugLineNum = 107;BA.debugLine="sColor = sColor & \"0\"";
_scolor = _scolor+"0";
 }else if(_scolor.length()==7) { 
 //BA.debugLineNum = 109;BA.debugLine="sColor = sColor & \"00\"";
_scolor = _scolor+"00";
 };
 //BA.debugLineNum = 111;BA.debugLine="R = sColor.SubString2(0,3)";
_r = (int)(Double.parseDouble(_scolor.substring((int) (0),(int) (3))));
 //BA.debugLineNum = 112;BA.debugLine="G = sColor.SubString2(3,6)";
_g = (int)(Double.parseDouble(_scolor.substring((int) (3),(int) (6))));
 //BA.debugLineNum = 113;BA.debugLine="B = sColor.SubString2(6,9)";
_b = (int)(Double.parseDouble(_scolor.substring((int) (6),(int) (9))));
 //BA.debugLineNum = 114;BA.debugLine="myColor(i).Initialize(Colors.RGB(R,G,B),8)";
mostCurrent._mycolor[_i].Initialize(anywheresoftware.b4a.keywords.Common.Colors.RGB(_r,_g,_b),(int) (8));
 }
};
 //BA.debugLineNum = 116;BA.debugLine="End Sub";
return "";
}
public static String  _loadmenu() throws Exception{
 //BA.debugLineNum = 48;BA.debugLine="Sub loadMenu";
 //BA.debugLineNum = 49;BA.debugLine="Activity.AddMenuItem2(\"تنظیمات\",\"btnsetting\",LoadB";
mostCurrent._activity.AddMenuItem2("تنظیمات","btnsetting",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"setting.png").getObject()));
 //BA.debugLineNum = 50;BA.debugLine="Activity.AddMenuItem2(\"درباره ما\",\"btnabout\",LoadB";
mostCurrent._activity.AddMenuItem2("درباره ما","btnabout",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"about.png").getObject()));
 //BA.debugLineNum = 51;BA.debugLine="Activity.AddMenuItem2(\"خروج\",\"exit1\",LoadBitmap(Fi";
mostCurrent._activity.AddMenuItem2("خروج","exit1",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"exit.png").getObject()));
 //BA.debugLineNum = 52;BA.debugLine="End Sub";
return "";
}
public static String  _loadsetting(String _key) throws Exception{
anywheresoftware.b4a.objects.collections.Map _map1 = null;
 //BA.debugLineNum = 302;BA.debugLine="Sub loadSetting(key As String)";
 //BA.debugLineNum = 303;BA.debugLine="Dim map1 As Map";
_map1 = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 304;BA.debugLine="Reset_Setting";
_reset_setting();
 //BA.debugLineNum = 305;BA.debugLine="map1.Initialize";
_map1.Initialize();
 //BA.debugLineNum = 306;BA.debugLine="map1 = File.ReadMap(File.DirInternal,\"setting.map\"";
_map1 = anywheresoftware.b4a.keywords.Common.File.ReadMap(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"setting.map");
 //BA.debugLineNum = 307;BA.debugLine="Return map1.Get(key)";
if (true) return BA.ObjectToString(_map1.Get((Object)(_key)));
 //BA.debugLineNum = 308;BA.debugLine="End Sub";
return "";
}
public static String  _playaudio(String _snumber) throws Exception{
String _sfilename = "";
anywheresoftware.b4a.agraham.threading.Threading _threat1 = null;
int _i = 0;
int _j = 0;
 //BA.debugLineNum = 259;BA.debugLine="Sub playAudio(sNumber As String)";
 //BA.debugLineNum = 260;BA.debugLine="Dim sFilename As String";
_sfilename = "";
 //BA.debugLineNum = 261;BA.debugLine="Dim threat1 As Thread";
_threat1 = new anywheresoftware.b4a.agraham.threading.Threading();
 //BA.debugLineNum = 262;BA.debugLine="Dim i,j As Int";
_i = 0;
_j = 0;
 //BA.debugLineNum = 263;BA.debugLine="Try";
try { //BA.debugLineNum = 264;BA.debugLine="If (sNumber Mod 10 = 0) Then";
if (((double)(Double.parseDouble(_snumber))%10==0)) { 
 //BA.debugLineNum = 265;BA.debugLine="sFilename = sNumber & \".mp3\"";
_sfilename = _snumber+".mp3";
 //BA.debugLineNum = 266;BA.debugLine="media.Load(File.DirAssets,defaultLang & \"_\" &sFi";
mostCurrent._media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_defaultlang+"_"+_sfilename);
 //BA.debugLineNum = 267;BA.debugLine="media.Play";
mostCurrent._media.Play();
 //BA.debugLineNum = 268;BA.debugLine="Return";
if (true) return "";
 };
 //BA.debugLineNum = 270;BA.debugLine="If sNumber > 19 Then";
if ((double)(Double.parseDouble(_snumber))>19) { 
 //BA.debugLineNum = 271;BA.debugLine="i = sNumber Mod 10";
_i = (int) ((double)(Double.parseDouble(_snumber))%10);
 //BA.debugLineNum = 272;BA.debugLine="j = Floor((sNumber / 10)) * 10";
_j = (int) (anywheresoftware.b4a.keywords.Common.Floor(((double)(Double.parseDouble(_snumber))/(double)10))*10);
 //BA.debugLineNum = 273;BA.debugLine="sFilename = j & \"_.mp3\"";
_sfilename = BA.NumberToString(_j)+"_.mp3";
 //BA.debugLineNum = 274;BA.debugLine="media.Load(File.DirAssets,defaultLang & \"_\" & s";
mostCurrent._media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_defaultlang+"_"+_sfilename);
 //BA.debugLineNum = 275;BA.debugLine="media.Play";
mostCurrent._media.Play();
 //BA.debugLineNum = 276;BA.debugLine="threat1.Sleep(700)";
_threat1.Sleep((int) (700));
 //BA.debugLineNum = 277;BA.debugLine="sFilename = i & \".mp3\"";
_sfilename = BA.NumberToString(_i)+".mp3";
 //BA.debugLineNum = 278;BA.debugLine="media.Load(File.DirAssets,defaultLang & \"_\" & s";
mostCurrent._media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_defaultlang+"_"+_sfilename);
 //BA.debugLineNum = 279;BA.debugLine="media.Play";
mostCurrent._media.Play();
 }else {
 //BA.debugLineNum = 281;BA.debugLine="sFilename = sNumber & \".mp3\"";
_sfilename = _snumber+".mp3";
 //BA.debugLineNum = 282;BA.debugLine="media.Load(File.DirAssets,defaultLang & \"_\" & s";
mostCurrent._media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_defaultlang+"_"+_sfilename);
 //BA.debugLineNum = 283;BA.debugLine="media.Play";
mostCurrent._media.Play();
 };
 } 
       catch (Exception e266) {
			processBA.setLastException(e266); //BA.debugLineNum = 286;BA.debugLine="Msgbox(\"این قابلیت در نسخه بعدی فعال خواهد شد\",\"خط";
anywheresoftware.b4a.keywords.Common.Msgbox("این قابلیت در نسخه بعدی فعال خواهد شد","خطا",mostCurrent.activityBA);
 };
 //BA.debugLineNum = 288;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 7;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 8;BA.debugLine="Dim defaultLang As String";
_defaultlang = "";
 //BA.debugLineNum = 9;BA.debugLine="End Sub";
return "";
}
public static String  _removebutton() throws Exception{
int _i = 0;
 //BA.debugLineNum = 212;BA.debugLine="Sub RemoveButton";
 //BA.debugLineNum = 213;BA.debugLine="For i=0 To 10";
{
final int step193 = 1;
final int limit193 = (int) (10);
for (_i = (int) (0); (step193 > 0 && _i <= limit193) || (step193 < 0 && _i >= limit193); _i = ((int)(0 + _i + step193))) {
 //BA.debugLineNum = 214;BA.debugLine="btnNumber(i).RemoveView";
mostCurrent._btnnumber[_i].RemoveView();
 }
};
 //BA.debugLineNum = 216;BA.debugLine="End Sub";
return "";
}
public static String  _reset_setting() throws Exception{
anywheresoftware.b4a.objects.collections.Map _map1 = null;
 //BA.debugLineNum = 309;BA.debugLine="Sub Reset_Setting";
 //BA.debugLineNum = 310;BA.debugLine="Dim map1 As Map";
_map1 = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 311;BA.debugLine="If Not (File.Exists(File.DirInternal,\"setting.map\"";
if (anywheresoftware.b4a.keywords.Common.Not(anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"setting.map"))) { 
 //BA.debugLineNum = 312;BA.debugLine="map1.Initialize";
_map1.Initialize();
 //BA.debugLineNum = 313;BA.debugLine="map1.Put(\"bgSound\",\"off\")";
_map1.Put((Object)("bgSound"),(Object)("off"));
 //BA.debugLineNum = 314;BA.debugLine="map1.Put(\"Random\",\"false\")";
_map1.Put((Object)("Random"),(Object)("false"));
 //BA.debugLineNum = 315;BA.debugLine="map1.Put(\"Language\",\"fa\")";
_map1.Put((Object)("Language"),(Object)("fa"));
 //BA.debugLineNum = 316;BA.debugLine="map1.Put(\"1\",\"151217255\")";
_map1.Put((Object)("1"),(Object)("151217255"));
 //BA.debugLineNum = 317;BA.debugLine="map1.Put(\"2\",\"251243158\")";
_map1.Put((Object)("2"),(Object)("251243158"));
 //BA.debugLineNum = 318;BA.debugLine="map1.Put(\"3\",\"195150215\")";
_map1.Put((Object)("3"),(Object)("195150215"));
 //BA.debugLineNum = 319;BA.debugLine="map1.Put(\"4\",\"240143178\")";
_map1.Put((Object)("4"),(Object)("240143178"));
 //BA.debugLineNum = 320;BA.debugLine="map1.Put(\"5\",\"215155055\")";
_map1.Put((Object)("5"),(Object)("215155055"));
 //BA.debugLineNum = 321;BA.debugLine="map1.Put(\"6\",\"000255246\")";
_map1.Put((Object)("6"),(Object)("000255246"));
 //BA.debugLineNum = 322;BA.debugLine="map1.Put(\"7\",\"151217255\")";
_map1.Put((Object)("7"),(Object)("151217255"));
 //BA.debugLineNum = 323;BA.debugLine="map1.Put(\"8\",\"129247190\")";
_map1.Put((Object)("8"),(Object)("129247190"));
 //BA.debugLineNum = 324;BA.debugLine="map1.Put(\"9\",\"247212129\")";
_map1.Put((Object)("9"),(Object)("247212129"));
 //BA.debugLineNum = 325;BA.debugLine="map1.Put(\"10\",\"221129247\")";
_map1.Put((Object)("10"),(Object)("221129247"));
 //BA.debugLineNum = 326;BA.debugLine="map1.Put(\"0\",\"129247240\")";
_map1.Put((Object)("0"),(Object)("129247240"));
 //BA.debugLineNum = 341;BA.debugLine="File.WriteMap(File.DirInternal,\"setting.map\",map1";
anywheresoftware.b4a.keywords.Common.File.WriteMap(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"setting.map",_map1);
 };
 //BA.debugLineNum = 343;BA.debugLine="End Sub";
return "";
}
public static String  _shufflearray(String[] _arr) throws Exception{
int _n = 0;
int _r = 0;
String _t = "";
int _i = 0;
 //BA.debugLineNum = 68;BA.debugLine="Sub ShuffleArray(arr() As String)";
 //BA.debugLineNum = 69;BA.debugLine="Dim n As Int = arr.Length-1";
_n = (int) (_arr.length-1);
 //BA.debugLineNum = 70;BA.debugLine="Dim r As Int";
_r = 0;
 //BA.debugLineNum = 71;BA.debugLine="Dim t As String";
_t = "";
 //BA.debugLineNum = 72;BA.debugLine="For i = 0 To n - 1";
{
final int step61 = 1;
final int limit61 = (int) (_n-1);
for (_i = (int) (0); (step61 > 0 && _i <= limit61) || (step61 < 0 && _i >= limit61); _i = ((int)(0 + _i + step61))) {
 //BA.debugLineNum = 73;BA.debugLine="r = Rnd(i, n)";
_r = anywheresoftware.b4a.keywords.Common.Rnd(_i,_n);
 //BA.debugLineNum = 74;BA.debugLine="t = arr(i)";
_t = _arr[_i];
 //BA.debugLineNum = 75;BA.debugLine="arr(i) = arr(r)";
_arr[_i] = _arr[_r];
 //BA.debugLineNum = 76;BA.debugLine="arr(r) = t";
_arr[_r] = _t;
 }
};
 //BA.debugLineNum = 78;BA.debugLine="Return arr";
if (true) return BA.ObjectToString(_arr);
 //BA.debugLineNum = 79;BA.debugLine="End Sub";
return "";
}
public static String  _shufflecolor(anywheresoftware.b4a.objects.drawable.ColorDrawable[] _arr) throws Exception{
int _n = 0;
int _r = 0;
anywheresoftware.b4a.objects.drawable.ColorDrawable _t = null;
int _i = 0;
 //BA.debugLineNum = 80;BA.debugLine="Sub ShuffleColor(arr() As ColorDrawable)";
 //BA.debugLineNum = 81;BA.debugLine="Dim n As Int = arr.Length-1";
_n = (int) (_arr.length-1);
 //BA.debugLineNum = 82;BA.debugLine="Dim r As Int";
_r = 0;
 //BA.debugLineNum = 83;BA.debugLine="Dim t As ColorDrawable";
_t = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
 //BA.debugLineNum = 84;BA.debugLine="For i = 0 To n - 1";
{
final int step73 = 1;
final int limit73 = (int) (_n-1);
for (_i = (int) (0); (step73 > 0 && _i <= limit73) || (step73 < 0 && _i >= limit73); _i = ((int)(0 + _i + step73))) {
 //BA.debugLineNum = 85;BA.debugLine="r = Rnd(i, n)";
_r = anywheresoftware.b4a.keywords.Common.Rnd(_i,_n);
 //BA.debugLineNum = 86;BA.debugLine="t = arr(i)";
_t = _arr[_i];
 //BA.debugLineNum = 87;BA.debugLine="arr(i) = arr(r)";
_arr[_i] = _arr[_r];
 //BA.debugLineNum = 88;BA.debugLine="arr(r) = t";
_arr[_r] = _t;
 }
};
 //BA.debugLineNum = 90;BA.debugLine="Return arr";
if (true) return BA.ObjectToString(_arr);
 //BA.debugLineNum = 91;BA.debugLine="End Sub";
return "";
}
public static String  _tmr_tick() throws Exception{
 //BA.debugLineNum = 246;BA.debugLine="Sub tmr_Tick";
 //BA.debugLineNum = 247;BA.debugLine="lblExpersion.Text =  res & lblExpersion.Text";
mostCurrent._lblexpersion.setText((Object)(BA.NumberToString(_res)+mostCurrent._lblexpersion.getText()));
 //BA.debugLineNum = 248;BA.debugLine="playAudio(res)";
_playaudio(BA.NumberToString(_res));
 //BA.debugLineNum = 249;BA.debugLine="res = 0";
_res = (int) (0);
 //BA.debugLineNum = 250;BA.debugLine="If loadSetting(\"Random\") = True Then";
if ((_loadsetting("Random")).equals(BA.ObjectToString(anywheresoftware.b4a.keywords.Common.True))) { 
 //BA.debugLineNum = 251;BA.debugLine="ShuffleArray(arrInt)";
_shufflearray(mostCurrent._arrint);
 //BA.debugLineNum = 252;BA.debugLine="ShuffleColor(myColor)";
_shufflecolor(mostCurrent._mycolor);
 };
 //BA.debugLineNum = 254;BA.debugLine="RemoveButton";
_removebutton();
 //BA.debugLineNum = 255;BA.debugLine="LoadButton";
_loadbutton();
 //BA.debugLineNum = 256;BA.debugLine="ProgressDialogHide";
anywheresoftware.b4a.keywords.Common.ProgressDialogHide();
 //BA.debugLineNum = 257;BA.debugLine="tmr.Enabled = False";
mostCurrent._tmr.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 258;BA.debugLine="End Sub";
return "";
}
}
