Skip to content

Commit f2f8e2f

Browse files
authored
chore: bump target SDK version to 35 (#134)
* chore: bump target SDK version to 35 * chore: bump target SDK version to 36 * refactor: update edge-to-edge implementation * refactor: update edge-to-edge implementation * refactor: update edge-to-edge implementation * refactor: migrate away from deprecated onBackPressed() * chore(deps): update org.fossify.commons to 5.5.0 * docs: update changelog * style: shorten line * build: bump detekt return count limit * chore: update lint baselines
1 parent de8e243 commit f2f8e2f

File tree

9 files changed

+89
-92
lines changed

9 files changed

+89
-92
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Compatibility updates for Android 15 & 16
12+
913
## [1.3.1] - 2025-10-05
1014
### Changed
1115
- Updated translations

app/detekt-baseline.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
<ID>MaxLineLength:CameraErrorHandler.kt$CameraErrorHandler$VideoRecordEvent.Finalize.ERROR_INSUFFICIENT_STORAGE -&gt; context.toast(R.string.video_capture_insufficient_storage_error)</ID>
7474
<ID>MaxLineLength:ImageUtil.kt$ImageUtil$require(image.format == ImageFormat.YUV_420_888) { "Incorrect image format of the input image proxy: " + image.format }</ID>
7575
<ID>MaxLineLength:MainActivity.kt$MainActivity$if</ID>
76-
<ID>MaxLineLength:MainActivity.kt$MainActivity$safeInsetBottom + navigationBarHeight + resources.getDimensionPixelSize(org.fossify.commons.R.dimen.bigger_margin)</ID>
7776
<ID>MaxLineLength:MainActivity.kt$MainActivity$}</ID>
7877
<ID>MaxLineLength:SettingsActivity.kt$SettingsActivity$it.beGoneIf(settingsUseEnglishHolder.isGone() &amp;&amp; settingsPurchaseThankYouHolder.isGone() &amp;&amp; settingsLanguageHolder.isGone())</ID>
7978
<ID>MaxLineLength:SettingsActivity.kt$SettingsActivity$settingsUseEnglishHolder.beVisibleIf((config.wasUseEnglishToggled || Locale.getDefault().language != "en") &amp;&amp; !isTiramisuPlus())</ID>
@@ -85,12 +84,7 @@
8584
<ID>NestedBlockDepth:MediaOutputHelper.kt$MediaOutputHelper$private fun getUriForFilePath(path: String): Uri?</ID>
8685
<ID>NestedBlockDepth:PhotoProcessor.kt$PhotoProcessor$override fun doInBackground(vararg params: ByteArray): String</ID>
8786
<ID>NestedBlockDepth:VideoQualityManager.kt$VideoQualityManager$fun initSupportedQualities(cameraProvider: ProcessCameraProvider)</ID>
88-
<ID>ReturnCount:ImageSaver.kt$ImageSaver$@SuppressLint("RestrictedApi") private fun saveImageToTempFile(): File?</ID>
89-
<ID>ReturnCount:MediaActionSound.kt$MediaActionSound$private fun loadSound(sound: SoundState): Int</ID>
90-
<ID>ReturnCount:MediaOutputHelper.kt$MediaOutputHelper$private fun getFileDescriptorMediaOutput(): MediaOutput.FileDescriptorMediaOutput?</ID>
91-
<ID>ReturnCount:MediaOutputHelper.kt$MediaOutputHelper$private fun getUriForFilePath(path: String): Uri?</ID>
9287
<ID>ReturnCount:PhotoProcessor.kt$PhotoProcessor$override fun doInBackground(vararg params: ByteArray): String</ID>
93-
<ID>ReturnCount:PhotoProcessor.kt$PhotoProcessor$private fun rotate(bitmap: Bitmap, degree: Int): Bitmap?</ID>
9488
<ID>SwallowedException:BitmapUtils.kt$BitmapUtils$ex: OutOfMemoryError</ID>
9589
<ID>SwallowedException:CameraXPreview.kt$CameraXPreview$e: Exception</ID>
9690
<ID>SwallowedException:ImageUtil.kt$ImageUtil$e: IOException</ID>

app/lint-baseline.xml

Lines changed: 49 additions & 60 deletions
Large diffs are not rendered by default.

app/src/main/kotlin/org/fossify/camera/activities/MainActivity.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
156156
mediaSoundHelper.release()
157157
}
158158

