package com.smartboard.sdms.agent;


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 broadcastdisplay extends Activity implements B4AActivity{
	public static broadcastdisplay 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;
    public static boolean dontPause;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        mostCurrent = this;
		if (processBA == null) {
			processBA = new BA(this.getApplicationContext(), null, null, "com.smartboard.sdms.agent", "com.smartboard.sdms.agent.broadcastdisplay");
			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 (broadcastdisplay).");
				p.finish();
			}
		}
        processBA.setActivityPaused(true);
        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);
        }
		
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
        WaitForLayout wl = new WaitForLayout();
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
		    BA.handler.postDelayed(wl, 5);

	}
	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, "com.smartboard.sdms.agent", "com.smartboard.sdms.agent.broadcastdisplay");
        
        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, "com.smartboard.sdms.agent.broadcastdisplay", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (broadcastdisplay) Create " + (isFirst ? "(first time)" : "") + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (broadcastdisplay) 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.raiseEventFromUI(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return broadcastdisplay.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
            return true;
		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 (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
            return true;
		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)
            return;
        if (this != mostCurrent)
			return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        if (!dontPause)
            BA.LogInfo("** Activity (broadcastdisplay) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (broadcastdisplay) Pause event (activity is not paused). **");
        if (mostCurrent != null)
            processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        if (!dontPause) {
            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() {
            broadcastdisplay mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (broadcastdisplay) Resume **");
            if (mc != mostCurrent)
                return;
		    processBA.raiseEvent(mc._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 void onRequestPermissionsResult(int requestCode,
        String permissions[], int[] grantResults) {
        for (int i = 0;i < permissions.length;i++) {
            Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
            processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
        }
            
    }

public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnlmain = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnlheader = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnlcontent = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnlfooter = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblpriority = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbltitle = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblmessage = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbltime = null;
public anywheresoftware.b4a.objects.ButtonWrapper _btndismiss = null;
public com.smartboard.sdms.agent.main _main = null;
public com.smartboard.sdms.agent.starter _starter = null;
public com.smartboard.sdms.agent.messageservice _messageservice = null;
public com.smartboard.sdms.agent.httputils2service _httputils2service = 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{
anywheresoftware.b4a.objects.IntentWrapper _in = null;
String _title = "";
String _message = "";
String _priority = "";
 //BA.debugLineNum = 22;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
 //BA.debugLineNum = 24;BA.debugLine="Dim in As Intent = Activity.GetStartingIntent";
_in = new anywheresoftware.b4a.objects.IntentWrapper();
_in = mostCurrent._activity.GetStartingIntent();
 //BA.debugLineNum = 25;BA.debugLine="Dim title As String = in.GetExtra(\"title\")";
_title = BA.ObjectToString(_in.GetExtra("title"));
 //BA.debugLineNum = 26;BA.debugLine="Dim message As String = in.GetExtra(\"message\")";
_message = BA.ObjectToString(_in.GetExtra("message"));
 //BA.debugLineNum = 27;BA.debugLine="Dim priority As String = in.GetExtra(\"priority\")";
_priority = BA.ObjectToString(_in.GetExtra("priority"));
 //BA.debugLineNum = 29;BA.debugLine="If title = Null Then title = \"Broadcast Message\"";
if (_title== null) { 
_title = "Broadcast Message";};
 //BA.debugLineNum = 30;BA.debugLine="If message = Null Then message = \"No message cont";
if (_message== null) { 
_message = "No message content";};
 //BA.debugLineNum = 31;BA.debugLine="If priority = Null Then priority = \"normal\"";
if (_priority== null) { 
_priority = "normal";};
 //BA.debugLineNum = 33;BA.debugLine="CreateDynamicLayout(title, message, priority)";
_createdynamiclayout(_title,_message,_priority);
 //BA.debugLineNum = 34;BA.debugLine="End Sub";
return "";
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 39;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 40;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
 //BA.debugLineNum = 36;BA.debugLine="Sub Activity_Resume";
 //BA.debugLineNum = 37;BA.debugLine="End Sub";
return "";
}
public static String  _btndismiss_click() throws Exception{
 //BA.debugLineNum = 146;BA.debugLine="Sub btnDismiss_Click";
 //BA.debugLineNum = 147;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 148;BA.debugLine="End Sub";
return "";
}
public static String  _createdynamiclayout(String _title,String _message,String _priority) throws Exception{
int _headercolor = 0;
int _accentcolor = 0;
anywheresoftware.b4a.objects.drawable.ColorDrawable _cdpriority = null;
anywheresoftware.b4a.objects.PanelWrapper _pnldivider = null;
anywheresoftware.b4a.objects.drawable.ColorDrawable _cdbutton = null;
 //BA.debugLineNum = 42;BA.debugLine="Sub CreateDynamicLayout(title As String, message A";
 //BA.debugLineNum = 44;BA.debugLine="pnlMain.Initialize(\"pnlMain\")";
mostCurrent._pnlmain.Initialize(mostCurrent.activityBA,"pnlMain");
 //BA.debugLineNum = 45;BA.debugLine="Activity.AddView(pnlMain, 0, 0, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._pnlmain.getObject()),(int) (0),(int) (0),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (100),mostCurrent.activityBA));
 //BA.debugLineNum = 48;BA.debugLine="Dim headerColor, accentColor As Int";
_headercolor = 0;
_accentcolor = 0;
 //BA.debugLineNum = 49;BA.debugLine="Select Case priority.ToLowerCase";
switch (BA.switchObjectToInt(_priority.toLowerCase(),"urgent","high","normal","low")) {
case 0: {
 //BA.debugLineNum = 51;BA.debugLine="headerColor = Colors.RGB(220, 38, 38) ' Red";
_headercolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (220),(int) (38),(int) (38));
 //BA.debugLineNum = 52;BA.debugLine="accentColor = Colors.RGB(185, 28, 28) ' Dark re";
_accentcolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (185),(int) (28),(int) (28));
 break; }
case 1: {
 //BA.debugLineNum = 54;BA.debugLine="headerColor = Colors.RGB(249, 115, 22) ' Orange";
_headercolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (249),(int) (115),(int) (22));
 //BA.debugLineNum = 55;BA.debugLine="accentColor = Colors.RGB(234, 88, 12) ' Dark or";
_accentcolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (234),(int) (88),(int) (12));
 break; }
case 2: {
 //BA.debugLineNum = 57;BA.debugLine="headerColor = Colors.RGB(59, 130, 246) ' Blue";
_headercolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (59),(int) (130),(int) (246));
 //BA.debugLineNum = 58;BA.debugLine="accentColor = Colors.RGB(37, 99, 235) ' Dark bl";
_accentcolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (37),(int) (99),(int) (235));
 break; }
