Skip to content

Commit

Permalink
Merge pull request #80 from st235/bump/versions
Browse files Browse the repository at this point in the history
dependencies bumped. compile and target sdk are bumped also.
  • Loading branch information
st235 authored Feb 5, 2022
2 parents b6f3a68 + 9dbe9b4 commit e5c78f4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 33 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ android {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
implementation project(':lib-expandablebottombar')

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0'
}
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
buildscript {
ext.kotlin_version = '1.5.31'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android.useAndroidX=true

GROUP=com.github.st235

VERSION_CODE=46
VERSION_NAME=1.4.1
VERSION_CODE=153
VERSION_NAME=1.4.2

POM_DESCRIPTION=A new way to improve navigation in your app.
POM_URL=https://github.com/st235/ExpandableBottomBar
Expand Down
14 changes: 7 additions & 7 deletions lib-expandablebottombar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ androidExtensions {
}

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 31
versionCode project.property('VERSION_CODE') as int
versionName project.property('VERSION_NAME')

Expand Down Expand Up @@ -40,12 +40,12 @@ android {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.11.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import androidx.annotation.IdRes
import androidx.navigation.*
import androidx.navigation.NavController.OnDestinationChangedListener
import androidx.navigation.NavGraph.Companion.findStartDestination
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.lib_expandablebottombar.MenuItem
import github.com.st235.lib_expandablebottombar.R
Expand Down Expand Up @@ -66,10 +67,14 @@ object ExpandableBottomBarNavigationUI {
.setPopExitAnim(R.animator.nav_default_pop_exit_anim)
}

val topDestination = navController.findStartDestination()
val topDestination = navController.graph.findStartDestination()

topDestination?.let {
builder.setPopUpTo(it.id, false)
topDestination.let {
builder.setPopUpTo(
it.id,
inclusive = false,
saveState = true
)
}

val options = builder.build()
Expand All @@ -89,15 +94,4 @@ object ExpandableBottomBarNavigationUI {
return currentDestination.id == destId
}

private fun NavController.findStartDestination(): NavDestination? {
var startDestination: NavDestination? = graph

while (startDestination is NavGraph) {
val parent = startDestination
startDestination = parent.findNode(parent.startDestination)
}

return startDestination
}

}

0 comments on commit e5c78f4

Please sign in to comment.