Skip to content

Commit

Permalink
Increase SDK target to 35
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabi019 committed Nov 1, 2024
1 parent 6d825eb commit f77bf09
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 25 deletions.
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ final def gitHash = providers.exec {

android {
namespace 'dev.fabik.bluetoothhid'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "dev.fabik.bluetoothhid"
minSdk 28
targetSdk 34
targetSdk 35
versionCode 48
versionName "1.9.1"

Expand Down Expand Up @@ -48,11 +48,11 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}
buildFeatures {
compose true
Expand All @@ -71,14 +71,14 @@ android {
dependencies {
implementation "androidx.javascriptengine:javascriptengine:1.0.0-beta01"

implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.6'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
implementation 'androidx.activity:activity-compose:1.9.3'

implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.material:material-icons-extended:$compose_mat_version"
implementation 'androidx.compose.runtime:runtime-livedata:1.7.4'
implementation 'androidx.compose.material3:material3:1.3.0'
implementation 'androidx.compose.runtime:runtime-livedata:1.7.5'
implementation 'androidx.compose.material3:material3:1.3.1'

implementation 'androidx.navigation:navigation-compose:2.8.3'
implementation 'androidx.datastore:datastore-preferences:1.1.1'
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/dev/fabik/bluetoothhid/History.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.content.ContextCompat.startActivity
import androidx.lifecycle.viewmodel.compose.viewModel
import dev.fabik.bluetoothhid.ui.ConfirmDialog
import dev.fabik.bluetoothhid.ui.model.HistoryViewModel
Expand Down Expand Up @@ -123,7 +122,7 @@ fun History(onBack: () -> Unit, onClick: (String) -> Unit) = with(viewModel<Hist
putExtra(Intent.EXTRA_TEXT, data)
}
val shareIntent = Intent.createChooser(intent, exportString)
startActivity(context, shareIntent, null)
context.startActivity(shareIntent)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/dev/fabik/bluetoothhid/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.pm.ActivityInfo
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.runtime.CompositionLocalProvider
Expand Down Expand Up @@ -34,6 +35,8 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

enableEdgeToEdge()

setContent {
BluetoothHIDTheme {
Surface(Modifier.fillMaxSize()) {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/dev/fabik/bluetoothhid/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.fabik.bluetoothhid
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand All @@ -29,6 +30,8 @@ class SettingsActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

enableEdgeToEdge()

setContent {
BluetoothHIDTheme {
Surface(Modifier.fillMaxSize()) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/dev/fabik/bluetoothhid/ui/JsEditor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
Expand Down Expand Up @@ -148,7 +149,7 @@ fun JavaScriptEditor(
ExposedDropdownMenuDefaults.TrailingIcon(expanded = exp)
},
colors = ExposedDropdownMenuDefaults.textFieldColors(),
modifier = Modifier.menuAnchor()
modifier = Modifier.menuAnchor(MenuAnchorType.PrimaryEditable, true)
)
// filter options based on text field value (i.e. crude autocomplete)
val filterOpts = options.filter { it.contains(typeText, ignoreCase = true) }
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/dev/fabik/bluetoothhid/ui/Tooltip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

package dev.fabik.bluetoothhid.ui

import androidx.compose.animation.core.ExperimentalTransitionApi
import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.rememberTransition
Expand Down Expand Up @@ -64,7 +63,6 @@ fun Tooltip(
}

@Composable
@OptIn(ExperimentalTransitionApi::class)
fun TooltipContent(
expandedStates: MutableTransitionState<Boolean>,
content: @Composable () -> Unit
Expand Down
13 changes: 8 additions & 5 deletions app/src/main/java/dev/fabik/bluetoothhid/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package dev.fabik.bluetoothhid.ui.theme
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.*
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
Expand Down Expand Up @@ -63,8 +65,9 @@ fun BluetoothHIDTheme(content: @Composable () -> Unit) {
SideEffect {
val window = (view.context as Activity).window

window.statusBarColor = Color.Transparent.toArgb()
window.navigationBarColor = Color.Transparent.toArgb()
// Replaced by enableEdgeToEdge() call in activity
//window.statusBarColor = Color.Transparent.toArgb()
//window.navigationBarColor = Color.Transparent.toArgb()

WindowCompat.setDecorFitsSystemWindows(window, false)
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !dark
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ buildscript {
}

ext {
compose_ui_version = '1.7.0'
compose_ui_version = '1.7.5'
compose_mat_version = '1.7.2'
camerax_version = '1.4.0-rc04'
camerax_version = '1.4.0'
accomp_version = '0.36.0'
play_version = '18.3.0'
agp_version = '8.5.1'
kotlin_version = '2.0.20'
agp_version = '8.7.2'
kotlin_version = '2.0.21'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Aug 22 10:20:58 CEST 2023
#Fri Nov 01 16:18:04 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit f77bf09

Please sign in to comment.