public void SetDividerColors(int Colors) { // Make sure that the custom colorizer is removed _customTabColorizer = null; _defaultTabColorizer.SetDividerColors(Colors); Invalidate(); }
public void SetSelectedIndicatorColors(int Colors) { // Make sure that the custom colorizer is removed _customTabColorizer = null; _defaultTabColorizer.SetIndicatorColors(Colors); Invalidate(); }
internal void SetSelectedIndicatorColors(params Color[] colors) { // Make sure that the custom colorizer is removed _customTabColorizer = null; _defaultTabColorizer.SetIndicatorColors(colors); Invalidate(); }
protected override void OnDraw(Android.Graphics.Canvas canvas) { int height = Height; int childCount = ChildCount; int dividerHeightPx = (int)(Math.Min(Math.Max(0f, _dividerHeight), 1f) * height); SlidingTabLayout.ITabColorizer tabColorizer = _customTabColorizer != null ? _customTabColorizer: _defaultTabColorizer; // Thick colored underline below the current selection if (childCount > 0) { View selectedTitle = GetChildAt(_selectedPosition); int left = selectedTitle.Left; int right = selectedTitle.Right; int color = tabColorizer.GetIndicatorColor(_selectedPosition); if (_selectionOffset > 0f && _selectedPosition < (ChildCount - 1)) { int nextColor = tabColorizer.GetIndicatorColor(_selectedPosition + 1); if (color != nextColor) { color = BlendColors(nextColor, color, _selectionOffset); } // Draw the selection partway between the tabs View nextTitle = GetChildAt(_selectedPosition + 1); left = (int)(_selectionOffset * nextTitle.Left + (1.0f - _selectionOffset) * left); right = (int)(_selectionOffset * nextTitle.Right + (1.0f - _selectionOffset) * right); } _selectedIndicatorPaint.Color = Color.LightSkyBlue; canvas.DrawRect(left, height - _selectedIndicatorThickness, right, height, _selectedIndicatorPaint); } // Thin underline along the entire bottom edge canvas.DrawRect(0, height - _bottomBorderThickness, Width, height, _bottomBorderPaint); // Vertical separators between the titles int separatorTop = (height - dividerHeightPx) / 2; for (int i = 0; i < childCount - 1; i++) { View child = GetChildAt(i); _dividerPaint.Color = Color.Gray; canvas.DrawLine(child.Right, separatorTop, child.Right, separatorTop + dividerHeightPx, _dividerPaint); } }
public void SetCustomTabColorizer(SlidingTabLayout.ITabColorizer CustomTabColorizer) { _customTabColorizer = CustomTabColorizer; Invalidate(); }
internal void SetCustomTabColorizer(SlidingTabLayout.ITabColorizer customTabColorizer) { _customTabColorizer = customTabColorizer; Invalidate(); }