//Country private void EdtCountryOnClick(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } string[] countriesArray = Resources.GetStringArray(Resource.Array.countriesArray); var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); var arrayAdapter = countriesArray.ToList(); dialogList.Title(GetText(Resource.String.Lbl_Location)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
private void MAdapterOnItemLongClick(object sender, ContactsAdapterClickEventArgs e) { try { var position = e.Position; if (position >= 0) { var item = MAdapter.GetItem(position); if (item == null) { return; } if (item.Avatar == "addImage") { return; } Position = e.Position; var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Title(GetString(Resource.String.Lbl_Remove) + " " + WoWonderTools.GetNameFinal(item)); dialog.PositiveText(GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.Build().Show(); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
private void EdtToHeightOnClick(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } TypeDialog = "ToHeight"; //string[] heightArray = Application.Context.Resources.GetStringArray(Resource.Array.HeightArray); var heightArray = ListUtils.SettingsSiteList.FirstOrDefault()?.Height; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); if (heightArray != null) { arrayAdapter.AddRange(heightArray.Select(item => Methods.FunString.DecodeString(item.Values.FirstOrDefault()))); } dialogList.Title(GetText(Resource.String.Lbl_ToHeight)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
//Event Menu >> Delete Comment private void DeleteCommentEvent(CommentsArticlesObject item) { try { if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); return; } TypeDialog = "DeleteComment"; CommentObject = item; var dialog = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); dialog.Title(MainContext.GetText(Resource.String.Lbl_DeleteComment)).TitleColorRes(Resource.Color.primary); dialog.Content(MainContext.GetText(Resource.String.Lbl_AreYouSureDeleteComment)); dialog.PositiveText(MainContext.GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(MainContext.GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.ItemsCallback(this).Build().Show(); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
//delete group chat private void BtnDeleteGroupOnClick(object sender, EventArgs e) { try { if (!Methods.CheckConnectivity()) { Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short) .Show(); } else { Type = "Delete"; var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Content(GetText(Resource.String.Lbl_AreYouSureDeleteGroup)); dialog.PositiveText(GetText(Resource.String.Lbl_DeleteGroup)).OnPositive(this); dialog.NegativeText(GetText(Resource.String.Lbl_Cancel)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.Build().Show(); } } catch (Exception exception) { Console.WriteLine(exception); } }
//DeleteSong private void OnMenuDeleteSongOnClick(MoreSongClickEventArgs song) { try { if (!UserDetails.IsLogin) { PopupDialogController dialog = new PopupDialogController(GlobalContext, null, "Login"); dialog.ShowNormalDialog(GlobalContext.GetText(Resource.String.Lbl_Login), GlobalContext.GetText(Resource.String.Lbl_Message_Sorry_signin), GlobalContext.GetText(Resource.String.Lbl_Yes), GlobalContext.GetText(Resource.String.Lbl_No)); return; } if (Methods.CheckConnectivity()) { TypeDialog = "DeleteSong"; MoreSongArgs = song; var dialog = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); dialog.Title(MainContext.GetText(Resource.String.Lbl_DeleteSong)); dialog.Content(MainContext.GetText(Resource.String.Lbl_AreYouSureDeleteSong)); dialog.PositiveText(MainContext.GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(MainContext.GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.ItemsCallback(this).Build().Show(); } else { Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } } catch (Exception e) { Console.WriteLine(e); } }
//AllowDownloads private void AllowDownloadsEditTextOnTouch(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } TypeDialog = "AllowDownloads"; var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); var arrayAdapter = new List <string> { GetString(Resource.String.Lbl_Yes), GetString(Resource.String.Lbl_No), }; dialogList.Title(GetText(Resource.String.Lbl_AllowDownloads)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
//Contact User private void BtnContactOnClick(object sender, EventArgs e) { try { if (AppSettings.MessengerIntegration) { var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Title(Resource.String.Lbl_Warning); dialog.Content(GetText(Resource.String.Lbl_ContentAskOPenAppMessenger)); dialog.PositiveText(GetText(Resource.String.Lbl_Yes)).OnPositive((materialDialog, action) => { try { Methods.App.OpenAppByPackageName(this, AppSettings.MessengerPackageName, "OpenChat", new ChatObject() { UserId = DataObject.UserData.UserId, Name = DataObject.UserData.Name, Avatar = DataObject.UserData.Avatar }); } catch (Exception exception) { Console.WriteLine(exception); } }); dialog.NegativeText(GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.Build().Show(); } } catch (Exception exception) { Console.WriteLine(exception); } }
private void MessageCallButton_Click(object sender, EventArgs e) { try { if (Methods.CheckConnectivity()) { var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); arrayAdapter.Add(GetString(Resource.String.Lbl_MessageCall1)); arrayAdapter.Add(GetString(Resource.String.Lbl_MessageCall2)); arrayAdapter.Add(GetString(Resource.String.Lbl_MessageCall3)); arrayAdapter.Add(GetString(Resource.String.Lbl_MessageCall4)); arrayAdapter.Add(GetString(Resource.String.Lbl_MessageCall5)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnNegative(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } else { Toast.MakeText(this, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
//Event Menu >> Edit Comment private void EditCommentEvent(CommentObjectExtra item) { try { if (Methods.CheckConnectivity()) { TypeDialog = "EditComment"; CommentObject = item; var dialog = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); dialog.Title(Resource.String.Lbl_Edit); dialog.Input(MainContext.GetString(Resource.String.Lbl_Write_comment), Methods.FunString.DecodeString(item.Text), this); dialog.InputType(InputTypes.TextFlagImeMultiLine); dialog.PositiveText(MainContext.GetText(Resource.String.Lbl_Update)).OnPositive(this); dialog.NegativeText(MainContext.GetText(Resource.String.Lbl_Cancel)).OnNegative(this); dialog.Build().Show(); dialog.AlwaysCallSingleChoiceCallback(); } else { Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } } catch (Exception e) { Console.WriteLine(e); } }
//Event Menu >> Delete Comment private void DeleteCommentEvent(CommentObjectExtra item) { try { if (Methods.CheckConnectivity()) { TypeDialog = "DeleteComment"; CommentObject = item; var dialog = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); dialog.Title(MainContext.GetText(Resource.String.Lbl_DeleteComment)); dialog.Content(MainContext.GetText(Resource.String.Lbl_AreYouSureDeleteComment)); dialog.PositiveText(MainContext.GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(MainContext.GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.ItemsCallback(this).Build().Show(); } else { Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } } catch (Exception e) { Console.WriteLine(e); } }
public void ShowNormalDialog(string title, string content = null, string positiveText = null, string negativeText = null) { try { MaterialDialog.Builder DialogList = new MaterialDialog.Builder(ActivityContext); if (!string.IsNullOrEmpty(title)) { DialogList.Title(title); } if (!string.IsNullOrEmpty(content)) { DialogList.Content(content); } if (!string.IsNullOrEmpty(negativeText)) { DialogList.NegativeText(negativeText); DialogList.OnNegative(this); } if (!string.IsNullOrEmpty(positiveText)) { DialogList.PositiveText(positiveText); DialogList.OnPositive(this); } DialogList.Build().Show(); } catch (Exception exception) { Crashes.TrackError(exception); } }
//More Swipe Item private void MAdapterOnMoreItemClick(object sender, Holders.LastMessagesClickEventArgs e) { try { var position = e.Position; if (position >= 0) { var item = MAdapter.GetItem(position); if (item != null) { DataUserChat = item; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); arrayAdapter.Add(Context.GetText(Resource.String.Lbl_View_Profile)); arrayAdapter.Add(Context.GetText(Resource.String.Lbl_Block)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } } } catch (Exception exception) { Console.WriteLine(exception); } }
private void MAdapterOnItemClick(object sender, SocialLinksAdapterClickEventArgs e) { try { var item = MAdapter.GetItem(e.Position); if (item != null) { SocialItem = item; var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Title(item.SocialName); dialog.Input(Resource.String.Lbl_Enter_your_link, 0, false, this); dialog.InputType(InputTypes.TextFlagImeMultiLine); dialog.PositiveText(GetText(Resource.String.Lbl_Save)).OnPositive(this); dialog.NegativeText(GetText(Resource.String.Lbl_Cancel)).OnNegative(this); dialog.Build().Show(); dialog.AlwaysCallSingleChoiceCallback(); } } catch (Exception exception) { Console.WriteLine(exception); } }
private void GenderEditTextOnTouch(object sender, View.TouchEventArgs e) { Console.WriteLine("clicked on gender"); try { if (e.Event.Action != MotionEventActions.Down) { return; } var genderArray = ListUtils.SettingsSiteList.FirstOrDefault()?.Gender; if (genderArray?.Count > 0) { var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); var arrayAdapter = genderArray.Select(item => Methods.FunString.DecodeString(item.Values.FirstOrDefault())).ToList(); dialogList.Title(GetText(Resource.String.Lbl_Gender)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } else { Methods.DisplayReportResult(this, "List Gender Not Found, Please check api option "); } } catch (Exception exception) { Console.WriteLine(exception); } }
public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString) { try { string text = itemString.ToString(); if (!Methods.CheckConnectivity()) { Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } else { if (text == GetString(Resource.String.Lbl_MessageCall5)) { var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Input(Resource.String.Lbl_Write_your_message, 0, false, this); dialog.InputType(InputTypes.TextFlagImeMultiLine); dialog.PositiveText(GetText(Resource.String.Btn_Send)).OnPositive(this); dialog.NegativeText(GetText(Resource.String.Lbl_Cancel)).OnNegative(this); dialog.Build().Show(); dialog.AlwaysCallSingleChoiceCallback(); } else { SendMess(text); } } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
//Event Show More : DeleteSong , EditSong , GoSong , Copy Link , Report .. public void OnMoreClick(MoreSongClickEventArgs args, string namePage = "") { try { NamePage = namePage; MoreSongArgs = args; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); if (MoreSongArgs.SongsClass.UserId == UserDetails.UserId && UserDetails.IsLogin) { arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_DeleteSong)); arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_EditSong)); } if (UserDetails.IsLogin) { arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_ReportSong)); //arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_ReportCopyright)); } arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_Copy)); dialogList.Title(MainContext.GetText(Resource.String.Lbl_Songs)); dialogList.Items(arrayAdapter); dialogList.PositiveText(MainContext.GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
//ShareToGroup private void ShareGroupLayoutOnClick(object sender, EventArgs e) { try { if (Methods.CheckConnectivity()) { TypeDialog = "ShareToGroup"; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); if (ListUtils.MyGroupList?.Count > 0) { arrayAdapter.AddRange(ListUtils.MyGroupList.Select(item => item.GroupName)); } dialogList.Title(Context.GetString(Resource.String.Lbl_ShareToGroup)); dialogList.Items(arrayAdapter); dialogList.PositiveText(Context.GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.NeutralText(Context.GetText(Resource.String.Lbl_Create)).OnNeutral(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } else { Toast.MakeText(Context, Context.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString) { try { string text = itemString.ToString(); if (text == ActivityContext.GetText(Resource.String.Lbl_Edit)) { //Open Edit Job var intent = new Intent(ActivityContext, typeof(EditJobsActivity)); intent.PutExtra("JobsObject", JsonConvert.SerializeObject(DataInfoObject)); ActivityContext.StartActivityForResult(intent, 246); } else if (text == ActivityContext.GetText(Resource.String.Lbl_Delete)) { DialogType = "Delete"; var dialog = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); dialog.Title(Resource.String.Lbl_Warning); dialog.Content(ActivityContext.GetText(Resource.String.Lbl_DeleteJobs)); dialog.PositiveText(ActivityContext.GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(ActivityContext.GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.ItemsCallback(this).Build().Show(); } } catch (Exception e) { Console.WriteLine(e); } }
private void ShareTimelineLayoutOnClick(object sender, EventArgs e) { try { if (Methods.CheckConnectivity()) { TypeDialog = "ShareToMyTimeline"; var dialog = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Title(Resource.String.Lbl_Share); dialog.Content(Context.GetText(Resource.String.Lbl_ShareToMyTimeline)); dialog.PositiveText(Context.GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(Context.GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.ItemsCallback(this).Build().Show(); } else { Toast.MakeText(Context, Context.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
public void MoreCommentReplyPostClick(CommentReplyArticlesClickEventArgs e) { try { if (Methods.CheckConnectivity()) { TypeDialog = "MoreComment"; CommentObject = e.CommentObject; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); arrayAdapter.Add(MainContext.GetString(Resource.String.Lbl_CopeText)); if (CommentObject?.IsOwner != null && (bool)CommentObject?.IsOwner || CommentObject?.UserData?.UserId == UserDetails.UserId) { arrayAdapter.Add(MainContext.GetString(Resource.String.Lbl_Delete)); } dialogList.Title(MainContext.GetString(Resource.String.Lbl_More)).TitleColorRes(Resource.Color.primary); dialogList.Items(arrayAdapter); dialogList.PositiveText(MainContext.GetText(Resource.String.Lbl_Close)).OnNegative(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } else { Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
private void GenderIcon_Click(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } List <string> arrayAdapter = new List <string>(); MaterialDialog.Builder dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); arrayAdapter.Add(GetText(Resource.String.Radio_Male)); arrayAdapter.Add(GetText(Resource.String.Radio_Female)); dialogList.Title(GetText(Resource.String.Lbl_Gender)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Cancel)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
//Location private void LocationLayoutOnClick(object sender, EventArgs e) { try { //string[] countriesArray = Context.Resources.GetStringArray(Resource.Array.countriesArray); var countriesArray = ListUtils.SettingsSiteList.FirstOrDefault()?.Countries; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); if (countriesArray != null) { arrayAdapter.AddRange(countriesArray.Select(item => Methods.FunString.DecodeString(item.Values.FirstOrDefault()?.Name))); } dialogList.Title(GetText(Resource.String.Lbl_Location)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
private void MoreButtonOnClick(object sender, EventArgs e) { try { var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); if (MesData.Position == "right") { arrayAdapter.Add(GetText(Resource.String.Lbl_MessageInfo)); } arrayAdapter.Add(GetText(Resource.String.Lbl_Forward)); arrayAdapter.Add(GetText(Resource.String.Lbl_Share)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(new WoWonderTools.MyMaterialDialog()); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
public void ShowNormalDialog(string title, string content = null, string positiveText = null, string negativeText = null) { try { MaterialDialog.Builder dialogList = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); if (!string.IsNullOrEmpty(title)) { dialogList.Title(title); } if (!string.IsNullOrEmpty(content)) { dialogList.Content(content); } if (!string.IsNullOrEmpty(negativeText)) { dialogList.NegativeText(negativeText); dialogList.OnNegative(this); } if (!string.IsNullOrEmpty(positiveText)) { dialogList.PositiveText(positiveText); dialogList.OnPositive(this); } dialogList.Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
private void EdtGenderOnTouch(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } TypeDialog = "Gender"; var genderArray = ListUtils.SettingsSiteList.FirstOrDefault()?.Gender; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); if (genderArray != null) { arrayAdapter.AddRange(genderArray.Select(item => Methods.FunString.DecodeString(item.Values.FirstOrDefault()))); } dialogList.Title(GetText(Resource.String.Lbl_Gender)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
private void MAdapterOnItemClick(object sender, ManageSessionsAdapterClickEventArgs e) { try { if (!Methods.CheckConnectivity()) { Toast.MakeText(this, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long).Show(); return; } ItemSessionsDataObject = MAdapter.GetItem(e.Position); if (ItemSessionsDataObject != null) { var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Title(Resource.String.Lbl_Warning); dialog.Content(GetText(Resource.String.Lbl_AreYouSureLogoutFromThisDevice)); dialog.PositiveText(GetText(Resource.String.Lbl_Ok)).OnPositive(this); dialog.NegativeText(GetText(Resource.String.Lbl_Cancel)).OnNegative(this); dialog.AutoDismiss(true); dialog.AlwaysCallSingleChoiceCallback(); dialog.Build().Show(); } } catch (Exception exception) { Console.WriteLine(exception); } }
private void TxtGenderTextOnClick(object sender, EventArgs e) { try { var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); if (ListUtils.SettingsSiteList?.Genders.Count > 0) { arrayAdapter.AddRange(from item in ListUtils.SettingsSiteList?.Genders select item.Value); } else { arrayAdapter.Add(GetText(Resource.String.Radio_Male)); arrayAdapter.Add(GetText(Resource.String.Radio_Female)); } dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
//Price private void PriceEditTextOnClick(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } TypeDialog = "Price"; var dialogList = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); var arrayAdapter = ListUtils.PriceList.Select(item => CurrencySymbol + item.Price).ToList(); dialogList.Title(GetText(Resource.String.Lbl_Price)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }
private void TxtRelationshipOnTouch(object sender, View.TouchEventArgs e) { try { if (e.Event.Action != MotionEventActions.Down) { return; } string[] relationshipArray = Application.Context.Resources.GetStringArray(Resource.Array.RelationShipArray); var dialogList = new MaterialDialog.Builder(this); var arrayAdapter = relationshipArray.ToList(); dialogList.Title(GetText(Resource.String.Lbl_ChooseRelationshipStatus)); dialogList.Items(arrayAdapter); dialogList.PositiveText(GetText(Resource.String.Lbl_Close)).OnPositive(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }