Skip to content

Commit

Permalink
Update: Add default indicator color and default icon size
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor-blue committed Jul 18, 2020
1 parent 99a2dc1 commit c1fd88e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 47 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ dependencies {
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_menu"
app:indicatorColor="@color/colorPrimary"
app:iconTintActive="@color/colorPrimary"
app:iconSize="24dp"
app:indicatorType="point"
app:indicatorPosition="bottom"
/>

</androidx.constraintlayout.widget.ConstraintLayout>
40 changes: 0 additions & 40 deletions app/src/main/res/navigation/nav_graph.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.annotation.Dimension
import androidx.annotation.XmlRes
import androidx.core.graphics.drawable.DrawableCompat
import kotlin.math.abs
import kotlin.math.roundToInt

/**
* Create by Nguyen Van Tan 7/2020
Expand Down Expand Up @@ -57,7 +58,7 @@ class NoNameBottomBar @JvmOverloads constructor(
}

@Dimension
var itemIconSize: Float = 0f
var itemIconSize: Float = (24f * resources.displayMetrics.density).roundToInt().toFloat()
set(@Dimension value) {
field = value
invalidate()
Expand Down Expand Up @@ -370,7 +371,7 @@ class NoNameBottomBar @JvmOverloads constructor(

companion object {
private const val INVALID_RES = -1
private const val DEFAULT_INDICATOR_COLOR = Color.WHITE
private const val DEFAULT_INDICATOR_COLOR = Color.GRAY
private const val OPAQUE = 255
private const val TRANSPARENT = 0
}
Expand Down

0 comments on commit c1fd88e

Please sign in to comment.