case 3: {
 //BA.debugLineNum = 60;BA.debugLine="headerColor = Colors.RGB(107, 114, 128) ' Gray";
_headercolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (107),(int) (114),(int) (128));
 //BA.debugLineNum = 61;BA.debugLine="accentColor = Colors.RGB(75, 85, 99) ' Dark gra";
_accentcolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (75),(int) (85),(int) (99));
 break; }
default: {
 //BA.debugLineNum = 63;BA.debugLine="headerColor = Colors.RGB(59, 130, 246)";
_headercolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (59),(int) (130),(int) (246));
 //BA.debugLineNum = 64;BA.debugLine="accentColor = Colors.RGB(37, 99, 235)";
_accentcolor = anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (37),(int) (99),(int) (235));
 break; }
}
;
 //BA.debugLineNum = 68;BA.debugLine="pnlMain.Color = Colors.White";
mostCurrent._pnlmain.setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 71;BA.debugLine="pnlHeader.Initialize(\"pnlHeader\")";
mostCurrent._pnlheader.Initialize(mostCurrent.activityBA,"pnlHeader");
 //BA.debugLineNum = 72;BA.debugLine="pnlHeader.Color = headerColor";
mostCurrent._pnlheader.setColor(_headercolor);
 //BA.debugLineNum = 73;BA.debugLine="pnlMain.AddView(pnlHeader, 0, 0, 100%x, 15%y)";
mostCurrent._pnlmain.AddView((android.view.View)(mostCurrent._pnlheader.getObject()),(int) (0),(int) (0),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (15),mostCurrent.activityBA));
 //BA.debugLineNum = 76;BA.debugLine="lblPriority.Initialize(\"lblPriority\")";
mostCurrent._lblpriority.Initialize(mostCurrent.activityBA,"lblPriority");
 //BA.debugLineNum = 77;BA.debugLine="lblPriority.Text = \"  \" & priority.ToUpperCase &";
mostCurrent._lblpriority.setText(BA.ObjectToCharSequence("  "+_priority.toUpperCase()+"  "));
 //BA.debugLineNum = 78;BA.debugLine="lblPriority.TextSize = 16";
mostCurrent._lblpriority.setTextSize((float) (16));
 //BA.debugLineNum = 79;BA.debugLine="lblPriority.TextColor = headerColor";
mostCurrent._lblpriority.setTextColor(_headercolor);
 //BA.debugLineNum = 80;BA.debugLine="lblPriority.Gravity = Gravity.CENTER";
mostCurrent._lblpriority.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 81;BA.debugLine="lblPriority.Typeface = Typeface.DEFAULT_BOLD";
mostCurrent._lblpriority.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.DEFAULT_BOLD);
 //BA.debugLineNum = 84;BA.debugLine="Dim cdPriority As ColorDrawable";
_cdpriority = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
 //BA.debugLineNum = 85;BA.debugLine="cdPriority.Initialize2(Colors.White, 20dip, 0, Co";
