mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-18 11:49:01 +00:00
Update dependencies
This commit is contained in:
parent
cf36f91011
commit
2d5dc6f0a4
22 changed files with 97 additions and 27 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -73,3 +73,4 @@ output-metadata.json
|
|||
/Habitica/jacoco.exec
|
||||
*.dm
|
||||
/fastlane/upload_slack.py
|
||||
.kotlin
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ plugins {
|
|||
id 'com.google.firebase.firebase-perf'
|
||||
|
||||
id 'jacoco-report-aggregation'
|
||||
id 'org.jetbrains.kotlin.plugin.compose'
|
||||
id("kotlin-parcelize")
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin-android'
|
||||
|
|
@ -171,10 +173,6 @@ android {
|
|||
aidl true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = rootProject.compose_compiler
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="6dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
|
@ -55,6 +56,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="6dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
style="@style/Body1"
|
||||
|
|
@ -88,6 +90,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="6dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
style="@style/Body1"
|
||||
|
|
@ -120,6 +123,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="6dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
style="@style/Body1"
|
||||
|
|
@ -151,6 +155,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="6dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
style="@style/Body1"
|
||||
|
|
@ -184,6 +189,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="6dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@
|
|||
<string name="subscribe_prompt">Become a subscriber to receive these exclusive benefits!</string>
|
||||
<string name="subscribe_listitem1">Free Monthly Gems</string>
|
||||
<string name="subscribe_listitem2">Monthly Mystic Hourglass</string>
|
||||
<string name="subscribe_listitem3">Never miss an item with 1 Mystic Hourglass a month to use in the Time Travelers Shop!</string>
|
||||
<string name="subscribe_listitem3">Monthly Mystery Items</string>
|
||||
<string name="subscribe_listitem4">Special Subscriber Pet</string>
|
||||
<string name="subscribe_listitemFaint">Hang on with 1 HP!</string>
|
||||
<string name="subscribe_listitem5">Special Pet & More Drops</string>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ open class ChecklistItem : RealmObject, BaseMainObject, Parcelable {
|
|||
|
||||
companion object CREATOR : Parcelable.Creator<ChecklistItem>, RealmModel {
|
||||
override fun createFromParcel(source: Parcel): ChecklistItem = ChecklistItem(source)
|
||||
|
||||
override fun newArray(size: Int): Array<ChecklistItem?> = arrayOfNulls(size)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,13 +24,17 @@ class InboxAdapter(private var user: User?) :
|
|||
var onCopyMessage: ((ChatMessage) -> Unit)? = null
|
||||
|
||||
private fun isPositionIntroMessage(position: Int): Boolean {
|
||||
return (position == super.getItemCount() - 1)
|
||||
return (position == super.getItemCount())
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return if (isPositionIntroMessage(position)) FIRST_MESSAGE else NORMAL_MESSAGE
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return super.getItemCount() + 1
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class GiftBalanceGemsFragment : BaseFragment<FragmentGiftGemBalanceBinding>() {
|
|||
if (isGifting) return
|
||||
isGifting = true
|
||||
try {
|
||||
val amount = binding?.giftEditText?.text.toString().strip().toInt()
|
||||
val amount = binding?.giftEditText?.text.toString().trim().toInt()
|
||||
giftedMember?.id?.let {
|
||||
activity?.lifecycleScope?.launchCatching({
|
||||
isGifting = false
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import android.app.Activity
|
|||
import android.view.ViewGroup
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.gestures.scrollable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||
|
|
@ -13,7 +14,9 @@ import androidx.compose.foundation.layout.navigationBarsIgnoringVisibility
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.windowInsetsBottomHeight
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ModalBottomSheet
|
||||
import androidx.compose.material3.SheetValue
|
||||
|
|
@ -86,6 +89,7 @@ private fun BottomSheetWrapper(
|
|||
val systemUiController = rememberSystemUiController()
|
||||
val statusBarColor = colorResource(R.color.content_background)
|
||||
val navigationbarColor = colorResource(R.color.brand_50)
|
||||
|
||||
DisposableEffect(systemUiController) {
|
||||
systemUiController.setStatusBarColor(statusBarColor.copy(alpha = 0.3f), darkIcons = true)
|
||||
systemUiController.setNavigationBarColor(navigationbarColor, darkIcons = true)
|
||||
|
|
@ -108,6 +112,7 @@ private fun BottomSheetWrapper(
|
|||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier =
|
||||
Modifier
|
||||
.verticalScroll(rememberScrollState())
|
||||
.padding(horizontal = 4.dp)
|
||||
.background(
|
||||
HabiticaTheme.colors.windowBackground,
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@ class ValidatingEditText
|
|||
binding.errorText.text = value
|
||||
}
|
||||
var hint: CharSequence?
|
||||
get() = binding.editText.hint
|
||||
get() = binding.inputLayout.hint
|
||||
set(value) {
|
||||
binding.editText.hint = value
|
||||
binding.inputLayout.hint = value
|
||||
}
|
||||
var validator: ((String?) -> Boolean)? = null
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import android.widget.LinearLayout
|
|||
import androidx.core.view.isVisible
|
||||
import com.habitrpg.android.habitica.R
|
||||
import com.habitrpg.android.habitica.databinding.SubscriptionDetailsBinding
|
||||
import com.habitrpg.android.habitica.extensions.toZonedDateTime
|
||||
import com.habitrpg.android.habitica.models.user.SubscriptionPlan
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaIconsHelper
|
||||
import com.habitrpg.common.habitica.extensions.layoutInflater
|
||||
|
|
@ -144,11 +145,12 @@ class SubscriptionDetailsView : LinearLayout {
|
|||
|
||||
binding.gemCapTextView.text = plan.totalNumberOfGems.toString()
|
||||
|
||||
if (plan.isActive && plan.dateTerminated == null) {
|
||||
val now = LocalDate.now()
|
||||
val nextHourglassDate =
|
||||
LocalDate.now().plusMonths(plan.monthsUntilNextHourglass.toLong())
|
||||
.withDayOfMonth(1)
|
||||
val now = LocalDate.now()
|
||||
val nextHourglassDate =
|
||||
now.plusMonths(plan.monthsUntilNextHourglass.toLong())
|
||||
.withDayOfMonth(1)
|
||||
val terminatedLocalDate = plan.dateTerminated?.toZonedDateTime()?.toLocalDate()
|
||||
if (plan.isActive && (terminatedLocalDate == null || nextHourglassDate.isBefore(terminatedLocalDate))) {
|
||||
val format =
|
||||
if (now.year != nextHourglassDate.year) {
|
||||
"dd MMM yyyy"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ buildscript {
|
|||
daggerhilt_version = '2.51.1'
|
||||
firebase_bom = '31.3.0'
|
||||
kotest_version = '5.6.2'
|
||||
kotlin_version = '1.9.24'
|
||||
kotlin_version = '2.0.20'
|
||||
ktlint_version = '1.2.1'
|
||||
lifecycle_version = '2.8.4'
|
||||
markwon_version = '4.6.2'
|
||||
|
|
@ -44,7 +44,7 @@ buildscript {
|
|||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.4.2'
|
||||
classpath 'com.android.tools.build:gradle:8.5.2'
|
||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||
classpath 'com.google.gms:google-services:4.4.2'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
|
||||
|
|
@ -56,6 +56,7 @@ buildscript {
|
|||
classpath 'com.google.firebase:perf-plugin:1.4.2'
|
||||
classpath "com.google.dagger:hilt-android-gradle-plugin:$daggerhilt_version"
|
||||
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.1"
|
||||
classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.util.Properties
|
|||
plugins {
|
||||
id("com.android.library")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("org.jetbrains.kotlin.plugin.compose")
|
||||
}
|
||||
|
||||
val rootExtra = rootProject.extra
|
||||
|
|
@ -130,11 +131,11 @@ dependencies {
|
|||
testImplementation("io.kotest:kotest-framework-datatest:$kotest_version")
|
||||
testImplementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
|
||||
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
||||
androidTestImplementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
|
||||
|
||||
implementation("androidx.activity:activity-compose:1.9.0")
|
||||
implementation("androidx.activity:activity-compose:1.9.1")
|
||||
implementation("androidx.compose.runtime:runtime-livedata:$compose_version")
|
||||
implementation("androidx.compose.animation:animation:$compose_version")
|
||||
implementation("androidx.compose.ui:ui-text-google-fonts:$compose_version")
|
||||
|
|
|
|||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,6 +1,6 @@
|
|||
#Mon Jun 10 15:25:21 CEST 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ kotlin {
|
|||
js(IR) {
|
||||
browser()
|
||||
nodejs()
|
||||
binaries.library()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
package com.habitrpg.shared.habitica
|
||||
|
||||
import android.os.Parcel
|
||||
|
||||
actual typealias HParcel = Parcel
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
|
||||
|
||||
package com.habitrpg.shared.habitica
|
||||
|
||||
import android.os.Parcelable
|
||||
|
|
|
|||
|
|
@ -1,13 +1,29 @@
|
|||
package com.habitrpg.shared.habitica
|
||||
|
||||
import com.habitrpg.shared.habitica.models.responses.TaskDirectionDataDrop
|
||||
|
||||
expect class Platform() {
|
||||
val platform: String
|
||||
}
|
||||
|
||||
expect interface HParcelable
|
||||
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
|
||||
expect interface HParcelable {
|
||||
fun writeToParcel(dest: HParcel, flags: Int)
|
||||
fun describeContents(): Int
|
||||
}
|
||||
|
||||
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
|
||||
@OptIn(ExperimentalMultiplatform::class)
|
||||
@OptionalExpectation
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
expect annotation class HParcelize()
|
||||
|
||||
expect class HParcel {
|
||||
fun writeByte(byte: Byte)
|
||||
fun writeParcelable(drop: HParcelable?, flags: Int)
|
||||
fun writeDouble(experienceDelta: Double)
|
||||
fun writeInt(level: Int)
|
||||
fun writeValue(questDamage: Any?)
|
||||
fun writeString(it: String?)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.habitrpg.shared.habitica.models.responses
|
||||
|
||||
import com.habitrpg.shared.habitica.HParcel
|
||||
import com.habitrpg.shared.habitica.HParcelable
|
||||
import com.habitrpg.shared.habitica.HParcelize
|
||||
|
||||
|
|
@ -14,10 +15,20 @@ class TaskDirectionDataQuest {
|
|||
var collection: Int = 0
|
||||
}
|
||||
|
||||
@HParcelize
|
||||
data class TaskDirectionDataDrop(
|
||||
var value: Int,
|
||||
var key: String?,
|
||||
var type: String?,
|
||||
var dialog: String?,
|
||||
) : HParcelable
|
||||
) : HParcelable {
|
||||
override fun writeToParcel(dest: HParcel, flags: Int) {
|
||||
dest.writeInt(value)
|
||||
dest.writeString(key)
|
||||
dest.writeString(type)
|
||||
dest.writeString(dialog)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package com.habitrpg.shared.habitica.models.responses
|
||||
|
||||
import com.habitrpg.shared.habitica.HParcel
|
||||
import com.habitrpg.shared.habitica.HParcelable
|
||||
import com.habitrpg.shared.habitica.HParcelize
|
||||
import com.habitrpg.shared.habitica.models.AvatarStats
|
||||
|
||||
@HParcelize
|
||||
data class TaskScoringResult(
|
||||
var hasDied: Boolean = false,
|
||||
var drop: TaskDirectionDataDrop? = null,
|
||||
|
|
@ -33,4 +33,21 @@ data class TaskScoringResult(
|
|||
data._tmp?.quest?.progressDelta,
|
||||
data._tmp?.quest?.collection,
|
||||
)
|
||||
|
||||
override fun writeToParcel(dest: HParcel, flags: Int) {
|
||||
dest.writeByte(if (hasDied) 1.toByte() else 0.toByte())
|
||||
dest.writeParcelable(drop, flags)
|
||||
dest.writeDouble(experienceDelta)
|
||||
dest.writeDouble(healthDelta)
|
||||
dest.writeDouble(goldDelta)
|
||||
dest.writeDouble(manaDelta)
|
||||
dest.writeByte(if (hasLeveledUp) 1.toByte() else 0.toByte())
|
||||
dest.writeInt(level)
|
||||
dest.writeValue(questDamage)
|
||||
dest.writeValue(questItemsFound)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
package com.habitrpg.shared.habitica
|
||||
|
||||
actual class HParcel
|
||||
|
|
@ -6,3 +6,4 @@ actual class Platform actual constructor() {
|
|||
}
|
||||
|
||||
actual interface HParcelable
|
||||
actual class HParcel
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
NAME=4.5.0
|
||||
CODE=8051
|
||||
CODE=8061
|
||||
Loading…
Reference in a new issue