Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ class BezierView @JvmOverloads constructor(
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
width = MeasureSpec.getSize(widthMeasureSpec).toFloat()
height = MeasureSpec.getSize(heightMeasureSpec).toFloat()
bezierOuterWidth = 72f.dp(context)
bezierOuterHeight = 8f.dp(context)
bezierInnerWidth = 124f.dp(context)
bezierOuterWidth = 0f.dp(context)
bezierOuterHeight = 20f.dp(context)
bezierInnerWidth = 150f.dp(context)
bezierInnerHeight = 16f.dp(context)

val extra = shadowHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ class MeowBottomNavigation : FrameLayout {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
if (selectedId == -1) {
bezierView.bezierX =
if (Build.VERSION.SDK_INT >= 17 && layoutDirection == LayoutDirection.RTL) measuredWidth + 72f.dp(
if (Build.VERSION.SDK_INT >= 17 && layoutDirection == LayoutDirection.RTL) measuredWidth + 0f.dp(
context
) else (-72f).dp(context)
) else (-0f).dp(context)
}
if (selectedId != -1) {
show(selectedId, false)
Expand All @@ -217,6 +217,7 @@ class MeowBottomNavigation : FrameLayout {
layoutParams = params
icon = model.icon
count = model.count
title = model.title
defaultIconColor = this@MeowBottomNavigation.defaultIconColor
selectedIconColor = this@MeowBottomNavigation.selectedIconColor
circleColor = this@MeowBottomNavigation.circleColor
Expand Down Expand Up @@ -382,7 +383,7 @@ class MeowBottomNavigation : FrameLayout {
onReselectListener = listener
}

class Model(var id: Int, var icon: Int) {
class Model(var id: Int, var icon: Int, var title: String) {

var count: String = MeowBottomNavigationCell.EMPTY_VALUE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class MeowBottomNavigationCell @JvmOverloads constructor(

companion object {
const val EMPTY_VALUE = "empty"

}

private val binding = DataBindingUtil.inflate<MeowNavigationCellBinding>(
Expand Down Expand Up @@ -95,6 +96,14 @@ class MeowBottomNavigationCell @JvmOverloads constructor(
binding.iv.setImageResource(value)
}

var title: String? = EMPTY_VALUE
set(value) {
field = value
if (allowDraw) {
binding.tvTitle.text = title
}
}

var count: String? =
EMPTY_VALUE
set(value) {
Expand Down
14 changes: 12 additions & 2 deletions MeowBottomNavigation/src/main/res/layout/meow_navigation_cell.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,18 @@
android:textSize="8dp"
tools:ignore="RtlHardcoded,SpUsage" />

<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginTop="32dp"
android:gravity="center"
android:includeFontPadding="false"
android:minWidth="16dp"
android:textDirection="ltr"
android:textSize="10sp"
tools:ignore="RtlHardCoded, SpUsage" />
</FrameLayout>

</merge>

</layout>
Binary file not shown.
Loading