_cdpriority.Initialize2(anywheresoftware.b4a.keywords.Common.Colors.White,anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20)),(int) (0),anywheresoftware.b4a.keywords.Common.Colors.Transparent);
 //BA.debugLineNum = 86;BA.debugLine="lblPriority.Background = cdPriority";
mostCurrent._lblpriority.setBackground((android.graphics.drawable.Drawable)(_cdpriority.getObject()));
 //BA.debugLineNum = 88;BA.debugLine="pnlHeader.AddView(lblPriority, 10dip, 5%y, 150dip";
mostCurrent._pnlheader.AddView((android.view.View)(mostCurrent._lblpriority.getObject()),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (10)),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (5),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (150)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40)));
 //BA.debugLineNum = 91;BA.debugLine="lblTime.Initialize(\"lblTime\")";
mostCurrent._lbltime.Initialize(mostCurrent.activityBA,"lblTime");
 //BA.debugLineNum = 92;BA.debugLine="lblTime.Text = DateTime.Time(DateTime.Now)";
mostCurrent._lbltime.setText(BA.ObjectToCharSequence(anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow())));
 //BA.debugLineNum = 93;BA.debugLine="lblTime.TextSize = 14";
mostCurrent._lbltime.setTextSize((float) (14));
 //BA.debugLineNum = 94;BA.debugLine="lblTime.TextColor = Colors.White";
mostCurrent._lbltime.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 95;BA.debugLine="lblTime.Gravity = Gravity.RIGHT";
mostCurrent._lbltime.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.RIGHT);
 //BA.debugLineNum = 96;BA.debugLine="pnlHeader.AddView(lblTime, 100%x - 120dip, 5%y, 1";
mostCurrent._pnlheader.AddView((android.view.View)(mostCurrent._lbltime.getObject()),(int) (anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (120))),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (5),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (110)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40)));
 //BA.debugLineNum = 99;BA.debugLine="pnlContent.Initialize(\"pnlContent\")";
mostCurrent._pnlcontent.Initialize(mostCurrent.activityBA,"pnlContent");
 //BA.debugLineNum = 100;BA.debugLine="pnlContent.Color = Colors.White";
mostCurrent._pnlcontent.setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 101;BA.debugLine="pnlMain.AddView(pnlContent, 0, 15%y, 100%x, 70%y)";
mostCurrent._pnlmain.AddView((android.view.View)(mostCurrent._pnlcontent.getObject()),(int) (0),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (15),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (70),mostCurrent.activityBA));
 //BA.debugLineNum = 104;BA.debugLine="lblTitle.Initialize(\"lblTitle\")";
mostCurrent._lbltitle.Initialize(mostCurrent.activityBA,"lblTitle");
 //BA.debugLineNum = 105;BA.debugLine="lblTitle.Text = \"📢 \" & title";
mostCurrent._lbltitle.setText(BA.ObjectToCharSequence("📢 "+_title));
 //BA.debugLineNum = 106;BA.debugLine="lblTitle.TextSize = 26";
mostCurrent._lbltitle.setTextSize((float) (26));
 //BA.debugLineNum = 107;BA.debugLine="lblTitle.TextColor = Colors.Black";
mostCurrent._lbltitle.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 108;BA.debugLine="lblTitle.Gravity = Gravity.LEFT";
mostCurrent._lbltitle.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.LEFT);
 //BA.debugLineNum = 109;BA.debugLine="lblTitle.Typeface = Typeface.DEFAULT_BOLD";
mostCurrent._lbltitle.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.DEFAULT_BOLD);
 //BA.debugLineNum = 110;BA.debugLine="pnlContent.AddView(lblTitle, 20dip, 20dip, 100%x";
mostCurrent._pnlcontent.AddView((android.view.View)(mostCurrent._lbltitle.getObject()),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20)),(int) (anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40))),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (80)));
 //BA.debugLineNum = 113;BA.debugLine="Dim pnlDivider As Panel";
_pnldivider = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 114;BA.debugLine="pnlDivider.Initialize(\"pnlDivider\")";
_pnldivider.Initialize(mostCurrent.activityBA,"pnlDivider");
 //BA.debugLineNum = 115;BA.debugLine="pnlDivider.Color = Colors.RGB(229, 231, 235) ' Li";
_pnldivider.setColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (229),(int) (231),(int) (235)));
 //BA.debugLineNum = 116;BA.debugLine="pnlContent.AddView(pnlDivider, 20dip, 110dip, 100";
mostCurrent._pnlcontent.AddView((android.view.View)(_pnldivider.getObject()),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (110)),(int) (anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40))),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (2)));
 //BA.debugLineNum = 119;BA.debugLine="lblMessage.Initialize(\"lblMessage\")";
