本文整理汇总了C#中Android.App.AlertDialog.Builder.SetView方法的典型用法代码示例。如果您正苦于以下问题:C# AlertDialog.Builder.SetView方法的具体用法?C# AlertDialog.Builder.SetView怎么用?C# AlertDialog.Builder.SetView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.App.AlertDialog.Builder
的用法示例。
在下文中一共展示了AlertDialog.Builder.SetView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showConfirmDialog
public void showConfirmDialog(string title, string content, string possitiveTitle, string negativeTitle){
var confirmDeferView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
var tvTitle = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
var tvConfirm = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_info_popup);
var btnConfirmTalknow = confirmDeferView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
var btnDecline = confirmDeferView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);
tvTitle.Text = title;
tvConfirm.Text = content;
btnDecline.Text = negativeTitle;
btnConfirmTalknow.Text = possitiveTitle;
btnConfirmTalknow.Click += (sender, e) => {
dialog.Dismiss ();
actionConfirmDelegate.onOkConfirmClick ();
};
btnDecline.Click += (sender, e) => {
dialog.Dismiss ();
};
builder = new AlertDialog.Builder (_activity);
builder.SetInverseBackgroundForced (true);
builder.SetView (confirmDeferView);
dialog = builder.Create ();
dialog.SetCanceledOnTouchOutside (false);
try {
dialog.Show ();
} catch(Exception e){
Console.WriteLine (e.Message);
}
}
示例2: showNoticeDialog
public void showNoticeDialog(string title, string content){
var noticeASAPTimeView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
var tvTitle = noticeASAPTimeView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
var tvNotice = noticeASAPTimeView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
var btnOk = noticeASAPTimeView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);
tvTitle.Text = title;
tvNotice.Text = content;
btnOk.Click += (sender, e) => {
dialog.Dismiss ();
if(noticeBeta != null){
noticeBeta.onOK();
}
};
builder = new AlertDialog.Builder (_activity);
builder.SetView (noticeASAPTimeView);
dialog = builder.Create ();
dialog.SetCanceledOnTouchOutside (false);
dialog.SetCancelable (false);
try {
dialog.Show ();
} catch(Exception e){
Console.WriteLine (e.Message);
}
}
示例3: OnCreateDialog
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Begin building a new dialog.
var builder = new AlertDialog.Builder(Activity);
//Get the layout inflater
var inflater = Activity.LayoutInflater;
populate (listData);
viewdlg = SetViewDelegate;
var view = inflater.Inflate(Resource.Layout.ListCustView, null);
listView = view.FindViewById<ListView> (Resource.Id.CustList);
if (listView != null) {
adapter = new GenericListAdapter<Trader> (this.Activity, listData,Resource.Layout.ListCustDtlView, viewdlg);
listView.Adapter = adapter;
listView.ItemClick += ListView_Click;
txtSearch= view.FindViewById<EditText > (Resource.Id.txtSearch);
butSearch= view.FindViewById<Button> (Resource.Id.butCustBack);
butSearch.Text = "SEARCH";
butSearch.SetCompoundDrawables (null, null, null, null);
butSearch.Click+= ButSearch_Click;
//txtSearch.TextChanged += TxtSearch_TextChanged;
builder.SetView (view);
builder.SetPositiveButton ("CANCEL", HandlePositiveButtonClick);
}
var dialog = builder.Create();
//Now return the constructed dialog to the calling activity
return dialog;
}
示例4: OnCreateDialog
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Build Password Dialog
var builder = new AlertDialog.Builder(Activity);
// Get Layout Inflater
var inflator = Activity.LayoutInflater;
// Inflate Layout For Password Dialog
var dialogView = inflator.Inflate(Resource.Layout.AddReminderDialogFragment, null);
// Initialize Properties
ReminderEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextReminder);
// Set Positive & Negative Buttons
builder.SetView(dialogView);
builder.SetPositiveButton("Add Reminder", HandlePositiveButtonClick);
builder.SetNegativeButton("Cancel", HandleNegativeButtonClick);
// Build And Return Dialog
var dialog = builder.Create();
return dialog;
}
示例5: AskForString
public void AskForString(string message, string title, System.Action<string> returnString)
{
var activity = Mvx.Resolve<IMvxAndroidCurrentTopActivity> ().Activity;
var builder = new AlertDialog.Builder(activity);
builder.SetIcon(Resource.Drawable.ic_launcher);
builder.SetTitle(title ?? string.Empty);
builder.SetMessage(message);
var view = View.Inflate(activity, Resource.Layout.dialog_add_member, null);
builder.SetView(view);
var textBoxName = view.FindViewById<EditText>(Resource.Id.name);
builder.SetCancelable(true);
builder.SetNegativeButton(Resource.String.cancel, delegate { });//do nothign on cancel
builder.SetPositiveButton(Resource.String.ok, delegate
{
if (string.IsNullOrWhiteSpace(textBoxName.Text))
return;
returnString(textBoxName.Text.Trim());
});
var alertDialog = builder.Create();
alertDialog.Show();
}
示例6: OnCreateDialog
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
var builder = new AlertDialog.Builder (Activity);
var inflater = Activity.LayoutInflater;
var view = inflater.Inflate (Resource.Layout.NewTournamentDialogLayout, null);
if (view != null) {
txtUrl = view.FindViewById<EditText> (Resource.Id.txtNewTournamentURL_Edit);
txtSignup = view.FindViewById<EditText> (Resource.Id.txtNewTournamentSignup_Edit);
txtSignup_Text = view.FindViewById<TextView> (Resource.Id.txtNewTournamentSignup);
btnView = view.FindViewById<Button> (Resource.Id.btnNewTournament_View);
txtUrl.Text = json ["tournament"] ["full_challonge_url"];
if (json ["tournament"] ["sign_up_url"] == null) {
txtSignup.Visibility = ViewStates.Gone;
txtSignup_Text.Visibility = ViewStates.Gone;
} else
txtSignup.Text = json ["tournament"] ["sign_up_url"];
btnView.Click += BtnView_Click;
builder.SetTitle (json ["tournament"] ["name"].ToString ());
builder.SetView (view);
}
var dialog = builder.Create ();
return dialog;
}
示例7: OnOptionsItemSelected
public override bool OnOptionsItemSelected(IMenuItem item)
{
switch (item.ItemId)
{
case Resource.Id.actionNew:
string default_game_name = "Game";
AlertDialog.Builder alert1 = new AlertDialog.Builder(this.Activity);
EditText input = new EditText(this.Activity);
input.Text = default_game_name;
alert1.SetTitle("Game Name");
alert1.SetView(input);
alert1.SetPositiveButton("OK", delegate { AddGame(input.Text); });
alert1.SetNegativeButton("Cancel", (s, e) => { });
alert1.Show();
_adapter.NotifyDataSetChanged();
return true;
case Resource.Id.actionRefresh:
GameData.Service.RefreshCache();
_adapter.NotifyDataSetChanged();
return true;
default:
return base.OnOptionsItemSelected(item);
}
}
示例8: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
button = FindViewById<Button> (Resource.Id.button);
button.Click += (o, e) => {
// use an array adapter to populate a spinner item from our string array
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
Android.Resource.Layout.SimpleSpinnerItem, villains);
// create the spinner and populate it with our items
Spinner spinner = new Spinner(this);
spinner.LayoutParameters = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
spinner.Adapter = adapter;
// handle item selection
spinner.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs> (ItemSelected);
// build the alert dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.SetView(spinner);
builder.SetNeutralButton("OK", delegate {});
builder.Show();
};
}
示例9: OnCreateDialog
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder dialog = new AlertDialog.Builder(Activity)
.SetTitle(title)
.SetPositiveButton("Got it", (sender, args) => { });
LayoutInflater inflater = Activity.LayoutInflater;
View view = inflater.Inflate(Resource.Layout.VideoHelpPopup, null);
video = view.FindViewById<VideoView>(Resource.Id.helper_video);
descriptionView = view.FindViewById<TextView>(Resource.Id.helper_explanation);
descriptionView.SetText(description.ToCharArray(),0, description.Length);
if (!string.IsNullOrEmpty(videoAdd))
{
video.Prepared += VideoPrepared;
video.SetVideoURI(Uri.Parse(videoAdd));
video.Touch += VideoTouched;
video.SetZOrderOnTop(true); // Removes dimming
}
else
{
LinearLayout holder = view.FindViewById<LinearLayout>(Resource.Id.helper_videoHolder);
holder.Visibility = ViewStates.Gone;
}
dialog.SetView(view);
return dialog.Create();
}
示例10: OnCreateDialog
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Build Set Meals Dialog
var builder = new AlertDialog.Builder(Activity);
// Get Layout Inflater
var inflator = Activity.LayoutInflater;
// Inflate Layout For Password Dialog
var dialogView = inflator.Inflate(Resource.Layout.SetMealsDialogFragment, null);
// Initialize Properties
breakfastEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextBreakfast);
lunchEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextLunch);
dinnerEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextDinner);
// Set Text To Current Meal Values
breakfastEditText.Text = MealItem.Breakfast;
lunchEditText.Text = MealItem.Lunch;
dinnerEditText.Text = MealItem.Dinner;
// Set Positive & Negative Buttons
builder.SetView(dialogView);
builder.SetPositiveButton("Set Meals", HandlePositiveButtonClick);
// builder.SetNeutralButton("Clear Meals", HandleNeutralButtonClick);
builder.SetNegativeButton("Cancel", HandleNegativeButtonClick);
// Build And Return Dialog
var dialog = builder.Create();
return dialog;
}
示例11: Display
public void Display (string body, string title, GoalsAvailable availableGoal, string cancelButtonTitle, string acceptButtonTitle = "", Action<GoalsAvailable, int> action = null)
{
EditText goalTextBox = new EditText (Forms.Context);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder (Forms.Context);
alertDialogBuilder.SetTitle (title);
alertDialogBuilder.SetMessage (body);
alertDialogBuilder.SetView (goalTextBox);
goalTextBox.InputType = Android.Text.InputTypes.NumberFlagSigned;
var inputFilter = new Android.Text.InputFilterLengthFilter (7);
var filters = new Android.Text.IInputFilter[1];
filters [0] = inputFilter;
goalTextBox.SetFilters (filters);
goalTextBox.InputType = Android.Text.InputTypes.ClassNumber;
alertDialogBuilder.SetPositiveButton ("OK", (senderAlert, args) => {
if(action != null)
{
int goalValue;
int.TryParse(goalTextBox.Text, out goalValue);
action.Invoke(availableGoal, goalValue);
}
} );
alertDialogBuilder.SetNeutralButton ("CANCEL", (senderAlert, args) => {
} );
alertDialogBuilder.Show ();
}
示例12: OnCreateDialog
public override Dialog OnCreateDialog(Bundle bundle)
{
base.OnCreateDialog (bundle);
catalogs = new CheckinShared.CatalogDB ();
LayoutInflater inflater = Activity.LayoutInflater;
View view = inflater.Inflate (Resource.Layout.AddCatalog, null);
EditText textName = view.FindViewById<EditText> (Resource.Id.txtAgregarCatalogo);
AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
builder.SetTitle ("Crear catálogo");
builder.SetView (view);
builder.SetPositiveButton ("Crear", delegate (object sender, DialogClickEventArgs e) {
Catalog catalog = new Catalog ();
if (textName.Text.Length != 0)
{
catalog.Name = textName.Text;
catalog.Quantity = 0;
catalog.UserId = AppHelper.GetCurrentUser(Activity).Id;
catalogs.Insert(catalog);
catalog.SaveToParse();
Console.WriteLine("ParentFragment: " + ParentFragment);
((CatalogsFragment) ((MainActivity) Activity).CurrentFragment()).AddCatalog(catalog);
}
});
builder.SetNegativeButton ("Salir", delegate (object sender, DialogClickEventArgs e) { });
return builder.Create ();
}
示例13: showEmailDialog
public void showEmailDialog(Guid specId){
var enterEmailView = LayoutInflater.Inflate (Resource.Layout.popup_enter_email, null);
var edEnterEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_enter_email);
var edMyEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_my_email);
var edMessEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_enter_message);
var btnSend = enterEmailView.FindViewById<Button> (Resource.Id.btnSendEmail);
var btnCancel = enterEmailView.FindViewById<Button> (Resource.Id.btnCancelSendEmail);
builder = new AlertDialog.Builder (_activity);
builder.SetInverseBackgroundForced (true);
builder.SetView (enterEmailView);
dialogEquiry = builder.Create ();
dialogEquiry.SetCanceledOnTouchOutside(false);
btnSend.Enabled = false;
edMyEmail.Text = MApplication.getInstance ().sEmailAddress;
edEnterEmail.TextChanged += (sender, e) => {
if(edEnterEmail.Text.Count() > 0) {
btnSend.Enabled = true;
} else {
btnSend.Enabled = false;
}
};
btnSend.Click += (sender, e) => {
if(edMyEmail.Text.Trim().Count() > 0) {
if(Utils.checkValidateEmail(edMyEmail.Text.Trim())){
if (edEnterEmail.Text.Trim().Count() <= 0) {
btnSend.Enabled = false;
showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.require_email_profile));
} else {
emails.Clear();
emailsInvalid.Clear();
Utils.getEmailsProfileFromString(edEnterEmail.Text.ToString(), emails, emailsInvalid);
if(emailsInvalid.Count > 0) {
showNoticeEmail(_activity.GetString(Resource.String.invalid_email_title), getEmailInvalidFromList(emailsInvalid));
} else {
dialogEquiry.Dismiss();
actionDelegate.onSending();
sendEmailProfileRequest(specId, edMyEmail.Text.Trim(), edMessEmail.Text.Trim());
}
}
} else{
showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.invalid_email_reset));
}
} else {
showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.email_sender_require));
}
};
btnCancel.Click += (sender, e) => {
dialogEquiry.Dismiss();
};
dialogEquiry.Show ();
}
示例14: OnCreateDialog
//public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
//{
// _view = inflater.Inflate(Resource.Layout.SyncManualConnect, container, false);
// return _view;
//}
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(Activity, Resource.Style.DialogTheme));
LayoutInflater inflater = Activity.LayoutInflater;
builder.SetView(inflater.Inflate(Resource.Layout.SyncManualConnect, null));
builder.SetTitle("Connect manually to device");
builder.SetPositiveButton("Connect", PositiveButtonHandler);
builder.SetNegativeButton("Cancel", NegativeButtonHandler);
return builder.Create();
}
示例15: OnCreateDialog
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
var b = new AlertDialog.Builder(this.Activity)
//.setIcon(R.drawable.alert_dialog_icon)
.SetTitle("new title")
.SetNegativeButton("Cancel", (s,e) => {});
b.SetView(this.GetTheView());
return b.Create();
}