Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimsn98 committed May 29, 2020
1 parent 6648951 commit c8407e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ allprojects {
}
dependencies {
implementation 'com.github.ibrahimsn98:SmoothBottomBar:1.7.5'
implementation 'com.github.ibrahimsn98:SmoothBottomBar:1.7.6'
}
```

Expand Down
14 changes: 14 additions & 0 deletions lib/src/main/java/me/ibrahimsn/lib/SmoothBottomBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,51 +91,59 @@ class SmoothBottomBar @JvmOverloads constructor(
set(@ColorInt value) {
_barBackgroundColor = value
paintBackground.color = value
invalidate()
}

var barIndicatorColor: Int
@ColorInt get() = _barIndicatorColor
set(@ColorInt value) {
_barIndicatorColor = value
paintIndicator.color = value
invalidate()
}

var barIndicatorRadius: Float
@Dimension get() = _barIndicatorRadius
set(@Dimension value) {
_barIndicatorRadius = value
invalidate()
}

var barSideMargins: Float
@Dimension get() = _barSideMargins
set(@Dimension value) {
_barSideMargins = value
invalidate()
}

var barCornerRadius: Float
@Dimension get() = _barCornerRadius
set(@Dimension value) {
_barCornerRadius = value
invalidate()
}

var itemTextSize: Float
@Dimension get() = _itemTextSize
set(@Dimension value) {
_itemTextSize = value
paintText.textSize = value
invalidate()
}

var itemTextColor: Int
@ColorInt get() = _itemTextColor
set(@ColorInt value) {
_itemTextColor = value
paintText.color = value
invalidate()
}

var itemPadding: Float
@Dimension get() = _itemPadding
set(@Dimension value) {
_itemPadding = value
invalidate()
}

var itemAnimDuration: Long
Expand All @@ -148,24 +156,28 @@ class SmoothBottomBar @JvmOverloads constructor(
@Dimension get() = _itemIconSize
set(@Dimension value) {
_itemIconSize = value
invalidate()
}

var itemIconMargin: Float
@Dimension get() = _itemIconMargin
set(@Dimension value) {
_itemIconMargin = value
invalidate()
}

var itemIconTint: Int
@ColorInt get() = _itemIconTint
set(@ColorInt value) {
_itemIconTint = value
invalidate()
}

var itemIconTintActive: Int
@ColorInt get() = _itemIconTintActive
set(@ColorInt value) {
_itemIconTintActive = value
invalidate()
}

var itemFontFamily: Int
Expand All @@ -174,6 +186,7 @@ class SmoothBottomBar @JvmOverloads constructor(
_itemFontFamily = value
if (value != INVALID_RES) {
paintText.typeface = ResourcesCompat.getFont(context, value)
invalidate()
}
}

Expand All @@ -183,6 +196,7 @@ class SmoothBottomBar @JvmOverloads constructor(
_itemMenuRes = value
if (value != INVALID_RES) {
items = BottomBarParser(context, value).parse()
invalidate()
}
}

Expand Down

0 comments on commit c8407e0

Please sign in to comment.