mostCurrent._lblmessage.Initialize(mostCurrent.activityBA,"lblMessage");
 //BA.debugLineNum = 120;BA.debugLine="lblMessage.Text = message";
mostCurrent._lblmessage.setText(BA.ObjectToCharSequence(_message));
 //BA.debugLineNum = 121;BA.debugLine="lblMessage.TextSize = 20";
mostCurrent._lblmessage.setTextSize((float) (20));
 //BA.debugLineNum = 122;BA.debugLine="lblMessage.TextColor = Colors.RGB(55, 65, 81) ' D";
mostCurrent._lblmessage.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (55),(int) (65),(int) (81)));
 //BA.debugLineNum = 123;BA.debugLine="lblMessage.Gravity = Gravity.LEFT";
mostCurrent._lblmessage.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.LEFT);
 //BA.debugLineNum = 124;BA.debugLine="pnlContent.AddView(lblMessage, 20dip, 130dip, 100";
mostCurrent._pnlcontent.AddView((android.view.View)(mostCurrent._lblmessage.getObject()),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (130)),(int) (anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40))),(int) (anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (70),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (150))));
 //BA.debugLineNum = 127;BA.debugLine="pnlFooter.Initialize(\"pnlFooter\")";
mostCurrent._pnlfooter.Initialize(mostCurrent.activityBA,"pnlFooter");
 //BA.debugLineNum = 128;BA.debugLine="pnlFooter.Color = Colors.RGB(249, 250, 251) ' Ver";
mostCurrent._pnlfooter.setColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (249),(int) (250),(int) (251)));
 //BA.debugLineNum = 129;BA.debugLine="pnlMain.AddView(pnlFooter, 0, 85%y, 100%x, 15%y)";
mostCurrent._pnlmain.AddView((android.view.View)(mostCurrent._pnlfooter.getObject()),(int) (0),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (85),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (15),mostCurrent.activityBA));
 //BA.debugLineNum = 132;BA.debugLine="btnDismiss.Initialize(\"btnDismiss\")";
mostCurrent._btndismiss.Initialize(mostCurrent.activityBA,"btnDismiss");
 //BA.debugLineNum = 133;BA.debugLine="btnDismiss.Text = \"DISMISS\"";
mostCurrent._btndismiss.setText(BA.ObjectToCharSequence("DISMISS"));
 //BA.debugLineNum = 134;BA.debugLine="btnDismiss.TextSize = 18";
mostCurrent._btndismiss.setTextSize((float) (18));
 //BA.debugLineNum = 135;BA.debugLine="btnDismiss.TextColor = Colors.White";
mostCurrent._btndismiss.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 136;BA.debugLine="btnDismiss.Typeface = Typeface.DEFAULT_BOLD";
mostCurrent._btndismiss.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.DEFAULT_BOLD);
 //BA.debugLineNum = 139;BA.debugLine="Dim cdButton As ColorDrawable";
_cdbutton = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
 //BA.debugLineNum = 140;BA.debugLine="cdButton.Initialize2(accentColor, 10dip, 0, Color";
_cdbutton.Initialize2(_accentcolor,anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (10)),(int) (0),anywheresoftware.b4a.keywords.Common.Colors.Transparent);
 //BA.debugLineNum = 141;BA.debugLine="btnDismiss.Background = cdButton";
mostCurrent._btndismiss.setBackground((android.graphics.drawable.Drawable)(_cdbutton.getObject()));
 //BA.debugLineNum = 143;BA.debugLine="pnlFooter.AddView(btnDismiss, 20dip, 3%y, 100%x -";
mostCurrent._pnlfooter.AddView((android.view.View)(mostCurrent._btndismiss.getObject()),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20)),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (3),mostCurrent.activityBA),(int) (anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (40))),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (60)));
 //BA.debugLineNum = 144;BA.debugLine="End Sub";
return "";
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 10;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 11;BA.debugLine="Private pnlMain As Panel";
mostCurrent._pnlmain = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Private pnlHeader As Panel";
mostCurrent._pnlheader = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Private pnlContent As Panel";
mostCurrent._pnlcontent = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Private pnlFooter As Panel";
mostCurrent._pnlfooter = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 15;BA.debugLine="Private lblPriority As Label";
mostCurrent._lblpriority = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Private lblTitle As Label";
mostCurrent._lbltitle = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Private lblMessage As Label";
mostCurrent._lblmessage = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 18;BA.debugLine="Private lblTime As Label";
mostCurrent._lbltime = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 19;BA.debugLine="Private btnDismiss As Button";
mostCurrent._btndismiss = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 20;BA.debugLine="End Sub";
return "";
}
public static String  _pnlmain_click() throws Exception{
 //BA.debugLineNum = 150;BA.debugLine="Sub pnlMain_Click";
 //BA.debugLineNum = 153;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="End Sub";
return "";
}
}
