Auxio/app/build.gradle
OxygenCobalt 1b791074ec
playback: replace headset focus with headset autoplay
Turn the headset focus setting into the headset autoplay setting.

The way auxio handles headsets is...odd. Sometimes the MediaSession
handles it and Auxio could not care less, and sometimes Auxio actually
needs to handle it. As a result, the idea of being able to disable
headset focus is more or less moot because it will only apply to some
devices and not others.

On the other end, the way Auxio automatically begins playback once a
headset is plugged in is also quite weird. It only works on wired
headsets, and when it does, it overrides all other apps that might
also be playing audio. It's not to say that it's a bad feature, but
it's also one that I don't want to make the defualt. Auxio should
still play along within the confines of Android's expectations, after
all.

Replacing the existing "Headset focus" setting with a new "Headset
autoplay" setting solves both of these issues, as it prevents a
mis-guided disabling of the setting that doesn't actually disable
the feature and it relegates the quirky autoplay behavior to an
setting not enabled by default.
2022-03-05 20:34:12 -07:00

127 lines
3.6 KiB
Groovy

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-kapt"
apply plugin: "androidx.navigation.safeargs.kotlin"
android {
compileSdkVersion 32
buildToolsVersion "32.0.0"
defaultConfig {
applicationId "org.oxycblt.auxio"
versionName "2.2.1"
versionCode 13
minSdkVersion 21
targetSdkVersion 32
buildFeatures {
dataBinding true
}
}
buildTypes {
debug {
debuggable true
applicationIdSuffix = ".debug"
versionNameSuffix = "-DEBUG"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}
// ExoPlayer needs Java 8 to compile.
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xjvm-default=all"
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
}
configurations {
ktlint
}
afterEvaluate {
preDebugBuild.dependsOn ktlintFormat
}
dependencies {
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// --- SUPPORT ---
// General
implementation "androidx.core:core-ktx:1.7.0"
implementation "androidx.activity:activity-ktx:1.4.0"
implementation 'androidx.fragment:fragment-ktx:1.4.1'
// UI
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation "androidx.dynamicanimation:dynamicanimation:1.0.0"
implementation "androidx.viewpager2:viewpager2:1.1.0-beta01"
// Lifecycle
def lifecycle_version = "2.4.1"
implementation "androidx.lifecycle:lifecycle-common:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
// Navigation
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
// Media
// TODO: Dumpster this for Media3
implementation "androidx.media:media:1.5.0"
// Preferences
implementation "androidx.preference:preference-ktx:1.2.0"
// --- THIRD PARTY ---
// Exoplayer
// WARNING: THE EXOPLAYER VERSION MUST BE KEPT IN LOCK-STEP WITH THE FLAC EXTENSION.
// IF NOT, VERY UNFRIENDLY BUILD FAILURES AND CRASHES MAY ENSUE.
def exoplayerVersion = '2.17.0'
implementation("com.google.android.exoplayer:exoplayer-core:$exoplayerVersion")
implementation fileTree(dir: "libs", include: ["extension-*.aar"])
// Image loading
implementation 'io.coil-kt:coil:2.0.0-alpha09'
// Material
implementation 'com.google.android.material:material:1.6.0-alpha03'
// --- DEBUG ---
// Lint
ktlint 'com.pinterest:ktlint:0.44.0'
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
mainClass.set("com.pinterest.ktlint.Main")
classpath = configurations.ktlint
args "src/**/*.kt"
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
mainClass.set("com.pinterest.ktlint.Main")
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}