Exemplo n.º 1
0
        public AlertDialog MessageBox(Context context, string title, string message, EventHandler <DialogClickEventArgs> ok = null)
        {
            ContextThemeWrapper   wrapper = new ContextThemeWrapper(context, GetDialogTheme());
            StorehouseSuperDialog dialog  = new StorehouseSuperDialog(wrapper);

            dialog.SetTitleTextColor(Color.White);
            dialog.SetTitleBackgroundColor(Android.Resource.Color.Transparent);
            dialog.SetIcon(Resource.Drawable.Icon);
            dialog.SetTitle(title);
            dialog.SetMessage(message);
            dialog.SetPositiveButton("Ok", ok);

            return(dialog.Show());
        }
Exemplo n.º 2
0
        public AlertDialog UserSyncDialog(Context context)
        {
            ContextThemeWrapper   wrapper = new ContextThemeWrapper(context, GetDialogTheme());
            StorehouseSuperDialog dialog  = new StorehouseSuperDialog(wrapper);

            LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);
            View           layout   = inflater.Inflate(Resource.Layout.DialogUserSyncView, null);
            TextView       username = layout.FindViewById <TextView>(Resource.Id.parseUserName);
            TextView       password = layout.FindViewById <TextView>(Resource.Id.parsePassword);

            dialog.SetTitleTextColor(Color.White);
            dialog.SetTitleBackgroundColor(Android.Resource.Color.Transparent);
            dialog.SetTitle("User Sync");
            dialog.SetMessageTextSize(22);

            if (ParseUser.CurrentUser != null)
            {
                dialog.SetView(null);
                dialog.SetNeutralButton("Log Out", (o, e) =>
                {
                    ParseUser.LogOut();
                });
            }
            else
            {
                dialog.SetView(layout);
            }

            dialog.SetPositiveButton("Sync Up", (o, e) =>
            {
                ParseUserSync(username.Text, password.Text, "up");
            });

            dialog.SetNegativeButton("Sync Down", (o, e) =>
            {
                ParseUserSync(username.Text, password.Text, "down");
            });

            return(dialog.Show());
        }