change touch and leanback into library modules. debug is working, release not yet

This commit is contained in:
Felix 2020-06-11 21:51:22 +02:00
parent 22ea3d0134
commit 8f5c36b917
14 changed files with 418 additions and 255 deletions

View file

@ -3,8 +3,10 @@ plugins {
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-kapt' id 'kotlin-kapt'
id 'kotlin-android-extensions' id 'kotlin-android-extensions'
// id 'com.github.triplet.play' version '2.6.2' id 'com.github.triplet.play' version '2.6.2'
} }
apply from: "${rootProject.projectDir}/flavors.gradle"
String appName = "Chaosflix" String appName = "Chaosflix"
String versionString = new File("versionfile").text.trim() String versionString = new File("versionfile").text.trim()
@ -22,17 +24,16 @@ android {
versionCode 1 versionCode 1
versionName versionString versionName versionString
if(project.hasProperty("versionCode")){ if (project.hasProperty("versionCode")) {
versionCode = project.property("versionCode") as int versionCode = project.property("versionCode") as int
println "Setting VersionCode from property: $versionCode" println "Setting VersionCode from property: $versionCode"
} }
if(project.hasProperty("versionName")){ if (project.hasProperty("versionName")) {
versionName = project.property("versionName") as String versionName = project.property("versionName") as String
println "Setting versionName from property: $versionName" println "Setting versionName from property: $versionName"
} }
} }
signingConfigs { signingConfigs {
//noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck //noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
release { release {
@ -65,40 +66,67 @@ android {
} }
} }
flavorDimensions "stage", "libs" with flavorConfig
// flavorDimensions "stage", "libs"
//
// productFlavors {
// prod {
// dimension "stage"
// }
// dev {
// dimension "stage"
// applicationIdSuffix ".dev"
// manifestPlaceholders = [label: appName + "-Dev"]
// }
// mock {
// dimension "stage"
// applicationIdSuffix ".mock"
// manifestPlaceholders = [label: appName + "-Mock"]
// }
// free {
// dimension "libs"
// }
// noFree {
// dimension "libs"
// }
// }
productFlavors { playConfigs {
prod { prodNoFree {
dimension "stage" enabled = true
}
dev {
dimension "stage"
applicationIdSuffix ".dev"
manifestPlaceholders = [label: appName + "-Dev"]
}
mock {
dimension "stage"
applicationIdSuffix ".mock"
manifestPlaceholders = [label: appName + "-Mock"]
}
free {
dimension "libs"
}
noFree {
dimension "libs"
} }
} }
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
dataBinding.enabled = true
viewBinding.enabled = true
} }
configurations { //configurations {
mockDebugCompile // devFreeDebugImplementation
prodDebugCompile // devNoFreeDebugImplementation
prodReleaseCompile // devFreeReleaseImplementation
} // devNoFreeReleaseImplementation
// mockDebugImplementation
// prodDebugImplementation
// prodReleaseImplementation
//}
dependencies { dependencies {
// implementation project(':touch') implementation project(':touch')
// implementation project(':leanback') implementation project(':leanback')
implementation project(':common') implementation project(':common')
} }
play {
serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json")
track = "alpha"
releaseStatus = "draft"
enabled = false
artifactDir = file("build/outputs/apk/prodNoFree/release/app-prod-noFree-release.apk")
}

View file

@ -10,10 +10,40 @@
android:label="${label}" android:label="${label}"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"
tools:ignore="GoogleAppIndexingWarning"> tools:replace="android:label">
<!-- <activity-->
<!-- android:name=".touch.SplashActivity"-->
<!-- android:label="${label}"-->
<!-- android:theme="@style/SplashTheme">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN"/>-->
<!-- <category android:name="android.intent.category.LAUNCHER"/>-->
<!-- </intent-filter>-->
<!-- </activity>-->
<!-- <activity-->
<!-- android:name=".leanback.conferences.ConferencesActivity"-->
<!-- android:banner="@drawable/banner"-->
<!-- android:label="${label}"-->
<!-- android:screenOrientation="landscape"-->
<!-- android:theme="@style/LeanbackAppTheme"-->
<!-- tools:ignore="LockedOrientationActivity">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LEANBACK_LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.VIEW" />-->
<!-- <category android:name="android.intent.category.BROWSABLE"/>-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- <data-->
<!-- android:scheme="de.nicidienase.chaosflix"-->
<!-- android:host="main"/>-->
<!-- </intent-filter>-->
<!-- </activity>-->
</application> </application>
</manifest> </manifest>

