protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView(Resource.Layout.action_bar_display_options); FindViewById(Resource.Id.toggle_home_as_up).SetOnClickListener(this); FindViewById(Resource.Id.toggle_show_home).SetOnClickListener(this); FindViewById(Resource.Id.toggle_use_logo).SetOnClickListener(this); FindViewById(Resource.Id.toggle_show_title).SetOnClickListener(this); FindViewById(Resource.Id.toggle_show_custom).SetOnClickListener(this); FindViewById(Resource.Id.toggle_navigation).SetOnClickListener(this); FindViewById(Resource.Id.cycle_custom_gravity).SetOnClickListener(this); FindViewById(Resource.Id.toggle_visibility).SetOnClickListener(this); // Configure several action bar elements that will be toggled by display options. mCustomView = LayoutInflater.Inflate(Resource.Layout.action_bar_display_options_custom, null); mCustomViewLayoutParams = new Android.Support.V7.App.ActionBar.LayoutParams( Android.Support.V7.App.ActionBar.LayoutParams.WrapContent, Android.Support.V7.App.ActionBar.LayoutParams.WrapContent); ActionBar bar = SupportActionBar; bar.SetCustomView(mCustomView, mCustomViewLayoutParams); bar.AddTab(bar.NewTab().SetText("Tab 1").SetTabListener(this)); bar.AddTab(bar.NewTab().SetText("Tab 2").SetTabListener(this)); bar.AddTab(bar.NewTab().SetText("Tab 3").SetTabListener(this)); }
public void OnClick(View view) { var renderer = view.Tag as AppCompatButtonRenderer; if (renderer == null) { return; } renderer.Element.InvokeSendClicked(); }
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e) { base.OnElementChanged (e); if (e.NewElement == null) { return; } var element = Element as AdvancedListView; if (Control != null) { UpdateVerticalScrollbar (element); Control.Scroll += (object sender, AbsListView.ScrollEventArgs e2) => { // System.Diagnostics.Debug.WriteLine ("{0} -> {1}", scrollY, Control.MaxScrollAmount); ReportContentOffset (element); UpdateAffordances (); }; Control.ScrollStateChanged += (object sender, AbsListView.ScrollStateChangedEventArgs e2) => { }; _topOverlayMask = new GradientDrawable (); _topOverlayView = new Android.Views.View (Forms.Context); _topOverlayView.SetBackgroundDrawable (_topOverlayMask); AddView (_topOverlayView); _bottomOverlayMask = new GradientDrawable (); _bottomOverlayView = new Android.Views.View (Forms.Context); _bottomOverlayView.SetBackgroundDrawable (_bottomOverlayMask); AddView (_bottomOverlayView); UpdateAffordanceColors (); RequestLayout (); } }
public static void SetMeasuredDimensions(View view, int width, int height) { LayouterHelper.SetMeasuredDimensions(view, new object[] { width, height }); }
void AView.IOnAttachStateChangeListener.OnViewDetachedFromWindow(AView detachedView) { }
protected override void OnListItemClick(ListView l, Android.Views.View v, int position, long id) { StartActivity(new Intent(this, Samples[position].ActivityType)); }
public static void InvalidateMeasure(this AView nativeView, IView view) { nativeView.RequestLayout(); }
public void OnClick(AView v) { var renderer = v.Tag as ButtonRenderer; ((IButtonController)renderer?.Element)?.SendClicked(); }
public static void Add(this IList<View> children, AView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null, OnLayoutDelegate onLayoutDelegate = null, OnMeasureDelegate onMeasureDelegate = null) { children.Add(view.ToView(getDesiredSizeDelegate, onLayoutDelegate, onMeasureDelegate)); }
public static bool GetClipToOutline(this AView view) { return(view.ClipToOutline); }
public static void SetColumn(View view, int column) { DependencyObjectExtensions.SetValue(view, ColumnProperty, column); }
public static int GetRowSpan(View view) { return((int)DependencyObjectExtensions.GetValue(view, RowSpanProperty)); }
public void OnViewDetachedFromWindow(AView detachedView) { }
public static void SetRow(View view, int row) { DependencyObjectExtensions.SetValue(view, RowProperty, row); }
public void OnViewAttachedToWindow(AView attachedView) { UpdateText(); }
public TemplateEntry(TimeSpan creationTime, View dependencyObject) { CreationTime = creationTime; Control = dependencyObject; }
public static void ShowKeyboard(View view) { MethodShowKeyboard.Invoke(null, new object[] { view }); }
/// <summary> /// Manually return an unused template root created by <see cref="LoadContentCached"/> to the pool. /// </summary> /// <remarks> /// This is only used in specialized contexts. Normally the template reuse will be automatically handled by the pool. /// </remarks> internal void ReleaseTemplateRoot(View templateRoot) => FrameworkTemplatePool.Instance.ReleaseTemplateRoot(templateRoot, this);
protected override void ConnectHandler(NativeView nativeView) { base.ConnectHandler(nativeView); VirtualView.Handler = this; }
public View(Android.Views.View child, bool wasCached) { this.view = child; this.wasCached = wasCached; }
public ViewPosition(View key, GridPosition value) { Key = key; Value = value; }
protected abstract int VisiblePortion(AView view, OrientationHelper orientationHelper, bool rtl);
public Android.Views.View GetDropDownView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent) { return(_adapter.GetDropDownView(position, convertView, parent)); }
public static void SetClipToOutline(this AView view, bool value) { view.ClipToOutline = value; }
/// <summary> /// Provides the desired size of the element, from the last measure phase. /// </summary> /// <param name="view">The element to get the measured with</param> /// <returns>The measured size</returns> Size ILayouter.GetDesiredSize(View view) { return(DesiredChildSize(view)); }
public void OnClick(AView v) { ((DatePickerRenderer)v.Tag).OnTextFieldClicked(); }
protected Size DesiredChildSize(View view) { var uiElement = view as UIElement; return(uiElement?.DesiredSize ?? LayouterHelper.LayoutProperties.GetValue(view, "desiredSize", () => default(Size))); }
void AView.IOnAttachStateChangeListener.OnViewAttachedToWindow(AView attachedView) { UpdateText(); }
/// <summary> /// Initializes a new instance of the <see cref="HasOnViewAttachListenerDelegate"/> class. /// </summary> /// <param name="view">The view.</param> public HasOnViewAttachListenerDelegate(View view) { _view = view; }
partial void RegisterSubView(View child);
public override bool IsViewFromObject(View view, Java.Lang.Object objectValue) { return view == objectValue; }
protected override void FindViews(Android.Views.View view) { base.FindViews(view); view.FindView(ref _gettingStartedTextView, Resource.Id.getting_started_text); }
public HasOnViewAttachListenerDelegate(View view) { _view = view; }
protected abstract void MeasureChild(View view, int widthSpec, int heightSpec);
public override void OnDrawerOpened(View drawerView) { base.OnDrawerOpened(drawerView); this.appCompatDelegate.InvalidateOptionsMenu(); this.owner.OnDrawerOpened(drawerView); }
public override void ChildDrawableStateChanged(Android.Views.View child) { base.ChildDrawableStateChanged(child); Control.Text = Control.Text; }
public override void SetCustomView(View view, LayoutParams layoutParams) { this.SupportActionBar.SetCustomView(view, new LayoutParamsAdapter(layoutParams)); }
protected virtual void OnWizardStepChanged() { // In order to hide software input method we need to authorize with window token from focused window // this code relies on (somewhat fragile) assumption, that the only window, that can hold // software keyboard focus during fragment switch, one with fragment itself. var inputMethodManager = Android.Views.InputMethods.InputMethodManager.FromContext(Activity); var focusedWindowChild = Wizard.CurrentStep == null ? null : Wizard.CurrentStep.View; if (focusedWindowChild == null) focusedWindowChild = Activity.CurrentFocus; if (focusedWindowChild == null) focusedWindowChild = new Android.Views.View(Activity); inputMethodManager.HideSoftInputFromWindow(focusedWindowChild.WindowToken, 0); }
partial void RemoveViewPartial(View current);
public void OnClick(View v) { LoginManager.Instance.LogInWithReadPermissions(_activity, new List<string> { "public_profile" }); }
public void OnClick(View v) { var myIntent = new Intent(_activity, typeof(FacebookActivity)); _activity.StartActivityForResult(myIntent, 0); }
public override void OnDrawerSlide(View drawerView, float slideOffset) { base.OnDrawerSlide(drawerView, slideOffset); this.owner.OnDrawerSlide(drawerView, slideOffset); }
protected int[] CalculateDistanceToFinalSnap(RecyclerView.LayoutManager layoutManager, AView targetView, int direction = 1) { var orientationHelper = CreateOrientationHelper(layoutManager); var isHorizontal = layoutManager.CanScrollHorizontally(); var rtl = isHorizontal && IsLayoutReversed(layoutManager); var size = orientationHelper.GetDecoratedMeasurement(targetView); var hiddenPortion = size - VisiblePortion(targetView, orientationHelper, rtl); var distance = (rtl ? hiddenPortion : -hiddenPortion) * direction; return(isHorizontal ? new[] { distance, 1 } : new[] { 1, distance }); }