159-
override fun onBackPressed() {
160-
if (!closeOptions()) {
161-
super.onBackPressed()
159+
override fun onBackPressedCompat(): Boolean {
160+
return if (!closeOptions()) {
161+
false
162+
} else {
163+
true
162164
}
163165
}
164166

@@ -315,8 +317,9 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
315317
topMargin = safeInsetTop
316318
}
317319

318-
val marginBottom =
319-
safeInsetBottom + navigationBarHeight + resources.getDimensionPixelSize(org.fossify.commons.R.dimen.bigger_margin)
320+
val systemBarsInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
321+
val marginBottom = systemBarsInsets.bottom +
322+
resources.getDimensionPixelSize(org.fossify.commons.R.dimen.bigger_margin)
320323

321324
binding.shutter.updateLayoutParams<ViewGroup.MarginLayoutParams> {
322325
bottomMargin = marginBottom

app/src/main/kotlin/org/fossify/camera/activities/SettingsActivity.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,20 @@ class SettingsActivity : SimpleActivity() {
2020
private val binding by viewBinding(ActivitySettingsBinding::inflate)
2121

2222
override fun onCreate(savedInstanceState: Bundle?) {
23-
isMaterialActivity = true
2423
super.onCreate(savedInstanceState)
2524
binding.apply {
2625
setContentView(root)
2726
setupOptionsMenu()
2827
refreshMenuItems()
2928

30-
updateMaterialActivityViews(
31-
settingsCoordinator,
32-
settingsHolder,
33-
useTransparentNavigation = true,
34-
useTopSearchMenu = false
35-
)
36-
setupMaterialScrollListener(settingsNestedScrollview, settingsToolbar)
29+
setupEdgeToEdge(padBottomSystem = listOf(settingsNestedScrollview))
30+
setupMaterialScrollListener(binding.settingsNestedScrollview, binding.settingsAppbar)
3731
}
3832
}
3933

4034
override fun onResume() {
4135
super.onResume()
42-
setupToolbar(binding.settingsToolbar, NavigationIcon.Arrow)
36+
setupTopAppBar(binding.settingsAppbar, NavigationIcon.Arrow)
4337

4438
setupCustomizeColors()
4539
setupUseEnglish()

app/src/main/res/layout/activity_settings.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,29 @@
66
android:layout_width="match_parent"
77
android:layout_height="match_parent">
88

9-
<com.google.android.material.appbar.MaterialToolbar
10-
android:id="@+id/settings_toolbar"
9+
<org.fossify.commons.views.MyAppBarLayout
10+
android:id="@+id/settings_appbar"
1111
android:layout_width="match_parent"
12-
android:layout_height="?attr/actionBarSize"
13-
android:background="@color/color_primary"
14-
app:menu="@menu/menu"
15-
app:title="@string/settings"
16-
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
12+
android:layout_height="wrap_content">
13+
14+
<com.google.android.material.appbar.MaterialToolbar
15+
android:id="@+id/settings_toolbar"
16+
android:layout_width="match_parent"
17+
android:layout_height="?attr/actionBarSize"
18+
android:background="@color/color_primary"
19+
app:menu="@menu/menu"
20+
app:title="@string/settings"
21+
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
22+
23+
</org.fossify.commons.views.MyAppBarLayout>
1724

1825
<androidx.core.widget.NestedScrollView
1926
android:id="@+id/settings_nested_scrollview"
2027
android:layout_width="match_parent"
2128
android:layout_height="match_parent"
22-
android:layout_marginTop="?attr/actionBarSize"
2329
android:fillViewport="true"
24-
android:scrollbars="none">
30+
android:scrollbars="none"
31+
app:layout_behavior="@string/appbar_scrolling_view_behavior">
2532

2633
<LinearLayout
2734
android:id="@+id/settings_holder"

detekt.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ style:
4040
maxLineLength: 120
4141
excludePackageStatements: true
4242
excludeImportStatements: true
43+
ReturnCount:
44+
active: true
45+
max: 4
46+
excludeGuardClauses: true
47+
excludes: ["**/test/**", "**/androidTest/**"]
4348

4449
naming:
4550
FunctionNaming:

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ androidx-window = "1.5.0"
1111
androidx-camera = "1.4.2"
1212
androidx-ktx = "2.8.6"
1313
#Fossify
14-
commons = "5.4.0"
14+
commons = "5.5.0"
1515
#Gradle
1616
gradlePlugins-agp = "8.11.1"
1717
#build
18-
app-build-compileSDKVersion = "34"
19-
app-build-targetSDK = "34"
18+
app-build-compileSDKVersion = "36"
19+
app-build-targetSDK = "36"
2020
app-build-minimumSDK = "29"
2121
app-build-javaVersion = "VERSION_17"
2222
app-build-kotlinJVMTarget = "17"

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencyResolutionManagement {
1111
google()
1212
mavenCentral()
1313
maven { setUrl("https://jitpack.io") }
14+
mavenLocal()
1415
}
1516
}
1617
include(":app")

0 commit comments

Comments
 (0)