Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
Change targetSdk to Android 10, cut release v2.9
Browse files Browse the repository at this point in the history
- Update versionCode & versionName for Google Play Store

- Set targetSDK to Android 10 / API level 29 / Android Q
  - https://source.android.com/setup/start/build-numbers
  - https://support.google.com/googleplay/android-developer/answer/113469#targetsdk

- Clean up IntentHelper by removing needless functions

- Clean up strings in debug messages & add missing ones

- Replace String.format() w/ template literals

- Upgrade to Kotlin 1.4

- Upgrade most dependencies
  • Loading branch information
Nazmul Idris committed Aug 29, 2020
1 parent 915541a commit cfd375d
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 54 deletions.
18 changes: 18 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions .idea/modules/app/app.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "com.r3bl.stayawake"
minSdkVersion 25
targetSdkVersion 28
targetSdkVersion 29
// Update versionCode & versionName before adding a release to the Google Play Store.
versionCode 20
versionName "2.8"
versionCode 21
versionName "2.9"
}
buildTypes {
release {
Expand All @@ -40,9 +40,9 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation 'junit:junit:4.13'
implementation "androidx.core:core-ktx:1.3.0"
implementation "androidx.core:core-ktx:1.3.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.greenrobot:eventbus:3.2.0'
}
Expand Down
15 changes: 10 additions & 5 deletions app/src/main/java/com/r3bl/stayawake/MyIntentBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,16 @@ fun buildIntent(block: MyIntentBuilder.() -> Unit): Intent = MyIntentBuilder().a
// Intent helpers.
class IntentHelper {
companion object {
fun containsCommand(intent: Intent): Boolean = intent.extras.containsKey(Keys.CommandId.name)
fun containsMessage(intent: Intent): Boolean = intent.extras.containsKey(Keys.Message.name)

@CommandId
fun getCommand(intent: Intent): Int = intent.extras.getInt(Keys.CommandId.name)
fun getMessage(intent: Intent): String = intent.extras.getString(Keys.Message.name)
fun getCommandId(intent: Intent): Int = intent.extras?.getInt(Keys.CommandId.name) ?: INVALID
fun getCommandIdDebugString(intent: Intent): String = when (getCommandId(intent)) {
INVALID -> "INVALID"
STOP -> "STOP"
START -> "START"
else -> "UNKNOWN 🤔"
}

fun getMessage(intent: Intent): String? = intent.extras?.getString(Keys.Message.name)
fun getMessageDebugString(intent: Intent): String = getMessage(intent) ?: "N/A"
}
}
Loading

0 comments on commit cfd375d

Please sign in to comment.