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 frmgame7 extends Activity implements B4AActivity{
	public static frmgame7 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 = false;
	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.frmgame7");
			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 (frmgame7).");
				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.frmgame7");
        
        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.frmgame7", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (frmgame7) Create, isFirst = " + isFirst + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (frmgame7) 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 frmgame7.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 (frmgame7) 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 (frmgame7) 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 anywheresoftware.b4a.objects.ImageViewWrapper _img1 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img2 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img3 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img4 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img5 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img6 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img7 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img8 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img9 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img10 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img11 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img12 = null;
public static String _simg1 = "";
public static String _simg2 = "";
public anywheresoftware.b4a.objects.ImageViewWrapper _imgbackground = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _imtemp = null;
public static int _cnt = 0;
public anywheresoftware.b4a.objects.LabelWrapper _lblscore = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblscore1 = null;
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.frmgame2 _frmgame2 = 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.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{
 //BA.debugLineNum = 22;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
 //BA.debugLineNum = 23;BA.debugLine="Activity.LoadLayout(\"game7\")";
mostCurrent._activity.LoadLayout("game7",mostCurrent.activityBA);
 //BA.debugLineNum = 24;BA.debugLine="common.changeTheme(imgbackground)";
mostCurrent._common._changetheme(mostCurrent.activityBA,mostCurrent._imgbackground);
 //BA.debugLineNum = 37;BA.debugLine="MakePuzzle";
_makepuzzle();
 //BA.debugLineNum = 38;BA.debugLine="cnt = 0";
_cnt = (int) (0);
 //BA.debugLineNum = 39;BA.debugLine="ToastMessageShow(\"شروع شد\",False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow("شروع شد",anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 40;BA.debugLine="loadMenu";
_loadmenu();
 //BA.debugLineNum = 41;BA.debugLine="lblscore.Typeface = Typeface.LoadFromAssets(\"BNaza";
mostCurrent._lblscore.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets("BNazanin.ttf"));
 //BA.debugLineNum = 42;BA.debugLine="lblscore1.Typeface = Typeface.LoadFromAssets(\"BNaz";
mostCurrent._lblscore1.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets("BNazanin.ttf"));
 //BA.debugLineNum = 43;BA.debugLine="End Sub";
return "";
}
public static boolean  _activity_keypress(int _keycode) throws Exception{
 //BA.debugLineNum = 265;BA.debugLine="Sub Activity_KeyPress (KeyCode As Int) As Boolean";
 //BA.debugLineNum = 266;BA.debugLine="If KeyCode = KeyCodes.KEYCODE_BACK Then";
if (_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_BACK) { 
 //BA.debugLineNum = 267;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 268;BA.debugLine="common.stopAudio";
mostCurrent._common._stopaudio(mostCurrent.activityBA);
 //BA.debugLineNum = 269;BA.debugLine="StartActivity(Main)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._main.getObject()));
 };
 //BA.debugLineNum = 271;BA.debugLine="If KeyCode = KeyCodes.KEYCODE_MENU Then";
if (_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_MENU) { 
 //BA.debugLineNum = 272;BA.debugLine="Activity.OpenMenu";
mostCurrent._activity.OpenMenu();
 };
 //BA.debugLineNum = 274;BA.debugLine="End Sub";
return false;
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 166;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 168;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
 //BA.debugLineNum = 162;BA.debugLine="Sub Activity_Resume";
 //BA.debugLineNum = 164;BA.debugLine="End Sub";
return "";
}
public static String  _btnabout_click() throws Exception{
 //BA.debugLineNum = 53;BA.debugLine="Sub btnabout_Click";
 //BA.debugLineNum = 54;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 55;BA.debugLine="StartActivity(frmabout)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._frmabout.getObject()));
 //BA.debugLineNum = 56;BA.debugLine="End Sub";
return "";
}
public static String  _btnsetting_click() throws Exception{
 //BA.debugLineNum = 49;BA.debugLine="Sub btnsetting_Click";
 //BA.debugLineNum = 50;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 51;BA.debugLine="StartActivity(setting)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._setting.getObject()));
 //BA.debugLineNum = 52;BA.debugLine="End Sub";
return "";
}
public static String  _checkitem(anywheresoftware.b4a.objects.ImageViewWrapper _c1) throws Exception{
int _i1 = 0;
String _t2 = "";
String _t3 = "";
anywheresoftware.b4a.agraham.threading.Threading _t1 = null;
 //BA.debugLineNum = 170;BA.debugLine="Sub CheckItem(c1 As ImageView)";
 //BA.debugLineNum = 171;BA.debugLine="Dim i1 As Int";
_i1 = 0;
 //BA.debugLineNum = 172;BA.debugLine="Dim t2,t3 As String";
_t2 = "";
_t3 = "";
 //BA.debugLineNum = 173;BA.debugLine="Dim t1 As Thread";
_t1 = new anywheresoftware.b4a.agraham.threading.Threading();
 //BA.debugLineNum = 174;BA.debugLine="If sImg1 <> \"\" Then";
if ((mostCurrent._simg1).equals("") == false) { 
 //BA.debugLineNum = 175;BA.debugLine="sImg2 = c1.Tag";
mostCurrent._simg2 = BA.ObjectToString(_c1.getTag());
 //BA.debugLineNum = 176;BA.debugLine="c1.Bitmap = LoadBitmap(File.DirAssets,c1.Tag)";
_c1.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),BA.ObjectToString(_c1.getTag())).getObject()));
 }else {
 //BA.debugLineNum = 178;BA.debugLine="sImg1 = c1.Tag";
mostCurrent._simg1 = BA.ObjectToString(_c1.getTag());
 //BA.debugLineNum = 179;BA.debugLine="imTemp = c1";
mostCurrent._imtemp = _c1;
 //BA.debugLineNum = 180;BA.debugLine="c1.Bitmap = LoadBitmap(File.DirAssets,c1.Tag)";
_c1.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),BA.ObjectToString(_c1.getTag())).getObject()));
 };
 //BA.debugLineNum = 182;BA.debugLine="If sImg1 <> \"\" AND sImg2 <> \"\" AND sImg1 <> sImg2";
