diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 88ea3aa..3cc336b 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -1,6 +1,22 @@
+
+
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 0a1e86f..bf9687e 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -5,42 +5,42 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index a165c15..83371d4 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -11,12 +11,13 @@
+
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index a5f05cd..17a311c 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -21,5 +21,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 7bfef59..d5d35ec 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/MeowBottomNavigation/.gitignore b/MeowBottomNavigationTextSupport/.gitignore
similarity index 100%
rename from MeowBottomNavigation/.gitignore
rename to MeowBottomNavigationTextSupport/.gitignore
diff --git a/MeowBottomNavigation/build.gradle.kts b/MeowBottomNavigationTextSupport/build.gradle.kts
similarity index 69%
rename from MeowBottomNavigation/build.gradle.kts
rename to MeowBottomNavigationTextSupport/build.gradle.kts
index 20edbe8..ed3c07d 100644
--- a/MeowBottomNavigation/build.gradle.kts
+++ b/MeowBottomNavigationTextSupport/build.gradle.kts
@@ -1,16 +1,14 @@
-import com.jfrog.bintray.gradle.BintrayExtension
+//import com.jfrog.bintray.gradle.BintrayExtension
import meow.AppConfig
import meow.AppConfig.Dependencies
import meow.AppConfig.Publishing
import meow.AppConfig.Versions
-import meow.getPropertyAny
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.android.library")
kotlin("android")
- `maven-publish`
- id("com.jfrog.bintray") version "1.8.5"
+ id("com.github.dcendents.android-maven")
}
group = Publishing.groupId
@@ -69,7 +67,7 @@ android {
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
-
+ implementation ("com.intuit.sdp:sdp-android:1.0.6")
// Implementation Dependencies
Dependencies.implementationItems.forEach {
implementation(it)
@@ -95,40 +93,40 @@ sourceSets.create("main") {
java.excludes.add("**/build/**")
resources.srcDirs("${meow.AppConfig.Build.SRC_MAIN}res")
}
-
-publishing {
- publications {
- create(publicationName) {
- groupId = project.group.toString()
- artifactId = Publishing.artifactId
- version = project.version.toString()
-
- pom.withXml {
- val dependenciesNode = asNode().appendNode("dependencies")
- val configurationNames = arrayOf("implementation", "api")
- configurationNames.forEach { c ->
- configurations[c].allDependencies.forEach {
- if (it.group != null) {
- val dependencyNode = dependenciesNode.appendNode("dependency")
- dependencyNode.appendNode("groupId", it.group)
- dependencyNode.appendNode("artifactId", it.name)
- dependencyNode.appendNode("version", it.version)
- }
- }
- }
- }
-
- val sourcesJar by tasks.registering(Jar::class) {
- archiveClassifier.convention("sources")
- from(project.sourceSets["main"].allSource)
- }
-
- artifact("$buildDir/outputs/aar/MeowBottomNavigation-release.aar")
- artifact(sourcesJar.get())
- }
- }
-}
-
+//
+//publishing {
+// publications {
+// create(publicationName) {
+// groupId = project.group.toString()
+// artifactId = Publishing.artifactId
+// version = project.version.toString()
+//
+// pom.withXml {
+// val dependenciesNode = asNode().appendNode("dependencies")
+// val configurationNames = arrayOf("implementation", "api")
+// configurationNames.forEach { c ->
+// configurations[c].allDependencies.forEach {
+// if (it.group != null) {
+// val dependencyNode = dependenciesNode.appendNode("dependency")
+// dependencyNode.appendNode("groupId", it.group)
+// dependencyNode.appendNode("artifactId", it.name)
+// dependencyNode.appendNode("version", it.version)
+// }
+// }
+// }
+// }
+//
+// val sourcesJar by tasks.registering(Jar::class) {
+// archiveClassifier.convention("sources")
+// from(project.sourceSets["main"].allSource)
+// }
+//
+// artifact("$buildDir/outputs/aar/MeowBottomNavigation-release.aar")
+// artifact(sourcesJar.get())
+// }
+// }
+//}
+/*
bintray {
user = getPropertyAny("bintray.user")
key = getPropertyAny("bintray.key")
@@ -156,4 +154,4 @@ bintray {
)
publicDownloadNumbers = true
})
-}
\ No newline at end of file
+}*/
diff --git a/MeowBottomNavigation/proguard-rules.pro b/MeowBottomNavigationTextSupport/proguard-rules.pro
similarity index 100%
rename from MeowBottomNavigation/proguard-rules.pro
rename to MeowBottomNavigationTextSupport/proguard-rules.pro
diff --git a/MeowBottomNavigation/src/main/AndroidManifest.xml b/MeowBottomNavigationTextSupport/src/main/AndroidManifest.xml
similarity index 100%
rename from MeowBottomNavigation/src/main/AndroidManifest.xml
rename to MeowBottomNavigationTextSupport/src/main/AndroidManifest.xml
diff --git a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/BezierView.kt b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/BezierView.kt
similarity index 97%
rename from MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/BezierView.kt
rename to MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/BezierView.kt
index 4c4b588..a8b5423 100644
--- a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/BezierView.kt
+++ b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/BezierView.kt
@@ -16,15 +16,14 @@
package meow.bottomnavigation
+import android.R
import android.annotation.SuppressLint
import android.content.Context
-import android.graphics.Canvas
-import android.graphics.Paint
-import android.graphics.Path
-import android.graphics.PointF
+import android.graphics.*
import android.util.AttributeSet
import android.view.View
+
/**
* Bezier View class.
*
@@ -49,6 +48,7 @@ class BezierView @JvmOverloads constructor(
private var width = 0f
private var height = 0f
+ private var bgRes = 0
private var bezierOuterWidth = 0f
private var bezierOuterHeight = 0f
private var bezierInnerWidth = 0f
@@ -61,6 +61,13 @@ class BezierView @JvmOverloads constructor(
mainPaint?.color = field
invalidate()
}
+ var backgroundResourceId = 0
+ set(value) {
+ if (value != 0) {
+ field=value;
+ invalidate()
+ }
+ }
var shadowColor = 0
set(value) {
field = value
@@ -118,6 +125,7 @@ class BezierView @JvmOverloads constructor(
isAntiAlias = true
style = Paint.Style.FILL
color = this@BezierView.color
+
}
shadowPaint = Paint(Paint.ANTI_ALIAS_FLAG)
diff --git a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigation.kt b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigation.kt
similarity index 93%
rename from MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigation.kt
rename to MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigation.kt
index dfca858..fcdd964 100644
--- a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigation.kt
+++ b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigation.kt
@@ -25,12 +25,14 @@ import android.graphics.Typeface
import android.os.Build
import android.util.AttributeSet
import android.util.LayoutDirection
+import android.util.Log
import android.view.Gravity
import android.widget.FrameLayout
import android.widget.LinearLayout
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
import com.etebarian.meowbottomnavigation.R
import kotlin.math.abs
+import kotlin.math.roundToInt
/**
* Meow Bottom Navigation Cell class.
@@ -74,6 +76,7 @@ class MeowBottomNavigation : FrameLayout {
field = value
updateAllIfAllowDraw()
}
+
var circleColor = Color.parseColor("#ffffff")
set(value) {
field = value
@@ -85,6 +88,11 @@ class MeowBottomNavigation : FrameLayout {
field = value
updateAllIfAllowDraw()
}
+ var titleTextColor = Color.parseColor("#000000")
+ set(value) {
+ field = value
+ updateAllIfAllowDraw()
+ }
var countBackgroundColor = Color.parseColor("#ff0000")
set(value) {
field = value
@@ -104,12 +112,14 @@ class MeowBottomNavigation : FrameLayout {
private var allowDraw = false
+
@Suppress("PrivatePropertyName")
private lateinit var ll_cells: LinearLayout
private lateinit var bezierView: BezierView
init {
- heightCell = 96.dp(context)
+ heightCell = context.resources.getDimension(R.dimen._30sdp).toInt()
+ heightCell=heightCell.dp(context)
}
constructor(context: Context) : super(context) {
@@ -149,10 +159,15 @@ class MeowBottomNavigation : FrameLayout {
R.styleable.MeowBottomNavigation_mbn_backgroundBottomColor,
backgroundBottomColor
)
+ heightCell =
+ getDimension(R.styleable.MeowBottomNavigation_mbn_height,heightCell.toFloat()).roundToInt()
+
circleColor =
getColor(R.styleable.MeowBottomNavigation_mbn_circleColor, circleColor)
countTextColor =
getColor(R.styleable.MeowBottomNavigation_mbn_countTextColor, countTextColor)
+ titleTextColor =
+ getColor(R.styleable.MeowBottomNavigation_mbn_titleTextColor, titleTextColor)
countBackgroundColor = getColor(
R.styleable.MeowBottomNavigation_mbn_countBackgroundColor,
countBackgroundColor
@@ -191,7 +206,7 @@ class MeowBottomNavigation : FrameLayout {
color = backgroundBottomColor
shadowColor = this@MeowBottomNavigation.shadowColor
}
-
+ Log.e("DIMEN", heightCell.toString())
addView(bezierView)
addView(ll_cells)
allowDraw = true
@@ -217,10 +232,12 @@ 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
countTextColor = this@MeowBottomNavigation.countTextColor
+ titleTextColor = this@MeowBottomNavigation.titleTextColor
countBackgroundColor = this@MeowBottomNavigation.countBackgroundColor
countTypeface = this@MeowBottomNavigation.countTypeface
rippleColor = this@MeowBottomNavigation.rippleColor
@@ -299,6 +316,7 @@ class MeowBottomNavigation : FrameLayout {
addUpdateListener {
val f = it.animatedFraction
bezierView.progress = f * 2f
+
}
start()
}
@@ -382,8 +400,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
}
diff --git a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigationCell.kt b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigationCell.kt
similarity index 92%
rename from MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigationCell.kt
rename to MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigationCell.kt
index c58076e..fd7fd35 100644
--- a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigationCell.kt
+++ b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/MeowBottomNavigationCell.kt
@@ -116,6 +116,22 @@ class MeowBottomNavigationCell @JvmOverloads constructor(
}
}
+ var title: String? =
+ EMPTY_VALUE
+ set(value) {
+ field = value
+ if (allowDraw) {
+ if (title != null && title == EMPTY_VALUE) {
+ binding.tvCount.text = ""
+ binding.tvCount.visibility = View.INVISIBLE
+ } else {
+ binding.tvTitle.text = title
+ binding.tvTitle.visibility = View.VISIBLE
+
+ }
+ }
+ }
+
private var iconSize = 48f.dp(context)
set(value) {
field = value
@@ -136,6 +152,13 @@ class MeowBottomNavigationCell @JvmOverloads constructor(
binding.tvCount.setTextColor(field)
}
+ var titleTextColor = 0
+ set(value) {
+ field = value
+ if (allowDraw)
+ binding.tvTitle.setTextColor(field)
+ }
+
var countBackgroundColor = 0
set(value) {
field = value
@@ -257,6 +280,7 @@ class MeowBottomNavigationCell @JvmOverloads constructor(
private fun animateProgress(enableCell: Boolean, isAnimate: Boolean = true) {
val d = if (enableCell) duration else 250
val anim = ValueAnimator.ofFloat(0f, 1f)
+ binding.tvTitle?.visibility = if (enableCell) View.GONE else View.VISIBLE
anim.apply {
startDelay = if (enableCell) d / 4 else 0L
duration = if (isAnimate) d else 1L
diff --git a/MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/Utils.kt b/MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/Utils.kt
similarity index 100%
rename from MeowBottomNavigation/src/main/kotlin/meow/bottomnavigation/Utils.kt
rename to MeowBottomNavigationTextSupport/src/main/kotlin/meow/bottomnavigation/Utils.kt
diff --git a/MeowBottomNavigation/src/main/res/layout/meow_navigation_cell.xml b/MeowBottomNavigationTextSupport/src/main/res/layout/meow_navigation_cell.xml
similarity index 72%
rename from MeowBottomNavigation/src/main/res/layout/meow_navigation_cell.xml
rename to MeowBottomNavigationTextSupport/src/main/res/layout/meow_navigation_cell.xml
index 2747f24..43b75fe 100644
--- a/MeowBottomNavigation/src/main/res/layout/meow_navigation_cell.xml
+++ b/MeowBottomNavigationTextSupport/src/main/res/layout/meow_navigation_cell.xml
@@ -39,6 +39,18 @@
android:textDirection="ltr"
android:textSize="8dp"
tools:ignore="RtlHardcoded,SpUsage" />
+
diff --git a/MeowBottomNavigation/src/main/res/values/attrs.xml b/MeowBottomNavigationTextSupport/src/main/res/values/attrs.xml
similarity index 79%
rename from MeowBottomNavigation/src/main/res/values/attrs.xml
rename to MeowBottomNavigationTextSupport/src/main/res/values/attrs.xml
index 7ead227..33066b3 100644
--- a/MeowBottomNavigation/src/main/res/values/attrs.xml
+++ b/MeowBottomNavigationTextSupport/src/main/res/values/attrs.xml
@@ -5,8 +5,11 @@
+
+
+
diff --git a/MeowBottomNavigation/src/main/res/values/strings.xml b/MeowBottomNavigationTextSupport/src/main/res/values/strings.xml
similarity index 100%
rename from MeowBottomNavigation/src/main/res/values/strings.xml
rename to MeowBottomNavigationTextSupport/src/main/res/values/strings.xml
diff --git a/Sample/build.gradle.kts b/Sample/build.gradle.kts
index 4d051f5..9f14677 100644
--- a/Sample/build.gradle.kts
+++ b/Sample/build.gradle.kts
@@ -78,9 +78,7 @@ tasks {
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
-
- implementation(project(":MeowBottomNavigation"))
-
+ implementation(project(":MeowBottomNavigationTextSupport"))
// Implementation Dependencies
Dependencies.implementationItems.forEach {
implementation(it)
diff --git a/Sample/src/main/kotlin/meow/bottomnavigation_sample/MainActivity.kt b/Sample/src/main/kotlin/meow/bottomnavigation_sample/MainActivity.kt
index ec5ebdc..58973ac 100644
--- a/Sample/src/main/kotlin/meow/bottomnavigation_sample/MainActivity.kt
+++ b/Sample/src/main/kotlin/meow/bottomnavigation_sample/MainActivity.kt
@@ -39,37 +39,41 @@ class MainActivity : AppCompatActivity() {
val tvSelected = binding.tvSelected
tvSelected.typeface = Typeface.createFromAsset(assets, "fonts/SourceSansPro-Regular.ttf")
-
binding.bottomNavigation.apply {
add(
MeowBottomNavigation.Model(
ID_HOME,
- R.drawable.ic_home
+ R.drawable.ic_home,
+ "Home"
)
)
add(
MeowBottomNavigation.Model(
ID_EXPLORE,
- R.drawable.ic_explore
+ R.drawable.ic_explore,
+ "Explore"
)
)
add(
MeowBottomNavigation.Model(
ID_MESSAGE,
- R.drawable.ic_message
+ R.drawable.ic_message,
+ "Messages"
)
)
add(
MeowBottomNavigation.Model(
ID_NOTIFICATION,
- R.drawable.ic_notification
+ R.drawable.ic_notification,
+ "Notification"
)
)
add(
MeowBottomNavigation.Model(
ID_ACCOUNT,
- R.drawable.ic_account
+ R.drawable.ic_account,
+ "Account"
)
)
diff --git a/Sample/src/main/res/layout/activity_main.xml b/Sample/src/main/res/layout/activity_main.xml
index 529d808..6746023 100644
--- a/Sample/src/main/res/layout/activity_main.xml
+++ b/Sample/src/main/res/layout/activity_main.xml
@@ -54,6 +54,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:mbn_circleColor="#ffffff"
+ app:mbn_height="78dip"
app:mbn_backgroundBottomColor="#ffffff"
app:mbn_countBackgroundColor="#ff6f00"
app:mbn_countTextColor="#ffffff"
diff --git a/build.gradle.kts b/build.gradle.kts
index 5365e11..540e7d7 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,8 +7,9 @@ buildscript {
}
dependencies {
- classpath("com.android.tools.build:gradle:4.0.0")
+ classpath("com.android.tools.build:gradle:4.1.1")
classpath(kotlin("gradle-plugin", kotlinVersion))
+ classpath ("com.github.dcendents:android-maven-gradle-plugin:2.1")
}
}
@@ -21,6 +22,10 @@ allprojects {
repositories {
google()
jcenter()
+ maven {
+ url = uri("https://dl.bintray.com/chrynan/chrynan")
+ }
+ maven { url =uri("https://jitpack.io") }
}
}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 5a1d5d4..4113135 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -8,4 +8,7 @@ kotlinDslPluginOptions {
repositories {
jcenter()
+ maven {
+ url = uri("https://dl.bintray.com/chrynan/chrynan")
+ }
}
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ff3076f..3a4547a 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Feb 11 12:58:49 IRST 2019
+#Mon Dec 21 11:27:51 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 45a2f9b..9377bc0 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,2 +1,2 @@
rootProject.name = "MeowBottomNavigation"
-include(":Sample", ":MeowBottomNavigation")
\ No newline at end of file
+include(":Sample", ":MeowBottomNavigationTextSupport")
\ No newline at end of file