diff --git a/CHANGELOG.md b/CHANGELOG.md index a3801637..ffb9123d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Compatibility updates for Android 15 & 16 + ## [1.1.0] - 2025-07-05 ### Added diff --git a/app/detekt-baseline.xml b/app/detekt-baseline.xml index b15a01cf..c200b6ef 100644 --- a/app/detekt-baseline.xml +++ b/app/detekt-baseline.xml @@ -27,8 +27,6 @@ NestedBlockDepth:CalculatorImpl.kt$CalculatorImpl$fun handleOperation(operation: String) NestedBlockDepth:ConverterView.kt$ConverterView$fun deleteCharacter() NestedBlockDepth:ConverterView.kt$ConverterView$private fun updateBottomValue() - ReturnCount:CalculatorImpl.kt$CalculatorImpl$fun turnToNegative(): Boolean - ReturnCount:ConverterView.kt$ConverterView$private fun checkTemperatureLimits(value: String): String TooGenericExceptionCaught:Context.kt$e: Exception TooManyFunctions:CalculatorImpl.kt$CalculatorImpl TooManyFunctions:ConverterView.kt$ConverterView : LinearLayout diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index 50999218..c122325c 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -8,7 +8,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -20,7 +20,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -32,7 +32,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -44,7 +44,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -56,7 +56,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -68,7 +68,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -80,7 +80,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -92,7 +92,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -104,7 +104,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -116,7 +116,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -128,7 +128,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -140,7 +140,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -152,7 +152,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -164,7 +164,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -176,7 +176,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -188,7 +188,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -200,7 +200,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -212,7 +212,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -224,7 +224,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> @@ -236,7 +236,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -248,7 +248,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -260,7 +260,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -272,7 +272,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -284,17 +284,6 @@ file="src/main/AndroidManifest.xml"/> - - - - @@ -345,7 +334,7 @@ errorLine1="gradlePlugins-agp = "8.11.1"" errorLine2=" ~~~~~~~~"> @@ -356,7 +345,7 @@ errorLine1="androidx-lifecycle = "2.8.7"" errorLine2=" ~~~~~~~"> @@ -367,7 +356,7 @@ errorLine1="androidx-lifecycle = "2.8.7"" errorLine2=" ~~~~~~~"> @@ -378,7 +367,7 @@ errorLine1="androidx-lifecycle = "2.8.7"" errorLine2=" ~~~~~~~"> @@ -389,7 +378,7 @@ errorLine1="androidx-lifecycle = "2.8.7"" errorLine2=" ~~~~~~~"> @@ -400,62 +389,62 @@ errorLine1="composeActivity = "1.9.3"" errorLine2=" ~~~~~~~"> @@ -466,7 +455,7 @@ errorLine1="compose = "1.7.8"" errorLine2=" ~~~~~~~"> @@ -477,20 +466,42 @@ errorLine1="composeMaterial3 = "1.3.2"" errorLine2=" ~~~~~~~"> + message="A newer version of androidx.room:room-compiler than 2.8.2 is available: 2.8.3" + errorLine1="room = "2.8.2"" + errorLine2=" ~~~~~~~"> + file="$HOME/Projects/Fossify/FossifyOrg/Calculator/gradle/libs.versions.toml" + line="22" + column="8"/> + + + + + + + + + + + + + + + + @@ -1629,7 +1662,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1640,7 +1673,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1651,7 +1684,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1871,7 +1904,7 @@ errorLine2=" ~~~~~~~~"> @@ -1882,7 +1915,7 @@ errorLine2=" ~~~~~~"> diff --git a/app/src/main/kotlin/org/fossify/math/activities/MainActivity.kt b/app/src/main/kotlin/org/fossify/math/activities/MainActivity.kt index 0e7f6ffd..990d72a6 100644 --- a/app/src/main/kotlin/org/fossify/math/activities/MainActivity.kt +++ b/app/src/main/kotlin/org/fossify/math/activities/MainActivity.kt @@ -51,19 +51,13 @@ class MainActivity : SimpleActivity(), Calculator { private val binding by viewBinding(ActivityMainBinding::inflate) override fun onCreate(savedInstanceState: Bundle?) { - isMaterialActivity = true super.onCreate(savedInstanceState) setContentView(binding.root) appLaunched(BuildConfig.APPLICATION_ID) setupOptionsMenu() refreshMenuItems() - updateMaterialActivityViews( - mainCoordinatorLayout = binding.mainCoordinator, - nestedView = null, - useTransparentNavigation = false, - useTopSearchMenu = false - ) - setupMaterialScrollListener(binding.mainNestedScrollview, binding.mainToolbar) + setupEdgeToEdge(padBottomSystem = listOf(binding.mainNestedScrollview)) + setupMaterialScrollListener(binding.mainNestedScrollview, binding.mainAppbar!!) if (savedInstanceState != null) { saveCalculatorState = savedInstanceState.getCharSequence(CALCULATOR_STATE) as String @@ -107,7 +101,8 @@ class MainActivity : SimpleActivity(), Calculator { override fun onResume() { super.onResume() - setupToolbar(binding.mainToolbar) + setupTopAppBar(binding.mainAppbar!!) + setupMaterialScrollListener(binding.mainNestedScrollview, binding.mainAppbar) if (storedTextColor != config.textColor) { binding.calculatorHolder?.let { updateViewColors(it, getProperTextColor()) } } diff --git a/app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt b/app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt index 34149ed8..2b1cb435 100644 --- a/app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt +++ b/app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt @@ -39,7 +39,6 @@ class UnitConverterActivity : SimpleActivity(), ConverterView.OnUnitChangedListe } override fun onCreate(savedInstanceState: Bundle?) { - isMaterialActivity = true super.onCreate(savedInstanceState) setContentView(binding.root) @@ -48,13 +47,8 @@ class UnitConverterActivity : SimpleActivity(), ConverterView.OnUnitChangedListe setupOptionsMenu() } - updateMaterialActivityViews( - mainCoordinatorLayout = binding.unitConverterCoordinator, - nestedView = null, - useTransparentNavigation = false, - useTopSearchMenu = false - ) - setupMaterialScrollListener(binding.nestedScrollview, binding.unitConverterToolbar) + setupEdgeToEdge(padBottomSystem = listOf(binding.nestedScrollview)) + setupMaterialScrollListener(binding.nestedScrollview, binding.unitConverterAppbar) val converter = Converter.ALL.getOrNull(intent.getIntExtra(EXTRA_CONVERTER_ID, 0)) @@ -114,7 +108,7 @@ class UnitConverterActivity : SimpleActivity(), ConverterView.OnUnitChangedListe override fun onResume() { super.onResume() - setupToolbar(binding.unitConverterToolbar, NavigationIcon.Arrow) + setupTopAppBar(binding.unitConverterAppbar, NavigationIcon.Arrow) binding.viewUnitConverter.viewConverter.root.updateColors() binding.viewUnitConverter.converterHolder.let { updateViewColors(it, getProperTextColor()) diff --git a/app/src/main/kotlin/org/fossify/math/activities/UnitConverterPickerActivity.kt b/app/src/main/kotlin/org/fossify/math/activities/UnitConverterPickerActivity.kt index 09e172a8..c9c9b04f 100644 --- a/app/src/main/kotlin/org/fossify/math/activities/UnitConverterPickerActivity.kt +++ b/app/src/main/kotlin/org/fossify/math/activities/UnitConverterPickerActivity.kt @@ -16,16 +16,13 @@ class UnitConverterPickerActivity : SimpleActivity() { private val binding by viewBinding(ActivityUnitConverterPickerBinding::inflate) override fun onCreate(savedInstanceState: Bundle?) { - isMaterialActivity = true super.onCreate(savedInstanceState) setContentView(binding.root) - updateMaterialActivityViews( - mainCoordinatorLayout = binding.unitConverterPickerCoordinator, - nestedView = null, - useTransparentNavigation = false, - useTopSearchMenu = false + setupEdgeToEdge(padBottomSystem = listOf(binding.unitTypesGrid)) + setupMaterialScrollListener( + binding.unitTypesGrid, + binding.unitConverterPickerAppbar ) - setupMaterialScrollListener(binding.unitTypesGrid, binding.unitConverterPickerToolbar) binding.unitTypesGrid.layoutManager = AutoGridLayoutManager(this, resources.getDimensionPixelSize(R.dimen.unit_type_size)) @@ -42,7 +39,7 @@ class UnitConverterPickerActivity : SimpleActivity() { override fun onResume() { super.onResume() - setupToolbar(binding.unitConverterPickerToolbar, NavigationIcon.Arrow) + setupTopAppBar(binding.unitConverterPickerAppbar, NavigationIcon.Arrow) if (config.preventPhoneFromSleeping) { window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) diff --git a/app/src/main/kotlin/org/fossify/math/activities/WidgetConfigureActivity.kt b/app/src/main/kotlin/org/fossify/math/activities/WidgetConfigureActivity.kt index a835c1b0..f8228a78 100644 --- a/app/src/main/kotlin/org/fossify/math/activities/WidgetConfigureActivity.kt +++ b/app/src/main/kotlin/org/fossify/math/activities/WidgetConfigureActivity.kt @@ -40,6 +40,7 @@ class WidgetConfigureActivity : SimpleActivity() { super.onCreate(savedInstanceState) setResult(RESULT_CANCELED) setContentView(binding.root) + setupEdgeToEdge(padTopSystem = listOf(binding.root), padBottomSystem = listOf(binding.root)) initVariables() val isCustomizingColors = intent.extras?.getBoolean(IS_CUSTOMIZING_COLORS) ?: false diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index 1a74e1b7..c3265bfd 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -8,21 +8,28 @@ tools:context="org.fossify.math.activities.MainActivity" tools:ignore="HardcodedText"> - + android:layout_height="wrap_content"> + + + + + android:scrollbars="none" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:layout_height="wrap_content"> + + + + + android:scrollbars="none" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:layout_height="wrap_content"> + + + + + android:scrollbars="none" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:layout_height="wrap_content"> + + + + diff --git a/detekt.yml b/detekt.yml index 6472c5a3..73ddc0c1 100644 --- a/detekt.yml +++ b/detekt.yml @@ -40,6 +40,11 @@ style: maxLineLength: 120 excludePackageStatements: true excludeImportStatements: true + ReturnCount: + active: true + max: 4 + excludeGuardClauses: true + excludes: ["**/test/**", "**/androidTest/**"] naming: FunctionNaming: diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f26ff4cb..9368d2db 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,12 +21,12 @@ evalex = "3.5.0" #Room room = "2.8.2" #Fossify -commons = "5.4.0" +commons = "5.5.0" #Gradle gradlePlugins-agp = "8.11.1" #build -app-build-compileSDKVersion = "34" -app-build-targetSDK = "34" +app-build-compileSDKVersion = "36" +app-build-targetSDK = "36" app-build-minimumSDK = "26" app-build-javaVersion = "VERSION_17" app-build-kotlinJVMTarget = "17" diff --git a/settings.gradle.kts b/settings.gradle.kts index 45478cbe..94d40dbf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,6 +11,7 @@ dependencyResolutionManagement { google() mavenCentral() maven { setUrl("https://jitpack.io") } + mavenLocal() } } include(":app")