if ((mostCurrent._simg1).equals("") == false && (mostCurrent._simg2).equals("") == false && (mostCurrent._simg1).equals(mostCurrent._simg2) == false) { 
 //BA.debugLineNum = 183;BA.debugLine="common.playAudio(\"wrong.wav\")";
mostCurrent._common._playaudio(mostCurrent.activityBA,"wrong.wav");
 //BA.debugLineNum = 184;BA.debugLine="c1.Bitmap = LoadBitmap(File.DirAssets,c1.Tag)";
_c1.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),BA.ObjectToString(_c1.getTag())).getObject()));
 //BA.debugLineNum = 185;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 //BA.debugLineNum = 186;BA.debugLine="t1.Sleep(1700)";
_t1.Sleep((int) (1700));
 //BA.debugLineNum = 187;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 //BA.debugLineNum = 188;BA.debugLine="c1.Bitmap = LoadBitmap(File.DirAssets,\"none.gif\"";
_c1.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"none.gif").getObject()));
 //BA.debugLineNum = 189;BA.debugLine="imTemp.Bitmap = LoadBitmap(File.DirAssets,\"none.";
mostCurrent._imtemp.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"none.gif").getObject()));
 //BA.debugLineNum = 190;BA.debugLine="common.vibrePhone";
mostCurrent._common._vibrephone(mostCurrent.activityBA);
 //BA.debugLineNum = 191;BA.debugLine="sImg1 = \"\"";
mostCurrent._simg1 = "";
 //BA.debugLineNum = 192;BA.debugLine="sImg2 = \"\"";
mostCurrent._simg2 = "";
 //BA.debugLineNum = 193;BA.debugLine="t2 = lblscore1.Text";
_t2 = mostCurrent._lblscore1.getText();
 //BA.debugLineNum = 194;BA.debugLine="lblscore1.Text = t2 - 10";
