Spaces:
Running
Running
Digipom
commited on
whisper.android : bump gradle plugin and dependencies + a lint pass (#1255)
Browse files- examples/whisper.android/.idea/compiler.xml +1 -1
- examples/whisper.android/.idea/gradle.xml +2 -2
- examples/whisper.android/.idea/misc.xml +1 -1
- examples/whisper.android/app/build.gradle +19 -19
- examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/main/MainScreen.kt +1 -1
- examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/main/MainScreenViewModel.kt +1 -1
- examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/theme/Theme.kt +4 -3
- examples/whisper.android/app/src/main/res/values/colors.xml +0 -10
- examples/whisper.android/build.gradle +3 -3
- examples/whisper.android/gradle/wrapper/gradle-wrapper.properties +1 -1
examples/whisper.android/.idea/compiler.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<project version="4">
|
| 3 |
<component name="CompilerConfiguration">
|
| 4 |
-
<bytecodeTargetLevel target="
|
| 5 |
</component>
|
| 6 |
</project>
|
|
|
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<project version="4">
|
| 3 |
<component name="CompilerConfiguration">
|
| 4 |
+
<bytecodeTargetLevel target="17" />
|
| 5 |
</component>
|
| 6 |
</project>
|
examples/whisper.android/.idea/gradle.xml
CHANGED
|
@@ -4,15 +4,15 @@
|
|
| 4 |
<component name="GradleSettings">
|
| 5 |
<option name="linkedExternalProjectsSettings">
|
| 6 |
<GradleProjectSettings>
|
| 7 |
-
<option name="testRunner" value="GRADLE" />
|
| 8 |
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
| 9 |
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
|
|
| 10 |
<option name="modules">
|
| 11 |
<set>
|
| 12 |
<option value="$PROJECT_DIR$" />
|
| 13 |
<option value="$PROJECT_DIR$/app" />
|
| 14 |
</set>
|
| 15 |
</option>
|
|
|
|
| 16 |
</GradleProjectSettings>
|
| 17 |
</option>
|
| 18 |
</component>
|
|
|
|
| 4 |
<component name="GradleSettings">
|
| 5 |
<option name="linkedExternalProjectsSettings">
|
| 6 |
<GradleProjectSettings>
|
|
|
|
|
|
|
| 7 |
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
| 8 |
+
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
| 9 |
<option name="modules">
|
| 10 |
<set>
|
| 11 |
<option value="$PROJECT_DIR$" />
|
| 12 |
<option value="$PROJECT_DIR$/app" />
|
| 13 |
</set>
|
| 14 |
</option>
|
| 15 |
+
<option name="resolveExternalAnnotations" value="false" />
|
| 16 |
</GradleProjectSettings>
|
| 17 |
</option>
|
| 18 |
</component>
|
examples/whisper.android/.idea/misc.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<project version="4">
|
| 3 |
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
| 4 |
-
<component name="ProjectRootManager" version="2" languageLevel="
|
| 5 |
<output url="file://$PROJECT_DIR$/build/classes" />
|
| 6 |
</component>
|
| 7 |
<component name="ProjectType">
|
|
|
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<project version="4">
|
| 3 |
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
| 4 |
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
| 5 |
<output url="file://$PROJECT_DIR$/build/classes" />
|
| 6 |
</component>
|
| 7 |
<component name="ProjectType">
|
examples/whisper.android/app/build.gradle
CHANGED
|
@@ -5,12 +5,12 @@ plugins {
|
|
| 5 |
|
| 6 |
android {
|
| 7 |
namespace 'com.whispercppdemo'
|
| 8 |
-
compileSdk
|
| 9 |
|
| 10 |
defaultConfig {
|
| 11 |
applicationId "com.whispercppdemo"
|
| 12 |
minSdk 26
|
| 13 |
-
targetSdk
|
| 14 |
versionCode 1
|
| 15 |
versionName "1.0"
|
| 16 |
|
|
@@ -31,19 +31,19 @@ android {
|
|
| 31 |
}
|
| 32 |
}
|
| 33 |
compileOptions {
|
| 34 |
-
sourceCompatibility JavaVersion.
|
| 35 |
-
targetCompatibility JavaVersion.
|
| 36 |
}
|
| 37 |
kotlinOptions {
|
| 38 |
-
jvmTarget = '
|
| 39 |
}
|
| 40 |
buildFeatures {
|
| 41 |
compose true
|
| 42 |
}
|
| 43 |
composeOptions {
|
| 44 |
-
kotlinCompilerExtensionVersion '1.
|
| 45 |
}
|
| 46 |
-
ndkVersion "25.
|
| 47 |
externalNativeBuild {
|
| 48 |
cmake {
|
| 49 |
path = file("src/main/jni/whisper/CMakeLists.txt")
|
|
@@ -57,19 +57,19 @@ android {
|
|
| 57 |
}
|
| 58 |
|
| 59 |
dependencies {
|
| 60 |
-
implementation 'androidx.activity:activity-compose:1.
|
| 61 |
-
implementation 'androidx.compose.material:material-icons-core:1.
|
| 62 |
-
implementation 'androidx.compose.material3:material3:1.
|
| 63 |
-
implementation "androidx.compose.ui:ui:1.
|
| 64 |
-
implementation "androidx.compose.ui:ui-tooling-preview:1.
|
| 65 |
-
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.
|
| 66 |
implementation "com.google.accompanist:accompanist-permissions:0.28.0"
|
| 67 |
-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.
|
| 68 |
|
| 69 |
testImplementation 'junit:junit:4.13.2'
|
| 70 |
-
androidTestImplementation 'androidx.test.ext:junit:1.1.
|
| 71 |
-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.
|
| 72 |
-
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.
|
| 73 |
-
debugImplementation "androidx.compose.ui:ui-tooling:1.
|
| 74 |
-
debugImplementation "androidx.compose.ui:ui-test-manifest:1.
|
| 75 |
}
|
|
|
|
| 5 |
|
| 6 |
android {
|
| 7 |
namespace 'com.whispercppdemo'
|
| 8 |
+
compileSdk 34
|
| 9 |
|
| 10 |
defaultConfig {
|
| 11 |
applicationId "com.whispercppdemo"
|
| 12 |
minSdk 26
|
| 13 |
+
targetSdk 34
|
| 14 |
versionCode 1
|
| 15 |
versionName "1.0"
|
| 16 |
|
|
|
|
| 31 |
}
|
| 32 |
}
|
| 33 |
compileOptions {
|
| 34 |
+
sourceCompatibility JavaVersion.VERSION_17
|
| 35 |
+
targetCompatibility JavaVersion.VERSION_17
|
| 36 |
}
|
| 37 |
kotlinOptions {
|
| 38 |
+
jvmTarget = '17'
|
| 39 |
}
|
| 40 |
buildFeatures {
|
| 41 |
compose true
|
| 42 |
}
|
| 43 |
composeOptions {
|
| 44 |
+
kotlinCompilerExtensionVersion '1.5.0'
|
| 45 |
}
|
| 46 |
+
ndkVersion "25.2.9519653"
|
| 47 |
externalNativeBuild {
|
| 48 |
cmake {
|
| 49 |
path = file("src/main/jni/whisper/CMakeLists.txt")
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
dependencies {
|
| 60 |
+
implementation 'androidx.activity:activity-compose:1.7.2'
|
| 61 |
+
implementation 'androidx.compose.material:material-icons-core:1.5.0'
|
| 62 |
+
implementation 'androidx.compose.material3:material3:1.1.1'
|
| 63 |
+
implementation "androidx.compose.ui:ui:1.5.0"
|
| 64 |
+
implementation "androidx.compose.ui:ui-tooling-preview:1.5.0"
|
| 65 |
+
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1'
|
| 66 |
implementation "com.google.accompanist:accompanist-permissions:0.28.0"
|
| 67 |
+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2'
|
| 68 |
|
| 69 |
testImplementation 'junit:junit:4.13.2'
|
| 70 |
+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
| 71 |
+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
| 72 |
+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.5.0"
|
| 73 |
+
debugImplementation "androidx.compose.ui:ui-tooling:1.5.0"
|
| 74 |
+
debugImplementation "androidx.compose.ui:ui-test-manifest:1.5.0"
|
| 75 |
}
|
examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/main/MainScreen.kt
CHANGED
|
@@ -66,7 +66,7 @@ private fun MainScreen(
|
|
| 66 |
|
| 67 |
@Composable
|
| 68 |
private fun MessageLog(log: String) {
|
| 69 |
-
SelectionContainer
|
| 70 |
Text(modifier = Modifier.verticalScroll(rememberScrollState()), text = log)
|
| 71 |
}
|
| 72 |
}
|
|
|
|
| 66 |
|
| 67 |
@Composable
|
| 68 |
private fun MessageLog(log: String) {
|
| 69 |
+
SelectionContainer {
|
| 70 |
Text(modifier = Modifier.verticalScroll(rememberScrollState()), text = log)
|
| 71 |
}
|
| 72 |
}
|
examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/main/MainScreenViewModel.kt
CHANGED
|
@@ -47,7 +47,7 @@ class MainScreenViewModel(private val application: Application) : ViewModel() {
|
|
| 47 |
}
|
| 48 |
|
| 49 |
private suspend fun printSystemInfo() {
|
| 50 |
-
printMessage(String.format("System Info: %s\n", WhisperContext.getSystemInfo()))
|
| 51 |
}
|
| 52 |
|
| 53 |
private suspend fun loadData() {
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
private suspend fun printSystemInfo() {
|
| 50 |
+
printMessage(String.format("System Info: %s\n", WhisperContext.getSystemInfo()))
|
| 51 |
}
|
| 52 |
|
| 53 |
private suspend fun loadData() {
|
examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/theme/Theme.kt
CHANGED
|
@@ -13,7 +13,7 @@ import androidx.compose.runtime.SideEffect
|
|
| 13 |
import androidx.compose.ui.graphics.toArgb
|
| 14 |
import androidx.compose.ui.platform.LocalContext
|
| 15 |
import androidx.compose.ui.platform.LocalView
|
| 16 |
-
import androidx.core.view.
|
| 17 |
|
| 18 |
private val DarkColorScheme = darkColorScheme(
|
| 19 |
primary = Purple80,
|
|
@@ -55,8 +55,9 @@ fun WhisperCppDemoTheme(
|
|
| 55 |
val view = LocalView.current
|
| 56 |
if (!view.isInEditMode) {
|
| 57 |
SideEffect {
|
| 58 |
-
(view.context as Activity).window
|
| 59 |
-
|
|
|
|
| 60 |
}
|
| 61 |
}
|
| 62 |
|
|
|
|
| 13 |
import androidx.compose.ui.graphics.toArgb
|
| 14 |
import androidx.compose.ui.platform.LocalContext
|
| 15 |
import androidx.compose.ui.platform.LocalView
|
| 16 |
+
import androidx.core.view.WindowCompat
|
| 17 |
|
| 18 |
private val DarkColorScheme = darkColorScheme(
|
| 19 |
primary = Purple80,
|
|
|
|
| 55 |
val view = LocalView.current
|
| 56 |
if (!view.isInEditMode) {
|
| 57 |
SideEffect {
|
| 58 |
+
val window = (view.context as Activity).window
|
| 59 |
+
window.statusBarColor = colorScheme.primary.toArgb()
|
| 60 |
+
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
|
| 61 |
}
|
| 62 |
}
|
| 63 |
|
examples/whisper.android/app/src/main/res/values/colors.xml
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
-
<resources>
|
| 3 |
-
<color name="purple_200">#FFBB86FC</color>
|
| 4 |
-
<color name="purple_500">#FF6200EE</color>
|
| 5 |
-
<color name="purple_700">#FF3700B3</color>
|
| 6 |
-
<color name="teal_200">#FF03DAC5</color>
|
| 7 |
-
<color name="teal_700">#FF018786</color>
|
| 8 |
-
<color name="black">#FF000000</color>
|
| 9 |
-
<color name="white">#FFFFFFFF</color>
|
| 10 |
-
</resources>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
examples/whisper.android/build.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
| 2 |
plugins {
|
| 3 |
-
id 'com.android.application' version '
|
| 4 |
-
id 'com.android.library' version '
|
| 5 |
-
id 'org.jetbrains.kotlin.android' version '1.
|
| 6 |
}
|
|
|
|
| 1 |
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
| 2 |
plugins {
|
| 3 |
+
id 'com.android.application' version '8.1.1' apply false
|
| 4 |
+
id 'com.android.library' version '8.1.1' apply false
|
| 5 |
+
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
|
| 6 |
}
|
examples/whisper.android/gradle/wrapper/gradle-wrapper.properties
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
#Wed Dec 14 10:37:24 EST 2022
|
| 2 |
distributionBase=GRADLE_USER_HOME
|
| 3 |
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
| 4 |
distributionPath=wrapper/dists
|
| 5 |
zipStorePath=wrapper/dists
|
| 6 |
zipStoreBase=GRADLE_USER_HOME
|
|
|
|
| 1 |
#Wed Dec 14 10:37:24 EST 2022
|
| 2 |
distributionBase=GRADLE_USER_HOME
|
| 3 |
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
| 4 |
distributionPath=wrapper/dists
|
| 5 |
zipStorePath=wrapper/dists
|
| 6 |
zipStoreBase=GRADLE_USER_HOME
|