View file

@ -1,7 +1,11 @@
apply plugin: 'com.android.library' plugins {
apply plugin: 'kotlin-android' id 'com.android.library'
apply plugin: 'kotlin-kapt' id 'kotlin-android'
apply plugin: "de.mannodermaus.android-junit5" id 'kotlin-kapt'
id "de.mannodermaus.android-junit5"
}
apply from: "${rootProject.projectDir}/flavors.gradle"
String versionString = new File("versionfile").text.trim() String versionString = new File("versionfile").text.trim()
@ -48,53 +52,54 @@ android {
} }
} }
flavorDimensions "stage", "libs" with flavorConfig
// flavorDimensions "stage", "libs"
productFlavors { //
prod { // productFlavors {
dimension "stage" // prod {
} // dimension "stage"
// }
dev { //
dimension "stage" // dev {
} // dimension "stage"
// }
mock { //
dimension "stage" // mock {
buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://gist.githubusercontent.com\"" // dimension "stage"
buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/NiciDieNase/1ca017f180242f0ee683a1f592efc4ed/raw/0104592b57f4b29863fd0684a510462af276f30e/example_streams_v2.json\"" // buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://gist.githubusercontent.com\""
} // buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/NiciDieNase/1ca017f180242f0ee683a1f592efc4ed/raw/0104592b57f4b29863fd0684a510462af276f30e/example_streams_v2.json\""
// }
free { //
dimension "libs" // free {
// dimension "libs"
ext { //
prod = null // ext {
dev = null // prod = null
mock = null // dev = null
} // mock = null
} // }
noFree { // }
dimension "libs" // noFree {
ext { // dimension "libs"
if (project.hasProperty("appcenterId")) { // ext {
prod = appcenterId // if (project.hasProperty("appcenterId")) {
} else { // prod = appcenterId
prod = null // } else {
println "AppcenterId not set" // prod = null
} // println "AppcenterId not set"
if (project.hasProperty("appcenterDevId")) { // }
dev = appcenterDevId // if (project.hasProperty("appcenterDevId")) {
mock = appcenterDevId // dev = appcenterDevId
} else { // mock = appcenterDevId
dev = null // } else {
mock = null // dev = null
println "AppcenterId not set" // mock = null
} // println "AppcenterId not set"
// }
} //
} // }
} // }
// }
libraryVariants.all { variant -> libraryVariants.all { variant ->
def flavors = variant.productFlavors def flavors = variant.productFlavors

View file

@ -23,6 +23,10 @@
android:id="@+id/import_favorites" android:id="@+id/import_favorites"
android:key="import_favorites" android:key="import_favorites"
android:title="@string/import_favorites"/> android:title="@string/import_favorites"/>
<Preference
android:id="@+id/launch_other_ui"
android:key="launch_other"
android:title="Launch other UI"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

63
flavors.gradle Normal file
View file

@ -0,0 +1,63 @@
String appName = "Chaosflix"
//String versionString = new File("versionfile").text.trim()
ext.flavorConfig = {
flavorDimensions "stage", "libs"
productFlavors {
prod {
dimension "stage"
}
dev {
dimension "stage"
// applicationIdSuffix ".dev"
ext.myApplicationIdSuffix = ".dev"
manifestPlaceholders = [label: appName + "-Dev"]
}
mock {
dimension "stage"
ext.myApplicationIdSuffix = ".mock"
manifestPlaceholders = [label: appName + "-Mock"]
buildConfigField "String", "STREAMING_API_BASE_URL", "\"https://gist.githubusercontent.com\""
buildConfigField "String", "STREAMING_API_OFFERS_PATH", "\"/NiciDieNase/1ca017f180242f0ee683a1f592efc4ed/raw/0104592b57f4b29863fd0684a510462af276f30e/example_streams_v2.json\""
}
free {
dimension "libs"
ext {
prod = null
dev = null
mock = null
}
}
noFree {
dimension "libs"
ext {
if (project.hasProperty("appcenterId")) {
prod = appcenterId
} else {
prod = null
println "AppcenterId not set"
}
if (project.hasProperty("appcenterDevId")) {
dev = appcenterDevId
mock = appcenterDevId
} else {
dev = null
mock = null
println "AppcenterId not set"
}
}
}
}
productFlavors.all { flavor ->
if (flavor.hasProperty('myApplicationIdSuffix') && isApplicationProject()) {
flavor.applicationIdSuffix = flavor.myApplicationIdSuffix
}
}
}
def isApplicationProject() {
return project.android.class.simpleName.startsWith('BaseAppModuleExtension')
}

View file

@ -1,90 +1,94 @@
plugins { plugins {
id 'com.android.application' id 'com.android.library'
// id 'com.android.application'
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-kapt' id 'kotlin-kapt'
id 'kotlin-android-extensions' id 'kotlin-android-extensions'
id 'com.github.triplet.play' version '2.6.2' // id 'com.github.triplet.play' version '2.6.2'
} }
apply from: "${rootProject.projectDir}/flavors.gradle"
String appName = "Chaosflix"
String versionString = new File("versionfile").text.trim() //String appName = "Chaosflix"
//String versionString = new File("versionfile").text.trim()
android { android {
buildToolsVersion '27.0.3' buildToolsVersion '27.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig { defaultConfig {
applicationId "de.nicidienase.chaosflix" // applicationId "de.nicidienase.chaosflix"
manifestPlaceholders = [label: appName] // manifestPlaceholders = [label: appName]
minSdkVersion rootProject.ext.minSDK minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK targetSdkVersion rootProject.ext.targetSDK
// odd for touch, even for leanback // odd for touch, even for leanback
versionCode 1 versionCode 1
versionName versionString // versionName versionString
if(project.hasProperty("versionCode")){ // if(project.hasProperty("versionCode")){
versionCode = project.property("versionCode") as int // versionCode = project.property("versionCode") as int
println "Setting VersionCode from property: $versionCode" // println "Setting VersionCode from property: $versionCode"
} // }
}
signingConfigs {
//noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
release {
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
println "Release app signing is configured: will sign APK"
storeFile file(chaosflixKeystore)
storePassword chaosflixStorePassword
keyAlias chaosflixKeyName
keyPassword chaosflixKeyPassword
} else {
println "App signing data not found. Will not sign."
}
}
} }
// signingConfigs {
// //noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
// release {
// if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
// println "Release app signing is configured: will sign APK"
// storeFile file(chaosflixKeystore)
// storePassword chaosflixStorePassword
// keyAlias chaosflixKeyName
// keyPassword chaosflixKeyPassword
// } else {
// println "App signing data not found. Will not sign."
// }
// }
// }
buildTypes { buildTypes {
debug { debug {
applicationIdSuffix ".debug" // applicationIdSuffix ".debug"
manifestPlaceholders = [label: appName + "-debug"] // manifestPlaceholders = [label: appName + "-debug"]
minifyEnabled false minifyEnabled false
} }
release { release {
minifyEnabled true minifyEnabled true
shrinkResources true // shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) { // if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
signingConfig signingConfigs.release // signingConfig signingConfigs.release
} // }
} }
} }
flavorDimensions "stage", "libs" with flavorConfig
// flavorDimensions "stage", "libs"
productFlavors { //
prod { // productFlavors {
dimension "stage" // prod {
} // dimension "stage"
dev { // }
dimension "stage" // dev {
applicationIdSuffix ".dev" // dimension "stage"
manifestPlaceholders = [label: appName + "-Dev"] //// applicationIdSuffix ".dev"
} //// manifestPlaceholders = [label: appName + "-Dev"]
mock { // }
dimension "stage" // mock {
applicationIdSuffix ".mock" // dimension "stage"
manifestPlaceholders = [label: appName + "-Mock"] //// applicationIdSuffix ".mock"
} //// manifestPlaceholders = [label: appName + "-Mock"]
free { // }
dimension "libs" // free {
} // dimension "libs"
noFree{ // }
dimension "libs" // noFree{
} // dimension "libs"
} // }
variantFilter { variant -> // }
def names = variant.flavors*.name // variantFilter { variant ->
if (name.contains("prod") && name.contains("Debug")){ // def names = variant.flavors*.name
setIgnore(true) // if (name.contains("prod") && name.contains("Debug")){
} // setIgnore(true)
} // }
// }
packagingOptions { packagingOptions {
@ -104,18 +108,22 @@ android {
lintOptions.abortOnError = false lintOptions.abortOnError = false
dataBinding.enabled = true dataBinding.enabled = true
buildToolsVersion rootProject.ext.buildToolsVersion buildToolsVersion rootProject.ext.buildToolsVersion
playConfigs { // playConfigs {
prodNoFree { // prodNoFree {
enabled = true // enabled = true
} // }
} // }
} }
configurations { //configurations {
mockDebugCompile // devFreeDebugCompile
prodDebugCompile // devNoFreeDebugCompile
prodReleaseCompile // devFreeReleaseCompile
} // devNoFreeReleaseCompile
// mockDebugCompile
// prodDebugCompile
// prodReleaseCompile
//}
dependencies { dependencies {
@ -142,9 +150,9 @@ dependencies {
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.6.0' androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.6.0'
} }
play { //play {
serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json") // serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json")
track = "Alpha" // track = "Alpha"
enabled = false // enabled = false
} //}

View file

@ -10,7 +10,7 @@
android:label="${label}" android:label="${label}"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/LeanbackAppTheme"
tools:replace="android:label" tools:replace="android:label"
tools:ignore="GoogleAppIndexingWarning"> tools:ignore="GoogleAppIndexingWarning">
<activity <activity
@ -18,6 +18,7 @@
android:banner="@drawable/banner" android:banner="@drawable/banner"
android:label="${label}" android:label="${label}"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:theme="@style/LeanbackAppTheme"
tools:ignore="LockedOrientationActivity"> tools:ignore="LockedOrientationActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -35,11 +36,13 @@
<activity <activity
android:name=".events.EventsActivity" android:name=".events.EventsActivity"
android:parentActivityName=".conferences.ConferencesActivity"/> android:parentActivityName=".conferences.ConferencesActivity"
android:theme="@style/LeanbackAppTheme"/>
<activity <activity
android:name=".detail.DetailsActivity" android:name=".detail.DetailsActivity"
android:exported="true" android:exported="true"
android:parentActivityName=".conferences.ConferencesActivity"> android:parentActivityName=".conferences.ConferencesActivity"
android:theme="@style/LeanbackAppTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>

View file

@ -358,7 +358,7 @@ class ConferencesBrowseFragment : BrowseSupportFragment() {
} }
companion object { companion object {
const val FRAGMENT = R.id.browse_fragment private val FRAGMENT = R.id.browse_fragment
private val TAG = ConferencesBrowseFragment::class.java.simpleName private val TAG = ConferencesBrowseFragment::class.java.simpleName
} }
} }

