protected override IEnumerable <IDisposable> Initialize() { _originalBackground = Native.Background; _originalTitleTextColor = Native.GetTitleTextColor(); // Content // This allows custom Content to be properly laid out inside the native Toolbar. _contentContainer = new Border() { Visibility = Visibility.Collapsed, // This container requires a fixed height to be properly laid out by its native parent. // According to Google's Material Design Guidelines, the Toolbar must have a minimum height of 48. // https://material.io/guidelines/layout/structure.html Height = 48, }; _contentContainer.SetParent(Element); Native.AddView(_contentContainer); yield return(Disposable.Create(() => Native.RemoveView(_contentContainer))); yield return(_contentContainer.RegisterParentChangedCallback(this, OnContentContainerParentChanged)); // Commands.Click Native.MenuItemClick += Native_MenuItemClick; yield return(Disposable.Create(() => Native.MenuItemClick -= Native_MenuItemClick)); // NavigationCommand.Click Native.NavigationClick += Native_NavigationClick; yield return(Disposable.Create(() => Native.NavigationClick -= Native_NavigationClick)); // Commands VectorChangedEventHandler <ICommandBarElement> OnVectorChanged = (s, e) => Invalidate(); Element.PrimaryCommands.VectorChanged += OnVectorChanged; Element.SecondaryCommands.VectorChanged += OnVectorChanged; yield return(Disposable.Create(() => Element.PrimaryCommands.VectorChanged -= OnVectorChanged)); yield return(Disposable.Create(() => Element.SecondaryCommands.VectorChanged -= OnVectorChanged)); // Properties yield return(Element.RegisterDisposableNestedPropertyChangedCallback( (s, e) => Invalidate(), new[] { CommandBar.PrimaryCommandsProperty }, new[] { CommandBar.SecondaryCommandsProperty }, new[] { CommandBar.ContentProperty }, new[] { CommandBar.ForegroundProperty }, new[] { CommandBar.ForegroundProperty, SolidColorBrush.ColorProperty }, new[] { CommandBar.ForegroundProperty, SolidColorBrush.OpacityProperty }, new[] { CommandBar.BackgroundProperty }, new[] { CommandBar.BackgroundProperty, SolidColorBrush.ColorProperty }, new[] { CommandBar.BackgroundProperty, SolidColorBrush.OpacityProperty }, new[] { CommandBar.VisibilityProperty }, new[] { CommandBar.PaddingProperty }, new[] { CommandBar.OpacityProperty }, new[] { SubtitleProperty }, new[] { NavigationCommandProperty }, new[] { BackButtonVisibilityProperty }, new[] { BackButtonForegroundProperty }, new[] { BackButtonIconProperty } )); }
public override void SetImageDrawable(Android.Graphics.Drawables.Drawable drawable) { base.SetImageDrawable(drawable); mBitmap = getBitmapFromDrawable(drawable); setup(); }
private Bitmap GetBitMapFromDrawable(Android.Graphics.Drawables.Drawable drawable) { if (drawable == null) { return(null); } if (drawable.GetType() == typeof(BitmapDrawable)) { return(((BitmapDrawable)drawable).Bitmap); } try { Bitmap bitmap; if (drawable.GetType() == typeof(ColorDrawable)) { bitmap = Bitmap.CreateBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG); } else { bitmap = Bitmap.CreateBitmap(drawable.IntrinsicWidth, drawable.IntrinsicHeight, BITMAP_CONFIG); } Canvas canvas = new Canvas(bitmap); drawable.SetBounds(0, 0, canvas.Width, canvas.Height); drawable.Draw(canvas); return(bitmap); } catch (OutOfMemoryException e) { return(null); } }
public static Bitmap drawableToBitmap(Android.Graphics.Drawables.Drawable drawable) { Bitmap bitmap = null; if (drawable is BitmapDrawable) { BitmapDrawable bitmapDrawable = (BitmapDrawable)drawable; if (bitmapDrawable.Bitmap != null) { return(bitmapDrawable.Bitmap); } } if (drawable.IntrinsicWidth <= 0 || drawable.IntrinsicHeight <= 0) { bitmap = Bitmap.CreateBitmap(1, 1, Bitmap.Config.Argb8888); // Single color bitmap will be created of 1x1 pixel } else { bitmap = Bitmap.CreateBitmap(drawable.IntrinsicWidth, drawable.IntrinsicHeight, Bitmap.Config.Argb8888); } Canvas canvas = new Canvas(bitmap); drawable.SetBounds(0, 0, canvas.Width, canvas.Height); drawable.Draw(canvas); return(bitmap); }
private bool ValidateLocation() { Validations validation = new Validations(); MessageDialog messageDialog = new MessageDialog(); Android.Graphics.Drawables.Drawable icon = Resources.GetDrawable(Resource.Drawable.error); icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight); bool isValid = true; if (!validation.IsRequired(streetAddress.Text)) { streetAddress.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(suburb.Text)) { suburb.SetError("This field is required", icon); isValid = false; } if (facility.Location == null) { if (facility.Location.GPSCoordinates == null) { messageDialog.SendToast("Please add an GPS coordinates"); isValid = false; } } return(isValid); }
private void InitDraggableDot() { mWhiteDot = Resources.GetDrawable(Resource.Drawable.white_dot); mRedDot = Resources.GetDrawable(Resource.Drawable.red_dot); mGreenDot = Resources.GetDrawable(Resource.Drawable.green_dot); mTranslucentDot = Resources.GetDrawable(Resource.Drawable.translucent_dot); }
private void InitializeFields() { _errorDrawable = Resources.GetDrawable (Android.Resource.Drawable.StatNotifyError); _nameCandidate = FindViewById<EditText> (Resource.Id.name_candidate); _emailCandidate = FindViewById<EditText> (Resource.Id.email_candidate); _next = FindViewById<Button> (Resource.Id.next); }
public static Drawable GetObject(IntPtr instance) { if(Application.platform != RuntimePlatform.Android) return null; Drawable result = new Drawable(); result._instance = instance; return result; }
public MyItemizedOverlay(Context context, Drawable drawable) //http://mono-for-android.1047100.n5.nabble.com/BoundCenterBottom-and-BoundCenter-on-ItemizedOverlay-return-Drawable-with-wrong-bounds-td5082774.html : base(/*BoundCenterBottom(*/drawable/*)*/) { this.context = context; Populate(); }
public DividerItemDecoration (Context context, int orientation) { var a = context.ObtainStyledAttributes (Attrs); divider = a.GetDrawable (0); a.Recycle(); Orientation = orientation; }
public BezelImageView(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { // Attribute initialization var a = context.ObtainStyledAttributes(attrs, Resource.Styleable.BezelImageView, defStyle, 0); mMaskDrawable = a.GetDrawable(Resource.Styleable.BezelImageView_maskDrawable); if (mMaskDrawable == null) { mMaskDrawable = Resources.GetDrawable(Resource.Drawable.bezel_mask); } mMaskDrawable.Callback = this; mBorderDrawable = a.GetDrawable(Resource.Styleable.BezelImageView_borderDrawable); if (mBorderDrawable == null) { mBorderDrawable = Resources.GetDrawable(Resource.Drawable.bezel_border); } mBorderDrawable.Callback = this; a.Recycle(); // Other initialization mMaskedPaint = new Paint(); mMaskedPaint.SetXfermode(new PorterDuffXfermode(PorterDuff.Mode.SrcAtop)); mCopyPaint = new Paint(); }
//@Override protected override void onLoadingDrawableSet(Drawable imageDrawable) { if (null != imageDrawable) { int dHeight = imageDrawable.IntrinsicHeight; int dWidth = imageDrawable.IntrinsicWidth; /** * We need to set the width/height of the ImageView so that it is * square with each side the size of the largest drawable dimension. * This is so that it doesn't clip when rotated. */ ViewGroup.LayoutParams lp = mHeaderImage.LayoutParameters; lp.Width = lp.Height = Math.Max(dHeight, dWidth); mHeaderImage.RequestLayout(); /** * We now rotate the Drawable so that is at the correct rotation, * and is centered. */ mHeaderImage.SetScaleType(ImageView.ScaleType.Matrix); Matrix matrix = new Matrix(); matrix.PostTranslate((lp.Width - dWidth) / 2f, (lp.Height - dHeight) / 2f); matrix.PostRotate(getDrawableRotationAngle(), lp.Width / 2f, lp.Height / 2f); mHeaderImage.ImageMatrix = matrix; } }
public GestureRecognizerView (Context context) : base(context, null, 0) { _icon = context.Resources.GetDrawable (Resource.Drawable.ic_launcher); _icon.SetBounds (0, 0, _icon.IntrinsicWidth, _icon.IntrinsicHeight); _scaleDetector = new ScaleGestureDetector (context, new MyScaleListener (this)); }
private void Init(Context context) { _activity = context as MainActivity; // set some styles SetHintTextColor(Color.LightGray); // The image we defined for the clear button imgClearButton = ResourcesCompat.GetDrawable(context.Resources, Resource.Drawable.clear, null); SetOnTouchListener(new CustomOnTouchListener()); FocusChange += (s, e) => { if (e.HasFocus) { if (CrossCurrentActivity.Current.Activity is MainActivity) { (CrossCurrentActivity.Current.Activity as MainActivity).CloseDrawer(); } } }; TextChanged += (s, e) => { if (Text.Length > 0) { ShowClearButton(); } else { HideClearButton(); } }; }
async protected override void OnCreate(Bundle bundle) { this.Window.AddFlags(WindowManagerFlags.Fullscreen); base.OnCreate(bundle); var metrics = Resources.DisplayMetrics; widthInDp = ((int)metrics.WidthPixels); heightInDp = ((int)metrics.HeightPixels); Configuration.setWidthPixel (widthInDp); Configuration.setHeigthPixel (heightInDp); vm = this.ViewModel as LOViewModel; int tam = Configuration.getWidth (80); bm_user = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap(getBitmapFromAsset ("icons/nouser.png"), tam,tam, true) ,tam,tam); bmLike = Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth (43), Configuration.getWidth (35), true); drBack = new BitmapDrawable(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondocondiagonalm.png"), 640, 1136, true)); await ini(); //LoadPagesDataSource (); SetContentView (mainLayout); }
private bool ValidateDeedInfo() { Validations validation = new Validations(); MessageDialog messageDialog = new MessageDialog(); Android.Graphics.Drawables.Drawable icon = Resources.GetDrawable(Resource.Drawable.error); icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight); bool isValid = true; if (!validation.IsRequired(erfNumber.Text)) { erfNumber.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(titleDeedNumber.Text)) { titleDeedNumber.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(extentm2.Text)) { extentm2.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(ownerInformation.Text)) { ownerInformation.SetError("This field is required", icon); isValid = false; } return(isValid); }
public void SetDefaultSelector(Drawable d) { _defaultBackground = d; if (!_stacked) { SetStacked(false, true); } }
public ProgressViewHolder(View view, Color moduleColor, float displayDensity) : base(view) { shapeLevelColor = GetDrawable(view, Resource.Drawable.rectangle_level1); shapeModuleColor = CreateRect(moduleColor, displayDensity); ImageViewStatus = view.FindViewById<ImageView>(Resource.Id.ivStatus); }
public ActionItem Build() { var actionItem = new ActionItem(_itemId, _itemTitle, _icon); _itemId = -1; _itemTitle = string.Empty; _icon = null; return actionItem; }
public FFBitmapDrawable(Resources res, Bitmap bitmap, Drawable placeholder, float fadingTime, bool fadeEnabled) : base(res, bitmap) { _placeholder = placeholder; _fadingTime = fadingTime; _animating = fadeEnabled; _startTimeMillis = SystemClock.UptimeMillis(); }
protected override void onLoadingDrawableSet(Drawable imageDrawable) { if (null != imageDrawable) { mRotationPivotX = (int)Math.Round(imageDrawable.IntrinsicWidth / 2f); mRotationPivotY = (int)Math.Round(imageDrawable.IntrinsicHeight / 2f); } }
public ShadowItemDecoration (Context context) { shadow = context.Resources.GetDrawable (Resource.Drawable.DropShadowVertical); reverseShadow = context.Resources.GetDrawable (Resource.Drawable.DropShadowVerticalReverse); topShadowHeightInPixels = topShadowHeightInDps.DpsToPxls (context); bottomShadowHeightInPixels = bottomShadowHeightInDps.DpsToPxls (context); }
public static void setBackground(View view, Drawable background) { if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.JellyBean) { SDK16.setBackground(view, background); } else { view.SetBackgroundDrawable(background); } }
public static HeaderDesign FromColorResAndDrawable(int colorRes, Drawable drawable) { return new HeaderDesign { ColorRes = colorRes, Drawable = drawable }; }
public void SetImageDrawable(int col, int row, Android.Graphics.Drawables.Drawable drawable) { int elementIdx = GetElementIdx(col, row); // manually boxing elementIdx to avoid calling List.remove(int position) method overload unInitializedImages.Remove(elementIdx); images[elementIdx].SetImageDrawable(drawable); }
public static HeaderDesign FromColorAndDrawable(int color, Drawable drawable) { return new HeaderDesign { Drawable = drawable, Color = color }; }
private void PrepareBackgroundManager () { BackgroundManager backgroundManager = BackgroundManager.GetInstance (this.Activity); backgroundManager.Attach (this.Activity.Window); mBackgroundTarget = new PicassoBackgroundManagerTarget (backgroundManager); mDefaultBackground = Resources.GetDrawable (Resource.Drawable.default_background); mMetrics = new DisplayMetrics (); this.Activity.WindowManager.DefaultDisplay.GetMetrics (mMetrics); }
public override void SetImageDrawable(Drawable drawable) { var previous = Drawable; base.SetImageDrawable(drawable); UpdateDrawableDisplayedState(drawable, true); UpdateDrawableDisplayedState(previous, false); }
//@Override public void setLoadingDrawable(Drawable drawable) { //for (LoadingLayout layout : mLoadingLayouts) { // layout.setLoadingDrawable(drawable); //} foreach (var layout in mLoadingLayouts) { layout.setLoadingDrawable(drawable); } }
/* FMT: this is not fine when working with RecyclerView... It can detach and cache the view, then reattach it protected override void OnDetachedFromWindow() { SetImageDrawable(null); base.OnDetachedFromWindow(); } */ public override void SetImageDrawable(Drawable drawable) { var previousDrawable = Drawable; base.SetImageDrawable(drawable); NotifyDrawable(previousDrawable, false); NotifyDrawable(drawable, true); }
public void LoadObject(GameObjects type, Drawable tile) { Bitmap bitmap = Bitmap.CreateBitmap (objectSize, objectSize, Bitmap.Config.Argb8888); Canvas canvas = new Canvas (bitmap); tile.SetBounds (0, 0, objectSize, objectSize); tile.Draw (canvas); bitmaps [(int)type] = bitmap; }
public MyDragShadowBuilder(View v) : base (v) { TypedArray a = v.Context.ObtainStyledAttributes (Resource.Styleable.AppTheme); mShadow = a.GetDrawable (Resource.Styleable.AppTheme_listDragShadowBackground); mShadow.Callback = v; mShadow.SetBounds (0, 0, v.Width, v.Height); a.Recycle (); }
public Bitmap convertToBitmap(Android.Graphics.Drawables.Drawable drawable, int widthPixels, int heightPixels) { Bitmap mutableBitmap = Bitmap.CreateBitmap(widthPixels, heightPixels, Bitmap.Config.Argb8888); Canvas canvas = new Canvas(mutableBitmap); drawable.SetBounds(0, 0, widthPixels, heightPixels); drawable.Draw(canvas); return(mutableBitmap); }
public void LoadPiece(PieceType type, Drawable piece) { Bitmap bitmap = Bitmap.CreateBitmap (piece_size, piece_size, Bitmap.Config.Argb8888); Canvas canvas = new Canvas (bitmap); piece.SetBounds (0, 0, piece_size, piece_size); piece.Draw (canvas); piece_bitmaps[(int)type] = bitmap; }
public void setBack(Drawable dr, Bitmap bm) { //drBack = dr; linearContainerFisrst.SetBackgroundDrawable (dr); //Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth(43), Configuration.getHeight(43), true) imgHeart.SetImageBitmap (bm); }
// Function to set the specified Drawable as the tile for a particular // integer key. public void LoadTile (TileType type, Drawable tile) { Bitmap bitmap = Bitmap.CreateBitmap (tile_size, tile_size, Bitmap.Config.Argb8888); Canvas canvas = new Canvas (bitmap); tile.SetBounds (0, 0, tile_size, tile_size); tile.Draw (canvas); tile_bitmaps[(int)type] = bitmap; }
public override void SetImageDrawable(Drawable drawable) { var previous = Drawable; _drawableRef = new WeakReference<Drawable>(drawable); base.SetImageDrawable(drawable); UpdateDrawableDisplayedState(drawable, true); UpdateDrawableDisplayedState(previous, false); }
public void OnLoaded(ImageView p0, Bitmap p1, string p2, bool p3) { _image = imageView.Drawable; _image.SetBounds(0, 0, _image.IntrinsicWidth, _image.IntrinsicHeight); _scaleDetector = new ScaleGestureDetector(_context, new MyScaleListener(this)); var metrics = Resources.DisplayMetrics; _posX = GetCornerPosition(PixelConverter.PixelsToDp(metrics.WidthPixels), _image.Bounds.Width()) * (int)_scaleFactor; _posY = GetCornerPosition(PixelConverter.PixelsToDp(metrics.HeightPixels), _image.Bounds.Height()); }
public static void SetBackground(View view, Drawables.Drawable background) { if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { SeekBarCompatDontCrash.SetBackground(view, background); } else { view.SetBackgroundDrawable(background); } }
public static void SetHotspotBounds(Drawables.Drawable drawable, int left, int top, int right, int bottom) { if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { //We don't want the full size rect, Lollipop ripple would be too big int size = (right - left) / 8; DrawableCompat.SetHotspotBounds(drawable, left + size, top + size, right - size, bottom - size); } else { drawable.SetBounds(left, top, right, bottom); } }
/// <summary> /// Used to get set data to the Tab views from navigation items /// </summary> /// <param name="bottomNavigationItem"> holds all the data </param> /// <param name="bottomNavigationTab"> view to which data need to be set </param> /// <param name="bottomNavigationBar"> view which holds all the tabs </param> public static void bindTabWithData(BottomNavigationItem bottomNavigationItem, BottomNavigationTab bottomNavigationTab, BottomNavigationBar bottomNavigationBar) { Context context = bottomNavigationBar.Context; bottomNavigationTab.Label = bottomNavigationItem.getTitle(context); bottomNavigationTab.Icon = bottomNavigationItem.getIcon(context); int activeColor = bottomNavigationItem.getActiveColor(context); int inActiveColor = bottomNavigationItem.getInActiveColor(context); if (activeColor != -1) { bottomNavigationTab.ActiveColor = activeColor; } else { bottomNavigationTab.ActiveColor = bottomNavigationBar.ActiveColor; } if (inActiveColor != -1) { bottomNavigationTab.InactiveColor = inActiveColor; } else { bottomNavigationTab.InactiveColor = bottomNavigationBar.InActiveColor; } if (bottomNavigationItem.InActiveIconAvailable) { Drawable inactiveDrawable = bottomNavigationItem.getInactiveIcon(context); if (inactiveDrawable != null) { bottomNavigationTab.InactiveIcon = inactiveDrawable; } } bottomNavigationTab.ItemBackgroundColor = bottomNavigationBar.BackgroundColor; setBadgeForTab(bottomNavigationItem.BadgeItem, bottomNavigationTab); }
private bool ValidateForm() { Validations validation = new Validations(); MessageDialog messageDialog = new MessageDialog(); Android.Graphics.Drawables.Drawable icon = Resources.GetDrawable(Resource.Drawable.error); icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight); bool isValid = true; bool photoIsRequired = false; bool GPSCoordinatesIsRequired = false; if (!validation.IsRequired(buildingName.Text)) { buildingName.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(utilisationStatus.Text)) { utilisationStatus.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(constructionDescription.Text)) { constructionDescription.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(totalFootprintAream2.Text)) { totalFootprintAream2.SetError("This field is required", icon); isValid = false; } if (!validation.IsRequired(totalImprovedaAeam2.Text)) { totalImprovedaAeam2.SetError("This field is required", icon); isValid = false; } return(isValid); }
void SetBackground(MvvmAspire.Controls.Entry element) { if (Control == null) { return; } bool hasSetOriginal = false; if (originalBackground == null) { originalBackground = Control.Background; hasSetOriginal = true; } if (element.BackgroundImage != null) { var resourceId = UIHelper.GetDrawableResource(element.BackgroundImage); if (resourceId > 0) { Control.SetBackgroundResource(resourceId); } else { if (!hasSetOriginal) { Control.Background = originalBackground; } } } else { if (!hasSetOriginal) { Control.Background = originalBackground; } } }
public IMenuItem SetIcon(Android.Graphics.Drawables.Drawable icon) { mIconResId = 0; mIconDrawable = icon; return(this); }
public void SetBitmap(Android.Graphics.Drawables.Drawable _Image) { Image = _Image; HasImage = true; }
void UpdateToolbarShadow(Android.Support.V7.Widget.Toolbar toolbar, bool hasShadow, Activity activity, Android.Graphics.Drawables.Drawable windowContent) { var androidContent = activity?.Window?.DecorView?.FindViewById <FrameLayout>(Window.IdAndroidContent); if (androidContent != null) { if (hasShadow && activity != null) { GradientDrawable shadowGradient = new GradientDrawable(GradientDrawable.Orientation.RightLeft, new int[] { Android.Graphics.Color.Transparent.ToArgb(), Android.Graphics.Color.Gray.ToArgb() }); shadowGradient.SetCornerRadius(0f); androidContent.Foreground = shadowGradient; toolbar.Elevation = 4; } else { androidContent.Foreground = windowContent; toolbar.Elevation = 0; } } }
void UpdateToolbarBackground(Android.Support.V7.Widget.Toolbar toolbar, Page lastPage, Activity activity, Android.Graphics.Drawables.Drawable defaultBackground) { if (string.IsNullOrEmpty(CustomNavigationPage.GetBarBackground(lastPage)) && CustomNavigationPage.GetGradientColors(lastPage) == null) { toolbar.SetBackground(defaultBackground); } else { if (!string.IsNullOrEmpty(CustomNavigationPage.GetBarBackground(lastPage))) { toolbar.SetBackgroundResource(this.Context.Resources.GetIdentifier(CustomNavigationPage.GetBarBackground(lastPage), "drawable", Android.App.Application.Context.PackageName)); } if (CustomNavigationPage.GetGradientColors(lastPage) != null) { var colors = CustomNavigationPage.GetGradientColors(lastPage); var direction = GradientDrawable.Orientation.TopBottom; switch (CustomNavigationPage.GetGradientDirection(lastPage)) { case CustomNavigationPage.GradientDirection.BottomToTop: direction = GradientDrawable.Orientation.BottomTop; break; case CustomNavigationPage.GradientDirection.RightToLeft: direction = GradientDrawable.Orientation.RightLeft; break; case CustomNavigationPage.GradientDirection.LeftToRight: direction = GradientDrawable.Orientation.LeftRight; break; } GradientDrawable gradient = new GradientDrawable(direction, new int[] { colors.Item1.ToAndroid().ToArgb(), colors.Item2.ToAndroid().ToArgb() }); gradient.SetCornerRadius(0f); toolbar.SetBackground(gradient); } } toolbar.Background.SetAlpha((int)(CustomNavigationPage.GetBarBackgroundOpacity(lastPage) * 255)); }
void UpdateToolbarStyle(Android.Support.V7.Widget.Toolbar toolbar, Page lastPage, Activity activity, Android.Graphics.Drawables.Drawable defaultBackground, Android.Graphics.Drawables.Drawable windowContent) { UpdateToolbarBackground(toolbar, lastPage, activity, defaultBackground); UpdateToolbarShadow(toolbar, CustomNavigationPage.GetHasShadow(lastPage), activity, windowContent); }
void UpdateTitleViewLayoutBackground(LinearLayout titleViewLayout, string backgroundResource, Android.Graphics.Drawables.Drawable defaultBackground) { if (!string.IsNullOrEmpty(backgroundResource)) { titleViewLayout?.SetBackgroundResource(this.Context.Resources.GetIdentifier(backgroundResource, "drawable", Android.App.Application.Context.PackageName)); } else { titleViewLayout?.SetBackground(defaultBackground); } }
void UpdateTitleViewLayout(Page lastPage, Android.Widget.LinearLayout titleViewLayout, AppCompatTextView titleTextView, AppCompatTextView subTitleTextView, Android.Graphics.Drawables.Drawable defaultBackground) { UpdateTitleViewLayoutAlignment(titleViewLayout, titleTextView, subTitleTextView, CustomNavigationPage.GetTitlePosition(lastPage)); if (!string.IsNullOrEmpty(CustomNavigationPage.GetTitleBackground(lastPage))) { UpdateTitleViewLayoutBackground(titleViewLayout, CustomNavigationPage.GetTitleBackground(lastPage), defaultBackground); } else { _titleViewLayout?.SetBackground(CreateShape(ShapeType.Rectangle, (int)CustomNavigationPage.GetTitleBorderWidth(lastPage), (int)CustomNavigationPage.GetTitleBorderCornerRadius(lastPage), CustomNavigationPage.GetTitleFillColor(lastPage), CustomNavigationPage.GetTitleBorderColor(lastPage))); } UpdateTitleViewLayoutMargin(titleViewLayout, CustomNavigationPage.GetTitleMargin(lastPage)); UpdateTitleViewLayoutPadding(titleViewLayout, CustomNavigationPage.GetTitlePadding(lastPage)); }
public void SetBitmap(int ResourceID) { Image = Application.Context.Resources.GetDrawable(ResourceID); HasImage = true; }
public static void SetBackground(View view, Android.Graphics.Drawables.Drawable background) { view.Background = background; }
public override void SetButtonDrawable(Android.Graphics.Drawables.Drawable d) { BackgroundImage = d; base.SetButtonDrawable(d); }
public void ClearImage() { HasImage = false; Image = null; }
public FixedItemizedOverlay(Android.Graphics.Drawables.Drawable defaultMarker) : base(defaultMarker) { }
public TopNavigationViewIconPropertyHelper() { MenuIcon = new ColorDrawable(Color.Transparent).Mutate(); }