From 4c6479277ef5cadc6502f1ed2e96030964db682c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olive=CC=81r=20Falvai?= Date: Thu, 11 Aug 2022 08:52:41 +0200 Subject: [PATCH] Fine-tune lint rules --- app/build.gradle | 3 +- .../ofalvai/habittracker/ui/MainActivity.kt | 10 +++--- lint.xml | 33 +++++++++++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 lint.xml diff --git a/app/build.gradle b/app/build.gradle index dba570d1..a6f49684 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,13 +41,12 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - manifestPlaceholders = [api_key_bugsnag: "${API_KEY_BUGSNAG}"] + manifestPlaceholders += ["api_key_bugsnag": "${API_KEY_BUGSNAG}"] buildConfigField("String", "URL_PRIVACY_POLICY", "\"$URL_PRIVACY_POLICY\"") buildConfigField("String", "URL_SOURCE_CODE", "\"$URL_SOURCE_CODE\"") } lint { - enable 'DuplicateStrings', 'NewerVersionAvailable' abortOnError true ignoreTestSources true } diff --git a/app/src/main/java/com/ofalvai/habittracker/ui/MainActivity.kt b/app/src/main/java/com/ofalvai/habittracker/ui/MainActivity.kt index 9ad8320e..c4b8adb0 100644 --- a/app/src/main/java/com/ofalvai/habittracker/ui/MainActivity.kt +++ b/app/src/main/java/com/ofalvai/habittracker/ui/MainActivity.kt @@ -170,14 +170,14 @@ private fun AppBottomNavigation(navController: NavController) { AppBottomNavigationItem( rootScreen = Destination.Dashboard, - icon = { Icon(CoreIcons.Habits, stringResource(R.string.tab_dashboard)) }, + content = { Icon(CoreIcons.Habits, stringResource(R.string.tab_dashboard)) }, label = stringResource(R.string.tab_dashboard), currentDestination = currentDestination, navController = navController ) AppBottomNavigationItem( rootScreen = Destination.Insights, - icon = { Icon(AppIcons.Insights, stringResource(R.string.tab_insights)) }, + content = { Icon(AppIcons.Insights, stringResource(R.string.tab_insights)) }, label = stringResource(R.string.tab_insights), currentDestination = currentDestination, navController = navController @@ -189,13 +189,13 @@ private fun AppBottomNavigation(navController: NavController) { @Composable private fun RowScope.AppBottomNavigationItem( rootScreen: Screen, - icon: @Composable () -> Unit, label: String, currentDestination: NavDestination?, - navController: NavController + navController: NavController, + content: @Composable () -> Unit ) { BottomNavigationItem( - icon = icon, + icon = content, selected = currentDestination?.hierarchy?.any { it.route == rootScreen.route } == true, onClick = { navController.navigate(rootScreen.route) { diff --git a/lint.xml b/lint.xml new file mode 100644 index 00000000..eccdad29 --- /dev/null +++ b/lint.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file