mostCurrent._lblscore1.setText((Object)((double)(Double.parseDouble(_t2))-10));
 //BA.debugLineNum = 195;BA.debugLine="ToastMessageShow(\"اشتباه بود\",False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow("اشتباه بود",anywheresoftware.b4a.keywords.Common.False);
 }else if((mostCurrent._simg1).equals("") == false && (mostCurrent._simg2).equals("") == false && (mostCurrent._simg1).equals(mostCurrent._simg2)) { 
 //BA.debugLineNum = 197;BA.debugLine="sImg1 = \"\"";
mostCurrent._simg1 = "";
 //BA.debugLineNum = 198;BA.debugLine="sImg2 = \"\"";
mostCurrent._simg2 = "";
 //BA.debugLineNum = 199;BA.debugLine="common.playAnimation(c1,\"scale\",500)";
mostCurrent._common._playanimation(mostCurrent.activityBA,(anywheresoftware.b4a.objects.ConcreteViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.ConcreteViewWrapper(), (android.view.View)(_c1.getObject())),"scale",(int) (500));
 //BA.debugLineNum = 200;BA.debugLine="cnt = cnt + 1";
_cnt = (int) (_cnt+1);
 //BA.debugLineNum = 201;BA.debugLine="common.playAnimation(imTemp,\"scale\",500)";
mostCurrent._common._playanimation(mostCurrent.activityBA,(anywheresoftware.b4a.objects.ConcreteViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.ConcreteViewWrapper(), (android.view.View)(mostCurrent._imtemp.getObject())),"scale",(int) (500));
 //BA.debugLineNum = 202;BA.debugLine="t2 = lblscore1.Text";
_t2 = mostCurrent._lblscore1.getText();
 //BA.debugLineNum = 203;BA.debugLine="lblscore1.Text = t2 + 10";
mostCurrent._lblscore1.setText((Object)((double)(Double.parseDouble(_t2))+10));
 //BA.debugLineNum = 204;BA.debugLine="c1.Visible = False";
_c1.setVisible(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 205;BA.debugLine="imTemp.Visible = False";
mostCurrent._imtemp.setVisible(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 206;BA.debugLine="If cnt = 6 Then";
if (_cnt==6) { 
 //BA.debugLineNum = 207;BA.debugLine="If lblscore1.Text < -10 Then";
if ((double)(Double.parseDouble(mostCurrent._lblscore1.getText()))<-10) { 
 //BA.debugLineNum = 208;BA.debugLine="t3 = \"حافظه شما خیلی ضعیف است\"";
_t3 = "حافظه شما خیلی ضعیف است";
 }else if((double)(Double.parseDouble(mostCurrent._lblscore1.getText()))<0) { 
 //BA.debugLineNum = 210;BA.debugLine="t3 = \"حافظه شما بد نیست\"";
_t3 = "حافظه شما بد نیست";
 }else if((double)(Double.parseDouble(mostCurrent._lblscore1.getText()))<40) { 
 //BA.debugLineNum = 212;BA.debugLine="t3 = \"حافظه شما واقعی عالیست\"";
_t3 = "حافظه شما واقعی عالیست";
 }else if((double)(Double.parseDouble(mostCurrent._lblscore1.getText()))<20) { 
 //BA.debugLineNum = 214;BA.debugLine="t3 = \"حافظه شما وضعیت متوسط دارد\"";
_t3 = "حافظه شما وضعیت متوسط دارد";
 };
 //BA.debugLineNum = 216;BA.debugLine="common.playAudio(\"win.mp3\")";
mostCurrent._common._playaudio(mostCurrent.activityBA,"win.mp3");
 //BA.debugLineNum = 217;BA.debugLine="i1 = Msgbox2(\"حافظه شما خوب است\",\"آفرین\",\"دوب";
_i1 = anywheresoftware.b4a.keywords.Common.Msgbox2("حافظه شما خوب است","آفرین","دوباره","خروج","",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null),mostCurrent.activityBA);
 //BA.debugLineNum = 218;BA.debugLine="If i1 = DialogResponse.POSITIVE Then";
if (_i1==anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE) { 
 //BA.debugLineNum = 219;BA.debugLine="Activity_Create(False)";
_activity_create(anywheresoftware.b4a.keywords.Common.False);
 }else {
 //BA.debugLineNum = 221;BA.debugLine="common.stopAudio";
mostCurrent._common._stopaudio(mostCurrent.activityBA);
 //BA.debugLineNum = 222;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 223;BA.debugLine="StartActivity(Main)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._main.getObject()));
 };
 };
 };
 //BA.debugLineNum = 227;BA.debugLine="End Sub";
return "";
}
public static String  _exit1_click() throws Exception{
int _i = 0;
 //BA.debugLineNum = 57;BA.debugLine="Sub exit1_Click";
 //BA.debugLineNum = 58;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 59;BA.debugLine="i = Msgbox2(\"آیا مایل به خروج هستید؟\",\"خروج\",\"آری\"";
_i = anywheresoftware.b4a.keywords.Common.Msgbox2("آیا مایل به خروج هستید؟","خروج","آری","خیر","",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null),mostCurrent.activityBA);
 //BA.debugLineNum = 60;BA.debugLine="If i = DialogResponse.POSITIVE Then";
if (_i==anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE) { 
 //BA.debugLineNum = 61;BA.debugLine="ExitApplication";
anywheresoftware.b4a.keywords.Common.ExitApplication();
 };
 //BA.debugLineNum = 63;BA.debugLine="End Sub";
