diff --git a/Habitica/build.gradle b/Habitica/build.gradle index e996dc737..f73884efd 100644 --- a/Habitica/build.gradle +++ b/Habitica/build.gradle @@ -1,25 +1,17 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'com.google.gms.google-services' -apply plugin: 'com.google.firebase.crashlytics' -apply plugin: 'realm-android' -apply plugin: 'androidx.navigation.safeargs' -apply plugin: 'com.google.firebase.firebase-perf' -apply plugin: 'jacoco' +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'kotlin-kapt' -buildscript { - repositories { - mavenLocal() - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' - classpath 'net.sourceforge.pmd:pmd-java:5.5.3' - } + id 'com.google.gms.google-services' + id 'com.google.firebase.crashlytics' + id 'realm-android' + id 'androidx.navigation.safeargs' + id 'com.google.firebase.firebase-perf' } +apply plugin: 'kotlin-android' + repositories { mavenLocal() mavenCentral() @@ -145,6 +137,8 @@ dependencies { } } androidTestImplementation "org.jetbrains.kotlin:kotlin-reflect:1.6.21" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + } android { @@ -347,7 +341,7 @@ if (HRPG_PROPS_FILE.canRead()) { } } } else { - throw new InvalidUserDataException('habitica.properties found but some entries are missing') + throw new MissingResourceException('habitica.properties found but some entries are missing') } } else { throw new MissingResourceException('habitica.properties not found') @@ -366,7 +360,7 @@ if (HRPG_RES_FILE.canRead()) { } } } else { - throw new InvalidUserDataException('habitica.resources found but some entries are missing') + throw new MissingResourceException('habitica.resources found but some entries are missing') } } else { throw new MissingResourceException('habitica.resources not found') @@ -386,10 +380,6 @@ gradle.projectsEvaluated { apply plugin: 'com.google.gms.google-services' -jacoco { - toolVersion = "0.8.7" -} - task ktlint(type: JavaExec, group: "verification") { description = "Check Kotlin code style." classpath = configurations.ktlint diff --git a/Habitica/res/layout/dialog_pet_suggest_hatch.xml b/Habitica/res/layout/dialog_pet_suggest_hatch.xml index bdf898fd3..e07ce4887 100644 --- a/Habitica/res/layout/dialog_pet_suggest_hatch.xml +++ b/Habitica/res/layout/dialog_pet_suggest_hatch.xml @@ -53,7 +53,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" app:shimmer_repeat_delay="8000"> - - - ? = null private var hasMount: Boolean = false private var hasPet: Boolean = false private val imageViewHolder = mutableListOf() @@ -212,7 +213,10 @@ class AvatarView : FrameLayout { } var backgroundName = avatar.preferences?.background - if (showBackground && backgroundName?.isNotEmpty() == true) { + if (preview != null) { + layerMap[preview?.keys?.first()] = preview?.values?.first() + if (resetHasAttributes) hasBackground = true + } else if (showBackground && backgroundName?.isNotEmpty() == true) { backgroundName = substituteOrReturn(spriteSubstitutions["backgrounds"], backgroundName) layerMap[LayerType.BACKGROUND] = "background_$backgroundName" if (resetHasAttributes) hasBackground = true @@ -429,9 +433,10 @@ class AvatarView : FrameLayout { } } - fun setAvatar(avatar: Avatar) { + fun setAvatar(avatar: Avatar, preview: Map? = null) { val oldUser = this.avatar this.avatar = avatar + preview?.let { this.preview = preview } var equals = false if (oldUser != null) { diff --git a/wearos/build.gradle b/wearos/build.gradle index 8459d0f7c..94e9f952a 100644 --- a/wearos/build.gradle +++ b/wearos/build.gradle @@ -4,6 +4,7 @@ plugins { id 'kotlin-kapt' id 'dagger.hilt.android.plugin' } +apply plugin: 'kotlin-android' android { compileSdk 32 @@ -65,4 +66,9 @@ dependencies { implementation "com.google.dagger:hilt-android:2.41" kapt "com.google.dagger:hilt-compiler:2.41" + implementation "androidx.core:core-ktx:1.7.0" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} +repositories { + mavenCentral() } \ No newline at end of file