//Event More >> Show Menu (CopeLink , Share) private void ImageMoreOnClick(object sender, EventArgs eventArgs) { try { var ctw = new ContextThemeWrapper(this, Resource.Style.PopupMenuStyle); var popup = new PopupMenu(ctw, ImageMore); popup.MenuInflater.Inflate(Resource.Menu.MoreCommunities_NotEdit_Menu, popup.Menu); popup.Show(); popup.MenuItemClick += (o, e) => { try { var Id = e.Item.ItemId; switch (Id) { case Resource.Id.menu_CopeLink: OnCopyLink_Button_Click(); break; case Resource.Id.menu_Share: OnShare_Button_Click(); break; } } catch (Exception exception) { Crashes.TrackError(exception); } }; } catch (Exception e) { Crashes.TrackError(e); } }
/// <summary> /// Called to have the fragment instantiate its user interface view. /// </summary> /// <param name="inflater">The <see cref="LayoutInflater"/> object that can be used to inflate any views in the fragment.</param> /// <param name="container"> /// If non-null, this is the parent view that the fragment's UI should be attached to. /// The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view. /// </param> /// <param name="savedInstanceState"> /// If non-null, this fragment is being re-constructed from a previous saved state as given here. /// </param> /// <returns> /// The created view. /// </returns> public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Context contextThemeWrapper = new ContextThemeWrapper(_mainActivity, Resource.Style.HistoryDialogTheme); LayoutInflater localInflater = inflater.CloneInContext(contextThemeWrapper); return(base.OnCreateView(localInflater, container, savedInstanceState)); }
//Menu Create Stories >> Image , Video private void CreateStories_OnClick(object sender, EventArgs eventArgs) { try { var ctw = new ContextThemeWrapper(this, Resource.Style.PopupMenuStyle); var popup = new PopupMenu(ctw, Btn_story); popup.MenuInflater.Inflate(Resource.Menu.CreateStories_Menu, popup.Menu); popup.Show(); popup.MenuItemClick += (o, e) => { try { var Id = e.Item.ItemId; switch (Id) { case Resource.Id.menu_Image: OnImage_Button_Click(); break; case Resource.Id.menu_Video: OnVideo_Button_Click(); break; } } catch (Exception exception) { Crashes.TrackError(exception); } }; } catch (Exception e) { Crashes.TrackError(e); } }
//Menu More >> private void MoreButton_OnClick(object sender, EventArgs eventArgs) { try { ContextThemeWrapper ctw = new ContextThemeWrapper(ActivityContext, Resource.Style.PopupMenuStyle); PopupMenu popup = new PopupMenu(ctw, More_Button); popup.MenuInflater.Inflate(Resource.Menu.MoreCommunities_NotEdit_Menu, popup.Menu); popup.Show(); popup.MenuItemClick += (o, popup_eventArgs) => { try { var Id = popup_eventArgs.Item.ItemId; switch (Id) { case Resource.Id.menu_CopeLink: OnMenu_CopeLink_Click(Videodata); break; case Resource.Id.menu_Share: OnMenu_ShareIcon_Click(Videodata); break; } } catch (Exception exception) { Crashes.TrackError(exception); } }; } catch (Exception exception) { Crashes.TrackError(exception); } }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); menuRed = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_red); fab1 = view.FindViewById <FloatingActionButton> (Resource.Id.fab1); fab2 = view.FindViewById <FloatingActionButton> (Resource.Id.fab2); fab3 = view.FindViewById <FloatingActionButton> (Resource.Id.fab3); statusView = view.FindViewById <TextView>(Resource.Id.statusView); dataView = view.FindViewById <TextView>(Resource.Id.DataView); ContextThemeWrapper context = new ContextThemeWrapper(this.Activity, Resource.Style.MenuButtonsStyle); FloatingActionButton programFab2 = new FloatingActionButton(context); EMDKResults results = EMDKManager.GetEMDKManager(Application.Context, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { statusView.Text = "Status: EMDKManager object creation failed ..."; } else { statusView.Text = "Status: EMDKManager object creation succeeded ..."; } programFab2.LabelText = "Programmatically added button"; programFab2.SetImageResource(Resource.Drawable.ic_edit); fab1.Enabled = false; menuRed.SetOnMenuButtonClickListener(this); menuRed.SetClosedOnTouchOutside(true); menuRed.HideMenuButton(false); ; }
public void OptionsDialogShow(string title, string delete, string edit) { Application.SynchronizationContext.Post(_ => { Context wrapper = new ContextThemeWrapper(Context, Resource.Style.PostPopupMenu); PopupMenu menu = new PopupMenu(wrapper, _holder.OptionsImageButton); menu.MenuInflater.Inflate(Resource.Menu.postHeader_popupMenu, menu.Menu); menu.Menu.Add(Menu.None, 1, Menu.First, edit); menu.Menu.Add(Menu.None, 2, Menu.None, delete); menu.Show(); menu.MenuItemClick += (sender, args) => { if (args.Item.ItemId == 1) { Presenter.EditClick(); } if (args.Item.ItemId == 2) { Presenter.DeleteClick(); } }; }, null); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (this.Context == null) { throw new Exception("this.Context == null"); } themeWrapper = new ContextThemeWrapper(this.Context, R.Style.ConnTextView); var view = inflater.CloneInContext(themeWrapper).Inflate(R.Layout.connections, container, false); connParent = view.FindViewById <LinearLayout>(R.Id.connparent); textView = new TextView(themeWrapper); connParent.AddView(textView); if (AppConfig.Current.GetBool(AppConfig.tip_cxn, true)) { MainActivity.MakeSnackbar(R.String.long_press_cxn_to_stop, Android.Support.Design.Widget.Snackbar.LengthLong) .SetAction(R.String.got_it, v => { AppConfig.Current.Set(AppConfig.tip_cxn, false); }) .Show(); } sorting = AppConfig.Current.GetBool(AppConfig.conn_sort_by_speed, sorting); moreInfo = AppConfig.Current.GetBool(AppConfig.conn_more_info, moreInfo); return(view); }
private void ShowPopUpMenu(object sender, EventArgs e) { Context popup = new ContextThemeWrapper(this, Resource.Style.UsersPopupMenu); PopupMenu menu = new PopupMenu(popup, _dottedMenuButton); menu.Inflate(Resource.Menu.UsersDottedMenu); menu.MenuItemClick += (s1, arg1) => { switch (arg1.Item.ItemId) { case Resource.Id.RemoveUser: AlertDialog.Builder memberDeleteAlert = new AlertDialog.Builder(this); memberDeleteAlert.SetTitle("Remove Member"); memberDeleteAlert.SetMessage("Would you like to remove '" + _user.Name.FirstName + "' from your plan?"); memberDeleteAlert.SetPositiveButton("Yes", (deleteSender, deleteEventArgs) => { DeleteGroupMember(); }); memberDeleteAlert.SetNegativeButton("No", (deleteSender, deleteEventArgs) => { }); Dialog deleteDialog = memberDeleteAlert.Create(); deleteDialog.Show(); break; case Resource.Id.GenerateQR: Intent loadQRCode = new Intent(this, typeof(QRCodeView)); loadQRCode.PutExtra("username", _user.UID); loadQRCode.PutExtra("password", "1"); loadQRCode.PutExtra("firstname", _user.Name.FirstName); StartActivity(loadQRCode); break; } }; menu.Show(); }
public Dialog FontSizeDialog(Activity activity) { ContextThemeWrapper context = new ContextThemeWrapper(activity, App.FUNCTIONS.GetDialogTheme()); AlertDialog.Builder dialog = new AlertDialog.Builder(context); SeekBar seek = new SeekBar(activity); seek.Max = 10; seek.Progress = App.STATE.SeekBarTextSize; seek.SetOnSeekBarChangeListener(new SeekBarListener(this)); int size = App.FUNCTIONS.GetWebViewTextSize(App.STATE.SeekBarTextSize); dialog.SetIcon(Resource.Drawable.Icon); dialog.SetMessage("Adjust article text size:"); dialog.SetTitle("Text Size"); dialog.SetNeutralButton("Close", (o, args) => { // Close dialog }); dialog.SetView(seek); return(dialog.Create()); }
private LayoutInflater GetLayoutInflater(Context context, int resourceTheme) { var contextWrapper = new ContextThemeWrapper(context, resourceTheme); var inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); return(inflater.CloneInContext(contextWrapper)); }
/// <summary> /// Метод, предназначенный для подключения трех основых страниц к приложению. /// </summary> private void CreatePages() { LinearLayout General = FindViewById <LinearLayout>(Resource.Id.General); // Находим страничку с картой. mapPage = General.FindViewById <LinearLayout>(Resource.Id.Map); General.RemoveView(mapPage); ContextThemeWrapper wrapper = new ContextThemeWrapper(this, Resource.Style.AppTheme); LayoutInflater inflater = (LayoutInflater)wrapper.GetSystemService(LayoutInflaterService); // Страничка с поиском. searchPage = inflater.Inflate(Resource.Layout.PageSearch, null) as LinearLayout; // Страничка с настройками. settingsPage = inflater.Inflate(Resource.Layout.PageSetting, null) as LinearLayout; // Привязка страничек к кнопкам переключения. viewPager = FindViewById <ViewPager>(Resource.Id.viewPager1); TabLayout tab = FindViewById <TabLayout>(Resource.Id.sliding_tabs); // Установка основных вкладок для приложения. viewPager.Adapter = new MyPagerAdapter(this, searchPage, mapPage, settingsPage); // Установка главной страницы для приложения. viewPager.CurrentItem = 1; // Привязка заголовков к страницам. tab.SetupWithViewPager(viewPager); // Установка изображений и текста, для отдельных "табов". for (int i = 0; i < iconsForTabs.Length; i++) { tab.GetTabAt(i).SetText(textForTabs[i]); Drawable icon = new BitmapDrawable(bitmapFromVector(ApplicationContext, iconsForTabs[i], 1)); tab.GetTabAt(i).SetIcon(icon); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (this.Context == null) { throw new Exception("this.Context == null"); } themeWrapper = new ContextThemeWrapper(this.Context, R.Style.ConnTextView); var View = inflater.Inflate(R.Layout.logs, container, false); recycler = View.FindViewById <RecyclerView>(R.Id.logparent); recycler.SetPadding(0, DpInt(4), 0, DpInt(4)); linearlayout = new LinearLayoutManager(this.Context) { StackFromEnd = true }; recycler.SetLayoutManager(linearlayout); recycler.SetItemAnimator(null); recycler.AddOnScrollListener(new ScrollListenr(this)); dataset = new MyData() { Context = themeWrapper }; recycler.SetAdapter(dataset); ReadConfig(); dataset.DynamicMargin = dynamicMargin; return(View); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var theme = category.Theme; var context = new ContextThemeWrapper(Activity, theme.StyleId); var themedInflater = LayoutInflater.From(context); return(themedInflater.Inflate(Resource.Layout.fragment_tasks, container, false)); }
public static void UpdateConfig(ContextThemeWrapper wrapper) { if (currentLocale != null) { using Configuration configuration = new Configuration { Locale = currentLocale }; wrapper?.ApplyOverrideConfiguration(configuration); } }
private Context GetContext() { if (mThemeWrapper != null) { return(mThemeWrapper); } mThemeWrapper = new ContextThemeWrapper(AppUtils.GetAppContext.ApplicationContext, Resource.Style.Theme_AppCompat_Light); return(mThemeWrapper); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var contextThemeWrapper = new ContextThemeWrapper(Activity, Resource.Style.TogglDialog); var wrappedInflater = inflater.CloneInContext(contextThemeWrapper); var view = wrappedInflater.Inflate(Resource.Layout.UpcomingEventsNotificationSettingsFragment, container, false); InitializeViews(view); return(view); }
protected override void OnElementChanged(ElementChangedEventArgs <CarouselPage> e) { base.OnElementChanged(e); if (viewPager != null) { if (viewPager.Adapter != null) { viewPager.Adapter.Dispose(); viewPager.Adapter = null; } RemoveView(viewPager); viewPager.SetOnPageChangeListener(null); viewPager.Dispose(); } if (indicator != null) { RemoveView(indicator); indicator.SetOnPageChangeListener(null); indicator.Dispose(); } if (linearLayout != null) { RemoveView(linearLayout); linearLayout.Dispose(); } RemoveAllViews(); linearLayout = new LinearLayout(Forms.Context); linearLayout.SetGravity(GravityFlags.Center); linearLayout.Orientation = Orientation.Vertical; linearLayout.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); linearLayout.Focusable = true; linearLayout.Clickable = true; AddView(linearLayout); viewPager = new ViewPager(Context) { OffscreenPageLimit = int.MaxValue }; //the following is needed to draw indicator based on the exisitng theme. var contextThemeWrapper = new ContextThemeWrapper(Context, Resource.Style.Theme_PageIndicatorDefaults); indicator = new TabCarouselPageIndicator(contextThemeWrapper, Element); linearLayout.AddView(indicator, new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent)); linearLayout.AddView(viewPager, new LinearLayout.LayoutParams(LayoutParams.MatchParent, 0, 1.0f)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Context contextThemeWrapper = new ContextThemeWrapper(Activity, Resource.Style.None); // clone the inflater using the ContextThemeWrapper LayoutInflater localInflater = inflater.CloneInContext(contextThemeWrapper); // inflate the layout using the cloned inflater, not default inflater var view = localInflater.Inflate(Resource.Layout.SplashscreenLayout, container, false); return(view); }
public static void SetFocus(this View view) { view.RequestFocus(); ContextThemeWrapper ctw = view.Context as ContextThemeWrapper; var activity = ctw.BaseContext as Activity; activity?.Window.SetSoftInputMode(SoftInput.StateVisible); var service = (InputMethodManager)view.Context.GetSystemService(Context.InputMethodService); service.ShowSoftInput(view, ShowFlags.Forced); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var contextThemeWrapper = new ContextThemeWrapper(Activity, Resource.Style.TogglDialog); var wrappedInflater = inflater.CloneInContext(contextThemeWrapper); var view = wrappedInflater.Inflate(Resource.Layout.SelectUserCalendarsFragment, container, false); InitializeViews(view); return(view); }
protected virtual AlertDialog.Builder CreateAlertDialogBuilder( Context context, int?themeResourceId) { if (themeResourceId.HasValue && Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) { ContextThemeWrapper themedContext = new ContextThemeWrapper(context, themeResourceId.Value); return(new AlertDialog.Builder(themedContext)); } else { return(new AlertDialog.Builder(context)); } }
protected override void OnCreate(Android.OS.Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var mActionBar = ActionBar; mActionBar.SetDisplayHomeAsUpEnabled(true); mActionBar.SetDisplayShowCustomEnabled(true); mActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent))); mActionBar.SetDisplayShowTitleEnabled(false); LayoutInflater mInflater = LayoutInflater.From(this); View mCustomView = mInflater.Inflate(Resource.Layout.samplelist_layout, null); selectedGroup = (Group)MainActivity.SelectedIntent.GetSerializableExtra("sample"); SampleLayout sampleLayouts = new SampleLayout(MainActivity.context, selectedGroup.samples); mActionBar.CustomView = mCustomView; Sample selectedSample = (Sample)selectedGroup.samples[selectedIndex]; SetContentView(Resource.Layout.SamplePage); ImageView imageButton = (ImageView)mCustomView .FindViewById(Resource.Id.imageButton); Context wrapper = new ContextThemeWrapper(this, Android.Resource.Style.Theme); ListPopupWindow popupWindow = new ListPopupWindow(wrapper); popupWindow.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.listpopup)); imageButton.Click += (object sender, EventArgs e) => { popupWindow.Show(); }; popupWindow.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { Sample subSamples = (Sample)selectedGroup.samples[e.Position]; selectedIndex = e.Position; RefreshSample(subSamples); popupWindow.Dismiss(); }; RelativeLayout settingButton = (RelativeLayout)mCustomView .FindViewById(Resource.Id.settingsParent); settingButton.Click += (object sender, EventArgs e) => { onProperyWindowClick(); }; if (selectedGroup.samples.Count <= 1) { imageButton.Visibility = ViewStates.Invisible; } popupWindow.AnchorView = imageButton; popupWindow.Width = measureContentWidth(sampleLayouts); popupWindow.SetAdapter(sampleLayouts); RefreshSample(selectedSample); }
/** * Create and return the user interface view for this fragment. */ public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState) { int theme = Arguments.GetInt("theme"); int initialHour = Arguments.GetInt("hour"); int initialMinute = Arguments.GetInt("minute"); bool isClientSpecified24HourTime = Arguments.GetBoolean("isClientSpecified24HourTime"); bool is24HourTime = Arguments.GetBoolean("is24HourTime"); // Unless we inflate using a cloned inflater with a Holo theme, // on Lollipop devices the TimePicker will be the new-style // radial TimePicker, which is not what we want. So we will // clone the inflater that we're given but with our specified // theme, then inflate the layout with this new inflater. Context contextThemeWrapper = new ContextThemeWrapper( Activity, theme == SlideDateTimePicker._holoDark ?Android.Resource.Style.ThemeHolo : Android.Resource.Style.ThemeHoloLight); LayoutInflater localInflater = inflater.CloneInContext(contextThemeWrapper); View view = localInflater.Inflate(Resource.Layout.FragmentTimeLayout, container, false); _timePicker = (TimePicker)view.FindViewById(Resource.Id.timePicker); // block keyboard popping up on touch _timePicker.DescendantFocusability = DescendantFocusability.BlockDescendants; _timePicker.SetOnTimeChangedListener(this); // If the client specifies a 24-hour time format, set it on // the TimePicker. if (isClientSpecified24HourTime) { _timePicker.SetIs24HourView((Boolean)is24HourTime); } else { // If the client does not specify a 24-hour time format, use the // device default. _timePicker.SetIs24HourView((Boolean)DateFormat.Is24HourFormat(TargetFragment.Activity)); } _timePicker.CurrentHour = (Integer)initialHour; _timePicker.CurrentMinute = (Integer)initialMinute; // Fix for the bug where a TimePicker's onTimeChanged() is not called when // the user toggles the AM/PM button. Only applies to 4.0.0 and 4.0.3. if ((int)Build.VERSION.SdkInt >= 14 && (int)Build.VERSION.SdkInt <= 15) { FixTimePickerBug18982(); } return(view); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); menuRed = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_red); menuYellow = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_yellow); menuGreen = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_green); menuBlue = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_blue); menuDown = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_down); menuLabelsRight = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_labels_right); fab1 = view.FindViewById <FloatingActionButton> (Resource.Id.fab1); fab2 = view.FindViewById <FloatingActionButton> (Resource.Id.fab2); fab3 = view.FindViewById <FloatingActionButton> (Resource.Id.fab3); FloatingActionButton programFab1 = new FloatingActionButton(this.Activity); programFab1.ButtonSize = FloatingActionButton.SizeMini; programFab1.LabelText = this.GetString(Resource.String.lorem_ipsum); programFab1.SetImageResource(Resource.Drawable.ic_edit); menuRed.AddMenuButton(programFab1); programFab1.Click += ProgramFab1_Click; ContextThemeWrapper context = new ContextThemeWrapper(this.Activity, Resource.Style.MenuButtonsStyle); FloatingActionButton programFab2 = new FloatingActionButton(context); programFab2.LabelText = "Programmatically added button"; programFab2.SetImageResource(Resource.Drawable.ic_edit); menuYellow.AddMenuButton(programFab2); fab1.Enabled = false; menuRed.SetOnMenuButtonClickListener(this); menuRed.SetClosedOnTouchOutside(true); menuBlue.IconAnimated = false; menuDown.HideMenuButton(false); menuRed.HideMenuButton(false); menuYellow.HideMenuButton(false); menuGreen.HideMenuButton(false); menuBlue.HideMenuButton(false); menuLabelsRight.HideMenuButton(false); fabEdit = view.FindViewById <FloatingActionButton> (Resource.Id.fab_edit); fabEdit.SetShowAnimation(AnimationUtils.LoadAnimation(this.Activity, Resource.Animation.scale_up)); fabEdit.SetHideAnimation(AnimationUtils.LoadAnimation(this.Activity, Resource.Animation.scale_down)); }
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()); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (this.Context == null) { throw new Exception("this.Context == null"); } themeWrapper = new ContextThemeWrapper(this.Context, R.Style.ConnTextView); var view = inflater.CloneInContext(themeWrapper).Inflate(R.Layout.connections, container, false); connParent = view.FindViewById <LinearLayout>(R.Id.connparent); return(view); }
//TODO RM: Ensure this works with pre 5.0 like 4.4 public static Android.Util.TypedValue GetTypedValueFromActv(ContextThemeWrapper activity) { Android.Util.TypedValue typedValue = new Android.Util.TypedValue(); try { return(activity.Theme.ResolveAttribute(Android.Resource.Attribute.SelectableItemBackground, typedValue, true) ? typedValue : null); } catch (Exception e) { _logger.Error($"An Error occurred while retrieving the SelectableItemBackground used for transparent buttons. {e.Message}"); return(null); } }
void CustomDialog() { ContextThemeWrapper ctw = new ContextThemeWrapper(this, Resource.Style.Theme_Dialog_N); Android.App.AlertDialog.Builder ad = new Android.App.AlertDialog.Builder(ctw); //LayoutInflater inflater = this.LayoutInflater; //ad.SetView(inflater.Inflate(Resource.Layout.dialogWindow, null)); ad.SetTitle("Previt"); ad.SetSingleChoiceItems(spItems, -1, SingleChoiceAction); ad.SetPositiveButton("Cancelar", delegate { }); Android.App.AlertDialog mDialog = ad.Create(); mDialog.Show(); // mDialog.GetButton(ad.SetPositiveButton).SetTextColor(); //mDialog.Window.SetBackgroundDrawableResource(Resource.Color.colorPrimary); }
protected override AppCompatButton CreateNativeControl() { var context = new ContextThemeWrapper(Context, Resource.Style.Widget_AppCompat_Button_Borderless); var button = new AppCompatButton(context, null, Resource.Style.Widget_AppCompat_Button_Borderless); button.SetPadding(0, 0, 0, 0); button.SetLineSpacing(0, 0); button.SetMinWidth(1); button.SetMinWidth(1); button.SetMinimumHeight(1); button.SetMinimumWidth(1); button.SetPaddingRelative(0, 0, 0, 0); //button.Set(0,0,0,0); return(button); }
static void ShowMessage(Activity currentActivity, string title, string message, int msgTypeFlag) { ContextThemeWrapper ctw = new ContextThemeWrapper(currentActivity, Android.Resource.Style.ThemeHoloLightDarkActionBar); AlertDialog.Builder alert = new AlertDialog.Builder(ctw); alert.SetIcon(msgTypeFlag); alert.SetTitle(title); alert.SetMessage(message); alert.SetPositiveButton("OK", (senderAlert, args) => { Toast.MakeText(currentActivity, "Принято!", ToastLength.Short).Show(); }); Dialog dialog = alert.Create(); dialog.Show(); }