return "";
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 12;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 13;BA.debugLine="Dim img1,img2,img3,img4,img5,img6,img7,img8,img9,";
mostCurrent._img1 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img2 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img3 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img4 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img5 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img6 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img7 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img8 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img9 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img10 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img11 = new anywheresoftware.b4a.objects.ImageViewWrapper();
mostCurrent._img12 = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Dim sImg1,sImg2 As String";
mostCurrent._simg1 = "";
mostCurrent._simg2 = "";
 //BA.debugLineNum = 15;BA.debugLine="Dim imgbackground As ImageView";
mostCurrent._imgbackground = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim imTemp As ImageView";
mostCurrent._imtemp = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Dim cnt As Int";
_cnt = 0;
 //BA.debugLineNum = 18;BA.debugLine="Dim lblscore As Label";
mostCurrent._lblscore = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 19;BA.debugLine="Dim lblscore1 As Label";
mostCurrent._lblscore1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 20;BA.debugLine="End Sub";
return "";
}
public static String  _img1_click() throws Exception{
 //BA.debugLineNum = 262;BA.debugLine="Sub img1_Click";
 //BA.debugLineNum = 263;BA.debugLine="CheckItem(img1)";
_checkitem(mostCurrent._img1);
 //BA.debugLineNum = 264;BA.debugLine="End Sub";
return "";
}
public static String  _img10_click() throws Exception{
 //BA.debugLineNum = 259;BA.debugLine="Sub img10_Click";
 //BA.debugLineNum = 260;BA.debugLine="CheckItem(img10)";
_checkitem(mostCurrent._img10);
 //BA.debugLineNum = 261;BA.debugLine="End Sub";
return "";
}
public static String  _img11_click() throws Exception{
 //BA.debugLineNum = 256;BA.debugLine="Sub img11_Click";
 //BA.debugLineNum = 257;BA.debugLine="CheckItem(img11)";
_checkitem(mostCurrent._img11);
 //BA.debugLineNum = 258;BA.debugLine="End Sub";
return "";
}
public static String  _img12_click() throws Exception{
 //BA.debugLineNum = 253;BA.debugLine="Sub img12_Click";
 //BA.debugLineNum = 254;BA.debugLine="CheckItem(img12)";
_checkitem(mostCurrent._img12);
 //BA.debugLineNum = 255;BA.debugLine="End Sub";
return "";
}
public static String  _img2_click() throws Exception{
 //BA.debugLineNum = 250;BA.debugLine="Sub img2_Click";
 //BA.debugLineNum = 251;BA.debugLine="CheckItem(img2)";
_checkitem(mostCurrent._img2);
 //BA.debugLineNum = 252;BA.debugLine="End Sub";
return "";
}
public static String  _img3_click() throws Exception{
 //BA.debugLineNum = 247;BA.debugLine="Sub img3_Click";
 //BA.debugLineNum = 248;BA.debugLine="CheckItem(img3)";
_checkitem(mostCurrent._img3);
 //BA.debugLineNum = 249;BA.debugLine="End Sub";
return "";
}
public static String  _img4_click() throws Exception{
 //BA.debugLineNum = 244;BA.debugLine="Sub img4_Click";
 //BA.debugLineNum = 245;BA.debugLine="CheckItem(img4)";
_checkitem(mostCurrent._img4);
 //BA.debugLineNum = 246;BA.debugLine="End Sub";
return "";
}
public static String  _img5_click() throws Exception{
 //BA.debugLineNum = 241;BA.debugLine="Sub img5_Click";
 //BA.debugLineNum = 242;BA.debugLine="CheckItem(img5)";
_checkitem(mostCurrent._img5);
 //BA.debugLineNum = 243;BA.debugLine="End Sub";
return "";
}
public static String  _img6_click() throws Exception{
 //BA.debugLineNum = 238;BA.debugLine="Sub img6_Click";
 //BA.debugLineNum = 239;BA.debugLine="CheckItem(img6)";
_checkitem(mostCurrent._img6);
 //BA.debugLineNum = 240;BA.debugLine="End Sub";
return "";
}
public static String  _img7_click() throws Exception{
 //BA.debugLineNum = 235;BA.debugLine="Sub img7_Click";
 //BA.debugLineNum = 236;BA.debugLine="CheckItem(img7)";
_checkitem(mostCurrent._img7);
 //BA.debugLineNum = 237;BA.debugLine="End Sub";
return "";
}
public static String  _img8_click() throws Exception{
 //BA.debugLineNum = 232;BA.debugLine="Sub img8_Click";
 //BA.debugLineNum = 233;BA.debugLine="CheckItem(img8)";
_checkitem(mostCurrent._img8);
 //BA.debugLineNum = 234;BA.debugLine="End Sub";
return "";
}
public static String  _img9_click() throws Exception{
 //BA.debugLineNum = 229;BA.debugLine="Sub img9_Click";
 //BA.debugLineNum = 230;BA.debugLine="CheckItem(img9)";
_checkitem(mostCurrent._img9);
 //BA.debugLineNum = 231;BA.debugLine="End Sub";
return "";
}
public static String  _loadmenu() throws Exception{
 //BA.debugLineNum = 44;BA.debugLine="Sub loadMenu";
 //BA.debugLineNum = 45;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 = 46;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 = 47;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 = 48;BA.debugLine="End Sub";
return "";
}
public static String  _makepuzzle() throws Exception{
int _r1 = 0;
 //BA.debugLineNum = 65;BA.debugLine="Sub MakePuzzle";
 //BA.debugLineNum = 66;BA.debugLine="Dim r1 As Int";
_r1 = 0;
 //BA.debugLineNum = 67;BA.debugLine="r1 = Rnd(1,5)";
_r1 = anywheresoftware.b4a.keywords.Common.Rnd((int) (1),(int) (5));
 //BA.debugLineNum = 68;BA.debugLine="Select Case r1";
switch (_r1) {
case 1:
 //BA.debugLineNum = 70;BA.debugLine="img1.Tag=\"cat.jpg\"";
mostCurrent._img1.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 71;BA.debugLine="img7.Tag=\"cat.jpg\"";
mostCurrent._img7.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 73;BA.debugLine="img2.Tag=\"chicken.jpg\"";
mostCurrent._img2.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 74;BA.debugLine="img8.Tag=\"chicken.jpg\"";
mostCurrent._img8.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 76;BA.debugLine="img3.Tag=\"cow.jpg\"";
mostCurrent._img3.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 77;BA.debugLine="img9.Tag=\"cow.jpg\"";
mostCurrent._img9.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 79;BA.debugLine="img4.Tag=\"dog.jpg\"";
mostCurrent._img4.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 80;BA.debugLine="img10.Tag=\"dog.jpg\"";
mostCurrent._img10.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 82;BA.debugLine="img5.Tag=\"duck.jpg\"";
mostCurrent._img5.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 83;BA.debugLine="img11.Tag=\"duck.jpg\"";
mostCurrent._img11.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 85;BA.debugLine="img6.Tag=\"elephant.jpg\"";
mostCurrent._img6.setTag((Object)("elephant.jpg"));
 //BA.debugLineNum = 86;BA.debugLine="img12.Tag=\"elephant.jpg\"";
mostCurrent._img12.setTag((Object)("elephant.jpg"));
 break;
case 2:
 //BA.debugLineNum = 88;BA.debugLine="img1.Tag=\"cat.jpg\"";
mostCurrent._img1.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 89;BA.debugLine="img3.Tag=\"cat.jpg\"";
mostCurrent._img3.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 91;BA.debugLine="img2.Tag=\"chicken.jpg\"";
mostCurrent._img2.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 92;BA.debugLine="img4.Tag=\"chicken.jpg\"";
mostCurrent._img4.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 94;BA.debugLine="img5.Tag=\"cow.jpg\"";
mostCurrent._img5.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 95;BA.debugLine="img7.Tag=\"cow.jpg\"";
mostCurrent._img7.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 97;BA.debugLine="img8.Tag=\"dog.jpg\"";
mostCurrent._img8.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 98;BA.debugLine="img9.Tag=\"dog.jpg\"";
mostCurrent._img9.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 100;BA.debugLine="img10.Tag=\"duck.jpg\"";
mostCurrent._img10.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 101;BA.debugLine="img12.Tag=\"duck.jpg\"";
mostCurrent._img12.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 103;BA.debugLine="img11.Tag=\"elephant.jpg\"";
mostCurrent._img11.setTag((Object)("elephant.jpg"));
 //BA.debugLineNum = 104;BA.debugLine="img6.Tag=\"elephant.jpg\"";
mostCurrent._img6.setTag((Object)("elephant.jpg"));
 break;
case 3:
 //BA.debugLineNum = 106;BA.debugLine="img1.Tag=\"cat.jpg\"";
mostCurrent._img1.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 107;BA.debugLine="img5.Tag=\"cat.jpg\"";
mostCurrent._img5.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 109;BA.debugLine="img2.Tag=\"chicken.jpg\"";
mostCurrent._img2.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 110;BA.debugLine="img12.Tag=\"chicken.jpg\"";
mostCurrent._img12.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 112;BA.debugLine="img3.Tag=\"cow.jpg\"";
mostCurrent._img3.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 113;BA.debugLine="img11.Tag=\"cow.jpg\"";
mostCurrent._img11.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 115;BA.debugLine="img4.Tag=\"dog.jpg\"";
mostCurrent._img4.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 116;BA.debugLine="img8.Tag=\"dog.jpg\"";
mostCurrent._img8.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 118;BA.debugLine="img6.Tag=\"duck.jpg\"";
mostCurrent._img6.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 119;BA.debugLine="img9.Tag=\"duck.jpg\"";
mostCurrent._img9.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 121;BA.debugLine="img7.Tag=\"elephant.jpg\"";
mostCurrent._img7.setTag((Object)("elephant.jpg"));
 //BA.debugLineNum = 122;BA.debugLine="img10.Tag=\"elephant.jpg\"";
mostCurrent._img10.setTag((Object)("elephant.jpg"));
 break;
case 4:
 //BA.debugLineNum = 124;BA.debugLine="img10.Tag=\"cat.jpg\"";
mostCurrent._img10.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 125;BA.debugLine="img11.Tag=\"cat.jpg\"";
mostCurrent._img11.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 127;BA.debugLine="img1.Tag=\"chicken.jpg\"";
mostCurrent._img1.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 128;BA.debugLine="img12.Tag=\"chicken.jpg\"";
mostCurrent._img12.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 130;BA.debugLine="img2.Tag=\"cow.jpg\"";
mostCurrent._img2.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 131;BA.debugLine="img9.Tag=\"cow.jpg\"";
mostCurrent._img9.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 133;BA.debugLine="img8.Tag=\"dog.jpg\"";
mostCurrent._img8.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 134;BA.debugLine="img3.Tag=\"dog.jpg\"";
mostCurrent._img3.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 136;BA.debugLine="img7.Tag=\"duck.jpg\"";
mostCurrent._img7.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 137;BA.debugLine="img4.Tag=\"duck.jpg\"";
mostCurrent._img4.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 139;BA.debugLine="img5.Tag=\"elephant.jpg\"";
mostCurrent._img5.setTag((Object)("elephant.jpg"));
 //BA.debugLineNum = 140;BA.debugLine="img6.Tag=\"elephant.jpg\"";
mostCurrent._img6.setTag((Object)("elephant.jpg"));
 break;
case 5:
 //BA.debugLineNum = 142;BA.debugLine="img7.Tag=\"cat.jpg\"";
mostCurrent._img7.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 143;BA.debugLine="img8.Tag=\"cat.jpg\"";
mostCurrent._img8.setTag((Object)("cat.jpg"));
 //BA.debugLineNum = 145;BA.debugLine="img2.Tag=\"chicken.jpg\"";
mostCurrent._img2.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 146;BA.debugLine="img12.Tag=\"chicken.jpg\"";
mostCurrent._img12.setTag((Object)("chicken.jpg"));
 //BA.debugLineNum = 148;BA.debugLine="img1.Tag=\"cow.jpg\"";
mostCurrent._img1.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 149;BA.debugLine="img9.Tag=\"cow.jpg\"";
mostCurrent._img9.setTag((Object)("cow.jpg"));
 //BA.debugLineNum = 151;BA.debugLine="img3.Tag=\"dog.jpg\"";
mostCurrent._img3.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 152;BA.debugLine="img4.Tag=\"dog.jpg\"";
mostCurrent._img4.setTag((Object)("dog.jpg"));
 //BA.debugLineNum = 154;BA.debugLine="img10.Tag=\"duck.jpg\"";
mostCurrent._img10.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 155;BA.debugLine="img5.Tag=\"duck.jpg\"";
mostCurrent._img5.setTag((Object)("duck.jpg"));
 //BA.debugLineNum = 157;BA.debugLine="img6.Tag=\"elephant.jpg\"";
mostCurrent._img6.setTag((Object)("elephant.jpg"));
 //BA.debugLineNum = 158;BA.debugLine="img11.Tag=\"elephant.jpg\"";
mostCurrent._img11.setTag((Object)("elephant.jpg"));
 break;
}
;
 //BA.debugLineNum = 160;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 10;BA.debugLine="End Sub";
return "";
}
}
