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-kapt'
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()
@ -22,17 +24,16 @@ android {
versionCode 1
versionName versionString
if(project.hasProperty("versionCode")){
if (project.hasProperty("versionCode")) {
versionCode = project.property("versionCode") as int
println "Setting VersionCode from property: $versionCode"
}
if(project.hasProperty("versionName")){
if (project.hasProperty("versionName")) {
versionName = project.property("versionName") as String
println "Setting versionName from property: $versionName"
}
}
signingConfigs {
//noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
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 {
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"
playConfigs {
prodNoFree {
enabled = true
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
dataBinding.enabled = true
viewBinding.enabled = true
}
configurations {
mockDebugCompile
prodDebugCompile
prodReleaseCompile
}
//configurations {
// devFreeDebugImplementation
// devNoFreeDebugImplementation
// devFreeReleaseImplementation
// devNoFreeReleaseImplementation
// mockDebugImplementation
// prodDebugImplementation
// prodReleaseImplementation
//}
dependencies {
// implementation project(':touch')
// implementation project(':leanback')
implementation project(':touch')
implementation project(':leanback')
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:roundIcon="@mipmap/ic_launcher_round"
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>
</manifest>

View file

@ -1,7 +1,11 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "de.mannodermaus.android-junit5"
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-kapt'
id "de.mannodermaus.android-junit5"
}
apply from: "${rootProject.projectDir}/flavors.gradle"
String versionString = new File("versionfile").text.trim()
@ -48,53 +52,54 @@ android {
}
}
flavorDimensions "stage", "libs"
productFlavors {
prod {
dimension "stage"
}
dev {
dimension "stage"
}
mock {
dimension "stage"
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"
}
}
}
}
with flavorConfig
// flavorDimensions "stage", "libs"
//
// productFlavors {
// prod {
// dimension "stage"
// }
//
// dev {
// dimension "stage"
// }
//
// mock {
// dimension "stage"
// 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"
// }
//
// }
// }
// }
libraryVariants.all { variant ->
def flavors = variant.productFlavors

View file

@ -23,6 +23,10 @@
android:id="@+id/import_favorites"
android:key="import_favorites"
android:title="@string/import_favorites"/>
<Preference
android:id="@+id/launch_other_ui"
android:key="launch_other"
android:title="Launch other UI"/>
</PreferenceCategory>
</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 {
id 'com.android.application'
id 'com.android.library'
// id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
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 {
buildToolsVersion '27.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "de.nicidienase.chaosflix"
manifestPlaceholders = [label: appName]
// applicationId "de.nicidienase.chaosflix"
// manifestPlaceholders = [label: appName]
minSdkVersion rootProject.ext.minSDK
targetSdkVersion rootProject.ext.targetSDK
// odd for touch, even for leanback
versionCode 1
versionName versionString
if(project.hasProperty("versionCode")){
versionCode = project.property("versionCode") as int
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."
}
}
// versionName versionString
// if(project.hasProperty("versionCode")){
// versionCode = project.property("versionCode") as int
// 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."
// }
// }
// }
buildTypes {
debug {
applicationIdSuffix ".debug"
manifestPlaceholders = [label: appName + "-debug"]
// applicationIdSuffix ".debug"
// manifestPlaceholders = [label: appName + "-debug"]
minifyEnabled false
}
release {
minifyEnabled true
shrinkResources true
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
signingConfig signingConfigs.release
}
// if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
// signingConfig signingConfigs.release
// }
}
}
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"
}
}
variantFilter { variant ->
def names = variant.flavors*.name
if (name.contains("prod") && name.contains("Debug")){
setIgnore(true)
}
}
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"
// }
// }
// variantFilter { variant ->
// def names = variant.flavors*.name
// if (name.contains("prod") && name.contains("Debug")){
// setIgnore(true)
// }
// }
packagingOptions {
@ -104,18 +108,22 @@ android {
lintOptions.abortOnError = false
dataBinding.enabled = true
buildToolsVersion rootProject.ext.buildToolsVersion
playConfigs {
prodNoFree {
enabled = true
}
}
// playConfigs {
// prodNoFree {
// enabled = true
// }
// }
}
configurations {
mockDebugCompile
prodDebugCompile
prodReleaseCompile
}
//configurations {
// devFreeDebugCompile
// devNoFreeDebugCompile
// devFreeReleaseCompile
// devNoFreeReleaseCompile
// mockDebugCompile
// prodDebugCompile
// prodReleaseCompile
//}
dependencies {
@ -142,9 +150,9 @@ dependencies {
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.6.0'
}
play {
serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json")
track = "Alpha"
enabled = false
}
//play {
// serviceAccountCredentials = file("../chaosflix-d1d09f33cbb2.json")
// track = "Alpha"
// enabled = false
//}

View file

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

View file

@ -358,7 +358,7 @@ class ConferencesBrowseFragment : BrowseSupportFragment() {
}
companion object {
const val FRAGMENT = R.id.browse_fragment
private val FRAGMENT = R.id.browse_fragment
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_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_ADD_WATCHLIST = 1L

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item><!--loading-spinner-->

View file

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

View file

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

View file

@ -9,6 +9,7 @@ import android.os.Bundle
import android.preference.PreferenceManager
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import com.google.android.material.snackbar.Snackbar
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.viewmodel.PreferencesViewModel
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.DirectoryChooserConfig
@ -77,11 +79,14 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
}
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 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 {
checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE, PERMISSION_REQUEST_CHOOSE_DOWNLOAD_FOLDER) {
@ -109,6 +114,11 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
return@setOnPreferenceClickListener true
}
switchUi?.setOnPreferenceClickListener {
requireContext().startActivity(Intent(requireContext(), ConferencesActivity::class.java))
return@setOnPreferenceClickListener true
}
disableAnalytics.setOnPreferenceChangeListener { _, state ->
when (state) {
true -> {

View file

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