public SlidingTabStrip(Context context, IAttributeSet Attrs):base(context, Attrs) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); int themeForegroundColor = outValue.Data; _defaultBottomBorderColor = SetColorAlpha(themeForegroundColor,0x26); _defaultTabColorizer = new SimpleTabColorizer(); _defaultTabColorizer.SetIndicatorColors(0xFF33B5); _defaultTabColorizer.SetDividerColors(SetColorAlpha(themeForegroundColor,0x20)); _bottomBorderThickness = (int) (2 * density); _bottomBorderPaint = new Paint(); _bottomBorderPaint.Color = Color.White; _selectedIndicatorThickness = (int) (6 * density); _selectedIndicatorPaint = new Paint(); _dividerHeight = 0.5f; _dividerPaint = new Paint(); _dividerPaint.StrokeWidth=((int) (1 * density)); }
public VacationInfoCreateTabStrip (Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); int themeForeGround = outValue.Data; _defaultBottomBorderColor = SetColorAlpha(themeForeGround, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA); _defaultTabColorizer = new SimpleTabColorizer(); _defaultTabColorizer.IndicatorColors = INDICATOR_COLORS; _defaultTabColorizer.DividerColors = DIVIDER_COLORS; _bottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density); _bottomBorderPaint = new Paint(); _bottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray _selectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density); _selectedIndicatorPaint = new Paint(); _dividerHeight = DEFAULT_DIVIDER_HEIGHT; _dividerPaint = new Paint(); _dividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density); }
public SlidingTabStrip(Context context, IAttributeSet Attrs) : base(context, Attrs) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); int themeForegroundColor = outValue.Data; _defaultBottomBorderColor = SetColorAlpha(themeForegroundColor, 0x26); _defaultTabColorizer = new SimpleTabColorizer(); _defaultTabColorizer.SetIndicatorColors(0xFF33B5); _defaultTabColorizer.SetDividerColors(SetColorAlpha(themeForegroundColor, 0x20)); _bottomBorderThickness = (int)(2 * density); _bottomBorderPaint = new Paint(); _bottomBorderPaint.Color = Color.White; _selectedIndicatorThickness = (int)(6 * density); _selectedIndicatorPaint = new Paint(); _dividerHeight = 0.5f; _dividerPaint = new Paint(); _dividerPaint.StrokeWidth = ((int)(1 * density)); }
public SlidingTabStrip(Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); int themeForeGround = outValue.Data; var mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DefaultBottomBorderColorAlpha); _mDefaultTabColorizer = new SimpleTabColorizer { IndicatorColors = _indicatorColors, DividerColors = _dividerColors }; _mBottomBorderThickness = (int)(DefaultBottomBorderThicknessDips * density); _mBottomBorderPaint = new Paint { Color = new Color(mDefaultBottomBorderColor) }; //Gray _mSelectedIndicatorThickness = (int)(SelectedIndicatorThicknessDips * density); _mSelectedIndicatorPaint = new Paint(); _mDividerHeight = DefaultDividerHeight; _mDividerPaint = new Paint { StrokeWidth = (int)(DefaultDividerThicknessDips * density) }; }
public SlidingTabStrip(Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); int themeForeGround = outValue.Data; mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA); mDefaultTabColorizer = new SimpleTabColorizer(); mDefaultTabColorizer.IndicatorColors = INDICATOR_COLORS; mDefaultTabColorizer.DividerColors = DIVIDER_COLORS; mBottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density); mBottomBorderPaint = new Paint(); mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray mSelectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density); mSelectedIndicatorPaint = new Paint(); mDividerHeight = DEFAULT_DIVIDER_HEIGHT; mDividerPaint = new Paint(); mDividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density); }
public SlidingTabStrip(Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; //Obtenir la densité de l'appareil TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); //Recupere un entier correspondant à la couleur de font et remplis outValue avec int ThemeForeGround = outValue.Data; mDefaultBottomBorderColor = SetColorAlpha(ThemeForeGround, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA); //Fixe la couleur de de la bordure du bas avec celle récupérée précédement mDefaultTabColorizer = new SimpleTabColorizer(); mDefaultTabColorizer.IndicatorColors = INDICATOR_COLORS; mDefaultTabColorizer.DividerColors = DIVIDER_COLORS; mBottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density); mBottomBorderPaint = new Paint(); mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray mSelectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density); mSelectedIndicatorPaint = new Paint(); mDividerHeight = DEFAULT_DIVIDER_HEIGHT; mDividerPaint = new Paint(); mDividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density); }
public SlidingTabStrip(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { SetWillNotDraw(false); float density = Resources.DisplayMetrics.Density; TypedValue outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); int themeForegroundColor = outValue.Data; mDefaultBottomBorderColor = SetColorAlpha(themeForegroundColor, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA); mDefaultTabColorizer = new SimpleTabColorizer(); mDefaultTabColorizer.SetIndicatorColors(DEFAULT_SELECTED_INDICATOR_COLOR); mDefaultTabColorizer.SetDividerColors(SetColorAlpha(themeForegroundColor, DEFAULT_DIVIDER_COLOR_ALPHA)); mBottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density); mBottomBorderPaint = new Paint(); mBottomBorderPaint.Color = new Color(mDefaultBottomBorderColor); mSelectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density); mSelectedIndicatorPaint = new Paint(); mDividerHeight = DEFAULT_DIVIDER_HEIGHT; mDividerPaint = new Paint(); mDividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density); }
public SlidingTabStrip(Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); var density = Resources.DisplayMetrics.Density; var outValue = new TypedValue(); context.Theme.ResolveAttribute(Resource.Attribute.ColorForeground, outValue, true); var themeForeGround = outValue.Data; _mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DefaultBottomBorderColorAlpha); _mDefaultTabColorizer = new SimpleTabColorizer(); _mDefaultTabColorizer.IndicatorColors = _indicatorColors; _mDefaultTabColorizer.DividerColors = _dividerColors; _mBottomBorderThickness = (int) (DefaultBottomBorderThicknessDips*density); _mBottomBorderPaint = new Paint(); _mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray _mSelectedIndicatorThickness = (int) (SelectedIndicatorThicknessDips*density); _mSelectedIndicatorPaint = new Paint(); _mDividerHeight = DefaultDividerHeight; _mDividerPaint = new Paint(); _mDividerPaint.StrokeWidth = (int) (DefaultDividerThicknessDips*density); }
public SlidingTabStrip(Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); var density = Resources.DisplayMetrics.Density; var outValue = new TypedValue(); context.Theme.ResolveAttribute(Resource.Attribute.ColorForeground, outValue, true); var themeForeGround = outValue.Data; _mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DefaultBottomBorderColorAlpha); _mDefaultTabColorizer = new SimpleTabColorizer(); _mDefaultTabColorizer.IndicatorColors = _indicatorColors; _mDefaultTabColorizer.DividerColors = _dividerColors; _mBottomBorderThickness = (int)(DefaultBottomBorderThicknessDips * density); _mBottomBorderPaint = new Paint(); _mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray _mSelectedIndicatorThickness = (int)(SelectedIndicatorThicknessDips * density); _mSelectedIndicatorPaint = new Paint(); _mDividerHeight = DefaultDividerHeight; _mDividerPaint = new Paint(); _mDividerPaint.StrokeWidth = (int)(DefaultDividerThicknessDips * density); }
public SlidingTabStrip(Android.Content.Context context, IAttributeSet attrs) : base(context, attrs) { SetWillNotDraw(false); var density = Resources.DisplayMetrics.Density; var outValue = new TypedValue(); context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true); var themeForegroundColor = outValue.Data; _defaultBottomBorderColor = SetColorAlpha(themeForegroundColor, DefaultBottomBorderColorAlpha); _defaultTabColorizer = new SimpleTabColorizer(); _defaultTabColorizer.SetIndicatorColors(DefaultSelectedIndicatorColor); _bottomBorderThickness = (int)(DefaultBottomBorderThicknessDips * density); _bottomBorderPaint = new Paint(); _bottomBorderPaint.Color = _defaultBottomBorderColor; _selectedIndicatorThickness = (int)(SelectedIndicatorThicknessDips * density); _selectedIndicatorPaint = new Paint(); }