function LoginLY() ----------- Admin Panel V2 By DevelopEye Tutorials ----------- loginlayout = { LinearLayout; layout_height="fill"; layout_width="fill"; backgroundColor="0xFF000000"; { FrameLayout; layout_width="fill"; layout_height="fill"; id="xmenu"; { ParticlesView; id="xmenu1"; }; { LinearLayout; orientation="vertical"; layout_height="fill"; id="animationLayout"; layout_width="fill"; { LinearLayout; layout_width="fill"; layout_height="5%h"; }; { TextView; layout_gravity="center_horizontal"; textColor="0xFFFFFFFF"; layout_width="wrap"; id="loginTitle"; textSize="30sp"; text="Login Screen"; layout_height="wrap"; }; { TextView; layout_gravity="center_horizontal"; textColor="0xFFFFFFFF"; layout_width="wrap"; id="loginSubtitle"; textSize="12sp"; text="Sign In"; layout_height="wrap"; }; { LinearLayout; layout_width="fill"; layout_height="8%h"; }; { ImageView; layout_width="15%h"; layout_gravity="center"; layout_height="15%h"; src="res/icon.png"; }; { LinearLayout; layout_width="fill"; layout_height="4%h"; }; { TextView; layout_gravity="center_horizontal"; textColor="0xFFFFFFFF"; layout_width="wrap"; id="loginMessage"; textSize="14sp"; text="Login To Continue"; layout_height="wrap"; }; { LinearLayout; layout_width="fill"; layout_height="2%h"; }; { LinearLayout; orientation="vertical"; layout_width="fill"; layout_height="wrap"; { CardView; radius="50"; layout_marginTop="1%h"; backgroundColor="0xFFFFFFFF"; layout_marginLeft="4%h"; layout_gravity="center"; layout_marginBottom="1%h"; layout_width="fill"; cardElevation="5dp"; layout_height="6%h"; layout_marginRight="4%h"; { LinearLayout; gravity="center_vertical"; paddingRight="2%h"; orientation="horizontal"; paddingLeft="2%h"; layout_height="fill"; layout_width="fill"; { ImageView; layout_height="3%h"; colorFilter="0xFF504F60"; layout_width="3%h"; src="res/account.png"; }; { LinearLayout; layout_width="0.5%h"; layout_height="fill"; }; { EditText; textColor="0xFF504F60"; hint="username"; textSize="16sp"; backgroundColor="none"; hintTextColor="0x94504F60"; inputType="textNoSuggestions"; layout_width="fill"; layout_height="fill"; id="txtUsername"; }; }; }; }; { LinearLayout; orientation="vertical"; layout_width="fill"; layout_height="wrap"; { CardView; radius="50"; layout_marginTop="1%h"; backgroundColor="0xFFFFFFFF"; layout_marginLeft="4%h"; layout_gravity="center"; layout_marginBottom="1%h"; layout_width="fill"; cardElevation="5dp"; layout_height="6%h"; layout_marginRight="4%h"; { LinearLayout; gravity="center_vertical"; paddingRight="2%h"; orientation="horizontal"; paddingLeft="2%h"; layout_height="fill"; layout_width="fill"; { ImageView; layout_height="3%h"; colorFilter="0xFF504F60"; layout_width="3%h"; src="res/key.png"; }; { LinearLayout; layout_width="0.5%h"; layout_height="fill"; }; { EditText; textColor="0xFF504F60"; hint="password"; textSize="16sp"; backgroundColor="none"; hintTextColor="0x94504F60"; inputType="textPassword"; layout_width="fill"; layout_height="fill"; id="txtPassword"; }; }; }; }; { LinearLayout; layout_width="fill"; layout_height="2%h"; }; { LinearLayout; paddingLeft="4%h"; paddingRight="4%h"; orientation="horizontal"; gravity="right"; layout_height="wrap"; layout_width="fill"; { TextView; layout_gravity="center_vertical"; textColor="0xFFFFFFFF"; text="Login!"; layout_height="wrap"; textSize="15sp"; id="txtSignIn"; layout_width="wrap"; }; { LinearLayout; layout_width="1%h"; layout_height="fill"; }; { CardView; radius="25dp"; layout_marginTop="1%h"; layout_marginBottom="1%h"; layout_width="5%h"; layout_height="5%h"; backgroundColor="0xFFFF0000"; id="btnSignIn"; { LinearLayout; gravity="center"; layout_height="fill"; padding="1%h"; layout_width="fill"; { ImageView; layout_height="fill"; layout_width="fill"; src="res/arrow-right.png"; }; }; }; }; }; }; }; if Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP then activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(0xFF009DFF); activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setNavigationBarColor(0xFF000000); end activity.setContentView(loadlayout(loginlayout)); activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) activity.setTheme(R.AndLua1); activity.overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out); if Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP then activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(0xFF009DFF); activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setNavigationBarColor(0xFF000000); end loginTitle.setTypeface(Typeface.DEFAULT_BOLD) loginMessage.setTypeface(Typeface.DEFAULT_BOLD) txtUsername.setTypeface(Typeface.DEFAULT_BOLD) txtPassword.setTypeface(Typeface.DEFAULT_BOLD) txtSignIn.setTypeface(Typeface.DEFAULT_BOLD) animation = AnimationUtils.loadAnimation(activity,android.R.anim.fade_in) layoutAnimation = LayoutAnimationController(animation) layoutAnimation.setOrder(LayoutAnimationController.ORDER_NORMAL) layoutAnimation.setDelay(0.1) animationLayout.setLayoutAnimation(layoutAnimation) server="https://kjgcc.000webhostapp.com/" --- Server URL btnSignIn.onClick=function() local username = txtUsername.text local password = txtPassword.text import "android.provider.Settings$Secure" local uuid = Secure.getString(activity.getContentResolver(), Secure.ANDROID_ID) if !username || username == "" && !password || password == "" then Toast.makeText(activity, "Username and password is required.",Toast.LENGTH_SHORT).show() else local dl=ProgressDialog.show(activity,nil,'Please wait!') dl.show() Http.post(server.."login.php","username="..username.."&password="..password.."&uuid="..uuid,nil,"utf8",nil,function(code,body,cookie,header) local a=0 local tt=Ticker() tt.start() tt.onTick=function() a=a+1 if a==5 then dl.dismiss() tt.stop() if code == 200 then if body:match("Login success") then Toast.makeText(activity, "Login success.",Toast.LENGTH_SHORT).show() Main() elseif body:match("Username not registered") then Toast.makeText(activity, "Username not registered.",Toast.LENGTH_SHORT).show() elseif body:match("Password invalid") then Toast.makeText(activity, "Password invalid.",Toast.LENGTH_SHORT).show() elseif body:match("UUID invalid") then Toast.makeText(activity, "UUID not registered.",Toast.LENGTH_SHORT).show() end else Toast.makeText(activity, "Can't connect to server.",Toast.LENGTH_SHORT).show() end end end end); end end end LoginLY()