/// <summary> /// 前台弹窗,默认为popup配置参数 /// </summary> /// <param name="message">提示消息</param> /// <param name="iconType">提示类型</param> /// <param name="closePage">是否关闭</param> /// <param name="isParent">是否是父页面</param> /// <param name="callback">回调</param> /// <param name="isRefresh">是否刷新param> protected void ShowTipMessage(LayerIconType iconType, string message = "", bool closePage = true, bool isParent = true, string callback = "", bool isRefresh = true) { if (string.IsNullOrEmpty(message)) { switch (iconType) { case LayerIconType.Success: message = "保存成功"; break; case LayerIconType.Erro: message = "保存失败"; break; case LayerIconType.Question: break; case LayerIconType.Lock: break; case LayerIconType.Sad: break; case LayerIconType.Joy: break; case LayerIconType.Sigh: message = "参数验证无效"; break; default: break; } } TempData[Message] = WebAlert.ShowTipMessage(message, (int)iconType, closePage, isParent, callback, isRefresh); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.activity_login); username = FindViewById <EditText>(Resource.Id.login_username); password = FindViewById <EditText>(Resource.Id.login_password); loginButton = FindViewById <Button>(Resource.Id.login_loginbutton); linkPrivacy = FindViewById <TextView>(Resource.Id.link_privacy); loginButton.Click += async(o, ea) => { loginButton.Enabled = false; var login = await MainActivity.LastFM.LogIn(username.Text, password.Text); if (!login) { var t = Toast.MakeText(this, "Couldn't log in. Check your username and password.", ToastLength.Short); t.Show(); } else { await MainActivity.LastFM.Reload(this); this.Finish(); } loginButton.Enabled = true; }; linkPrivacy.Click += (o, e) => { var web = new WebAlert("Privacy Policy", "https://reyth3.github.io/apps/lfmsync/privacy.html", this); web.Show(); }; }
protected void ShowTipLoading(string message, bool closePage = true, bool isParent = true, string callback = "", bool isRefresh = true) { TempData[Message] = WebAlert.ShowTipLoading(message, closePage, isParent, callback, isRefresh); }