View file

@ -393,7 +393,7 @@ class EventDetailsFragment : DetailsSupportFragment() {
private const val DETAIL_THUMB_WIDTH = 254 private const val DETAIL_THUMB_WIDTH = 254
private const val DETAIL_THUMB_HEIGHT = 143 private const val DETAIL_THUMB_HEIGHT = 143
const val DEFAULT_DRAWABLE = R.drawable.default_background private val DEFAULT_DRAWABLE = R.drawable.default_background
private const val ACTION_PLAY: Long = 0L private const val ACTION_PLAY: Long = 0L
private const val ACTION_ADD_WATCHLIST = 1L private const val ACTION_ADD_WATCHLIST = 1L

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="AppTheme" parent="@style/Theme.Leanback"> <style name="LeanbackAppTheme" parent="@style/Theme.Leanback">
<item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item><!--loading-spinner--> <item name="android:colorAccent">@color/accent</item><!--loading-spinner-->

View file

@ -1,14 +1,17 @@
plugins { plugins {
id 'com.android.application' id 'com.android.library'
// id 'com.android.application'
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-kapt' id 'kotlin-kapt'
id 'kotlin-android-extensions' id 'kotlin-android-extensions'
id 'com.github.triplet.play' version '2.6.2' // id 'com.github.triplet.play' version '2.6.2'
id "androidx.navigation.safeargs.kotlin" id "androidx.navigation.safeargs.kotlin"
} }
apply from: "${rootProject.projectDir}/flavors.gradle"
String appName = "Chaosflix"
String versionString = new File("versionfile").text.trim() //String appName = "Chaosflix"
//String versionString = new File("versionfile").text.trim()
android { android {
@ -16,85 +19,85 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig { defaultConfig {
applicationId "de.nicidienase.chaosflix" // applicationId "de.nicidienase.chaosflix"
minSdkVersion rootProject.ext.minSDK minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK targetSdkVersion rootProject.ext.targetSDK
manifestPlaceholders = [label: appName] // manifestPlaceholders = [label: appName]
// odd for touch, even for leanback // odd for touch, even for leanback
versionCode 1 versionCode 1
versionName versionString // versionName versionString
if(project.hasProperty("versionCode")){ // if(project.hasProperty("versionCode")){
versionCode = project.property("versionCode") as int // versionCode = project.property("versionCode") as int
println "Setting VersionCode from property: $versionCode" // println "Setting VersionCode from property: $versionCode"
} // }
if(project.hasProperty("versionName")){ // if(project.hasProperty("versionName")){
versionName = project.property("versionName") as String // versionName = project.property("versionName") as String
println "Setting versionName from property: $versionName" // println "Setting versionName from property: $versionName"
} // }
} }
signingConfigs { // signingConfigs {
//noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck // //noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
release { // release {
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore.trim()).exists() && file(chaosflixKeystore.trim()).isFile()) { // if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore.trim()).exists() && file(chaosflixKeystore.trim()).isFile()) {
println "Release app signing is configured: will sign APK" // println "Release app signing is configured: will sign APK"
storeFile file(chaosflixKeystore.trim()) // storeFile file(chaosflixKeystore.trim())
storePassword chaosflixStorePassword.trim() // storePassword chaosflixStorePassword.trim()
keyAlias chaosflixKeyName.trim() // keyAlias chaosflixKeyName.trim()
keyPassword chaosflixKeyPassword.trim() // keyPassword chaosflixKeyPassword.trim()
} else { // } else {
println "App signing data not found. Will not sign." // println "App signing data not found. Will not sign."
} // }
} // }
} // }
buildTypes { buildTypes {
debug { debug {
applicationIdSuffix ".debug" // applicationIdSuffix ".debug"
manifestPlaceholders = [label: appName + "-debug"] // manifestPlaceholders = [label: appName + "-debug"]
minifyEnabled false minifyEnabled false
} }
release { release {
minifyEnabled true minifyEnabled true
shrinkResources true // shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro' 'proguard-rules.pro'
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore.trim()).exists() && file(chaosflixKeystore.trim()).isFile()) { // if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore.trim()).exists() && file(chaosflixKeystore.trim()).isFile()) {
signingConfig signingConfigs.release // signingConfig signingConfigs.release
} // }
} }
} }
flavorDimensions "stage", "libs" with flavorConfig
// flavorDimensions "stage", "libs"
productFlavors { // productFlavors {
prod { // prod {
dimension "stage" // dimension "stage"
} // }
dev { // dev {
dimension "stage" // dimension "stage"
applicationIdSuffix ".dev" //// applicationIdSuffix ".dev"
manifestPlaceholders = [label: appName + "-Dev"] //// manifestPlaceholders = [label: appName + "-Dev"]
} // }
mock { // mock {
dimension "stage" // dimension "stage"
applicationIdSuffix ".mock" //// applicationIdSuffix ".mock"
manifestPlaceholders = [label: appName + "-Mock"] //// manifestPlaceholders = [label: appName + "-Mock"]
} // }
free { // free {
dimension "libs" // dimension "libs"
} // }
noFree{ // noFree {
dimension "libs" // dimension "libs"
} // }
} // }
variantFilter { variant -> // variantFilter { variant ->
def names = variant.flavors*.name // def names = variant.flavors*.name
if (name.contains("prod") && name.contains("Debug")){ // if (name.contains("prod") && name.contains("Debug")){
setIgnore(true) // setIgnore(true)
} // }
} // }
packagingOptions { packagingOptions {
@ -117,11 +120,11 @@ android {
testOptions.unitTests.includeAndroidResources = true testOptions.unitTests.includeAndroidResources = true
playConfigs { // playConfigs {
prodNoFreeRelease { // prodNoFreeRelease {
enabled = true // enabled = true
} // }
} // }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
@ -132,14 +135,19 @@ android {
} }
configurations { //configurations {
mockDebugCompile // devFreeDebugCompile
prodDebugCompile // devNoFreeDebugCompile
prodReleaseCompile // devFreeReleaseCompile
} // devNoFreeReleaseCompile
// mockDebugCompile
// prodDebugCompile
// prodReleaseCompile
//}
dependencies { dependencies {
implementation project(':common') implementation project(':common')
implementation project(':leanback')
implementation('com.mikepenz:aboutlibraries:6.1.1@aar') { implementation('com.mikepenz:aboutlibraries:6.1.1@aar') {
transitive = true transitive = true
@ -185,10 +193,10 @@ dependencies {
} }
} }
play { //play {
serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json") // serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json")
track = "alpha" // track = "alpha"
releaseStatus = "draft" // releaseStatus = "draft"
enabled = false // enabled = false
artifactDir = file("build/outputs/apk/prodNoFree/release/touch-prod-noFree-release.apk") // artifactDir = file("build/outputs/apk/prodNoFree/release/touch-prod-noFree-release.apk")
} //}

View file

@ -22,14 +22,16 @@
<activity <activity
android:name=".SplashActivity" android:name=".SplashActivity"
android:label="${label}" android:label="${label}"
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".NavigationActivity" <activity android:name=".NavigationActivity"
android:launchMode="singleInstance"> android:launchMode="singleInstance"
android:theme="@style/AppTheme">
<nav-graph android:value="@navigation/main_navigation"/> <nav-graph android:value="@navigation/main_navigation"/>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEARCH" /> <action android:name="android.intent.action.SEARCH" />
@ -42,9 +44,11 @@
android:name=".playback.PlayerActivity" android:name=".playback.PlayerActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/AppTheme"
android:parentActivityName=".NavigationActivity"/> android:parentActivityName=".NavigationActivity"/>
<activity android:name="net.rdrei.android.dirchooser.DirectoryChooserActivity" /> <activity android:name="net.rdrei.android.dirchooser.DirectoryChooserActivity" />
<activity android:name=".favoritesimport.FavoritesImportActivity" > <activity android:name=".favoritesimport.FavoritesImportActivity"
android:theme="@style/AppTheme" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />

View file

@ -9,6 +9,7 @@ import android.os.Bundle
import android.preference.PreferenceManager import android.preference.PreferenceManager
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders import androidx.lifecycle.ViewModelProviders
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
import de.nicidienase.chaosflix.BuildConfig import de.nicidienase.chaosflix.BuildConfig
@ -18,6 +19,7 @@ import de.nicidienase.chaosflix.common.DarkmodeUtil
import de.nicidienase.chaosflix.common.checkPermission import de.nicidienase.chaosflix.common.checkPermission
import de.nicidienase.chaosflix.common.viewmodel.PreferencesViewModel import de.nicidienase.chaosflix.common.viewmodel.PreferencesViewModel
import de.nicidienase.chaosflix.common.viewmodel.ViewModelFactory import de.nicidienase.chaosflix.common.viewmodel.ViewModelFactory
import de.nicidienase.chaosflix.leanback.conferences.ConferencesActivity
import net.rdrei.android.dirchooser.DirectoryChooserActivity import net.rdrei.android.dirchooser.DirectoryChooserActivity
import net.rdrei.android.dirchooser.DirectoryChooserConfig import net.rdrei.android.dirchooser.DirectoryChooserConfig
@ -77,11 +79,14 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
} }
updateSummary() updateSummary()
val downloadFolderPref = this.findPreference("download_folder")
val cleanCachePref = this.findPreference("delete_data")
val exportFavorites = this.findPreference("export_favorites")
val importFavorites = this.findPreference("import_favorites")
val disableAnalytics = this.findPreference("disable_analytics") val disableAnalytics = this.findPreference("disable_analytics")
val downloadFolderPref = this.findPreference("download_folder")
// debug preferences
val cleanCachePref: Preference? = this.findPreference("delete_data")
val exportFavorites: Preference? = this.findPreference("export_favorites")
val importFavorites: Preference? = this.findPreference("import_favorites")
val switchUi: Preference? = this.findPreference("launch_other")
downloadFolderPref?.setOnPreferenceClickListener { downloadFolderPref?.setOnPreferenceClickListener {
checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE, PERMISSION_REQUEST_CHOOSE_DOWNLOAD_FOLDER) { checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE, PERMISSION_REQUEST_CHOOSE_DOWNLOAD_FOLDER) {
@ -109,6 +114,11 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
return@setOnPreferenceClickListener true return@setOnPreferenceClickListener true
} }
switchUi?.setOnPreferenceClickListener {
requireContext().startActivity(Intent(requireContext(), ConferencesActivity::class.java))
return@setOnPreferenceClickListener true
}
disableAnalytics.setOnPreferenceChangeListener { _, state -> disableAnalytics.setOnPreferenceChangeListener { _, state ->
when (state) { when (state) {
true -> { true -> {

View file

@ -26,7 +26,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/appbar_header_height" android:layout_height="@dimen/appbar_header_height"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:theme="@style/AppTheme"> android:theme="@style/LeanbackAppTheme">
<net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout <net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar" android:id="@+id/collapsing_toolbar"
@ -67,7 +67,7 @@
app:subtitleTextColor="@color/white" app:subtitleTextColor="@color/white"
app:layout_collapseMode="pin" app:layout_collapseMode="pin"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/AppTheme"/> app:popupTheme="@style/LeanbackAppTheme"/>
</net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout> </net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout>