diff --git a/app/build.gradle b/app/build.gradle index f348d2a..5862f39 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,14 +4,15 @@ apply plugin: 'kotlin-android-extensions' android { // Note: SDK version 31 includes a great many revisions to core platform APIs. - compileSdkVersion 30 + compileSdkVersion 34 defaultConfig { applicationId "com.danefinlay.ttsutil" minSdkVersion 15 - targetSdkVersion 30 + targetSdkVersion 34 versionCode 8 versionName "4.0.2" + multiDexEnabled true } lintOptions { @@ -45,23 +46,25 @@ dependencies { implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0' implementation 'androidx.navigation:navigation-ui-ktx:2.0.0' - implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0' implementation 'androidx.navigation:navigation-ui-ktx:2.0.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.preference:preference-ktx:1.0.0' implementation 'org.jetbrains.anko:anko-sdk15:0.9' implementation 'org.jetbrains.anko:anko-support-v4:0.9.1' - implementation 'androidx.constraintlayout:constraintlayout:2.0.0' - implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.9.0' + + implementation 'com.android.support:multidex:1.0.0' } + repositories { mavenCentral() google() } - task wrapper(type: Wrapper) { gradleVersion = '2.0' } diff --git a/app/src/main/java/com/danefinlay/ttsutil/ui/ActivityEvents.kt b/app/src/main/java/com/danefinlay/ttsutil/ui/ActivityEvents.kt index 48a69d3..607d187 100644 --- a/app/src/main/java/com/danefinlay/ttsutil/ui/ActivityEvents.kt +++ b/app/src/main/java/com/danefinlay/ttsutil/ui/ActivityEvents.kt @@ -58,7 +58,7 @@ sealed class ActivityEvent : Parcelable { } class TTSReadyEvent : ActivityEvent(), Parcelable { - override fun writeToParcel(dest: Parcel?, flags: Int) {} + override fun writeToParcel(p0: Parcel, flags: Int) {} override fun describeContents(): Int = 0 companion object CREATOR : Parcelable.Creator { diff --git a/app/src/main/java/com/danefinlay/ttsutil/ui/ReadTextFragments.kt b/app/src/main/java/com/danefinlay/ttsutil/ui/ReadTextFragments.kt index fe2c742..b65cd56 100644 --- a/app/src/main/java/com/danefinlay/ttsutil/ui/ReadTextFragments.kt +++ b/app/src/main/java/com/danefinlay/ttsutil/ui/ReadTextFragments.kt @@ -263,7 +263,7 @@ abstract class ReadTextFragmentBase : MyFragment() { override fun onClickSave() { super.onClickSave() - // Determine the output directory. If the user has not chosen one, the + // Determine the output directory. If the user has not chosen one, the // "external" storage is used. val event = activityInterface?.getLastDirChosenEvent() val directory: Directory = if (event != null) { @@ -274,16 +274,21 @@ abstract class ReadTextFragmentBase : MyFragment() { } // Determine the names of the wave file and directory. - // TODO Allow the user to change the filename. - val waveFilename = getString(R.string.output_wave_filename) + ".wav" + // Get the current date and time in the format 'ddMMyyyy_HHmmss'. + val currentDateTime = SimpleDateFormat("ddMMyyyy_HHmmss", Locale.getDefault()).format(Date()) + + // Append the current date and time to the filename. + val waveFilename = "textToSpeech_$currentDateTime.wav" + val dirDisplayName: String = event?.firstDisplayName - ?: getString(R.string.default_output_dir) + ?: getString(R.string.default_output_dir) // Build and display an appropriate alert dialog. AlertDialogBuilder(ctx).apply { title(R.string.write_to_file_alert_title) - message(getString(R.string.write_to_file_alert_message_3, - waveFilename, dirDisplayName)) + message(getString( + R.string.write_to_file_alert_message_3, + waveFilename, dirDisplayName)) positiveButton(R.string.alert_positive_message_2) { // Ask the user for write permission if necessary. withStoragePermission { granted -> diff --git a/build.gradle b/build.gradle index b1045eb..7051e60 100644 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,8 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" + classpath 'com.android.tools.build:gradle:7.4.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b38c35a..b51c614 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip