From 9dbe9b48ebb66c86d82e7b02c7e8acb70bcd80d1 Mon Sep 17 00:00:00 2001 From: Alexander Dadukin Date: Sat, 5 Feb 2022 21:57:43 +0000 Subject: [PATCH] dependencies bumped. compile and target sdk are bumped also. --- app/build.gradle | 12 +++++----- build.gradle | 6 ++--- gradle.properties | 4 ++-- lib-expandablebottombar/build.gradle | 14 ++++++------ .../ExpandableBottomBarNavigationUI.kt | 22 +++++++------------ 5 files changed, 25 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 21a4c03..9a84366 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' } diff --git a/build.gradle b/build.gradle index 8634f19..0625c95 100644 --- a/build.gradle +++ b/build.gradle @@ -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" } } diff --git a/gradle.properties b/gradle.properties index 7a09f3d..5c070a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/lib-expandablebottombar/build.gradle b/lib-expandablebottombar/build.gradle index 60bcb35..1f3ef36 100644 --- a/lib-expandablebottombar/build.gradle +++ b/lib-expandablebottombar/build.gradle @@ -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') @@ -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' diff --git a/lib-expandablebottombar/src/main/java/github/com/st235/lib_expandablebottombar/navigation/ExpandableBottomBarNavigationUI.kt b/lib-expandablebottombar/src/main/java/github/com/st235/lib_expandablebottombar/navigation/ExpandableBottomBarNavigationUI.kt index bd29299..6e0a3b5 100644 --- a/lib-expandablebottombar/src/main/java/github/com/st235/lib_expandablebottombar/navigation/ExpandableBottomBarNavigationUI.kt +++ b/lib-expandablebottombar/src/main/java/github/com/st235/lib_expandablebottombar/navigation/ExpandableBottomBarNavigationUI.kt @@ -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 @@ -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() @@ -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 - } - }