Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Aug 27, 2024
1 parent cf36f91 commit 2d5dc6f
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ output-metadata.json
/Habitica/jacoco.exec
*.dm
/fastlane/upload_slack.py
.kotlin
6 changes: 2 additions & 4 deletions Habitica/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -171,10 +173,6 @@ android {
aidl true
}

composeOptions {
kotlinCompilerExtensionVersion = rootProject.compose_compiler
}

signingConfigs {
release
}
Expand Down
6 changes: 6 additions & 0 deletions Habitica/res/layout/subscription_benefits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Habitica/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &amp; More Drops</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -108,6 +112,7 @@ private fun BottomSheetWrapper(
horizontalAlignment = Alignment.CenterHorizontally,
modifier =
Modifier
.verticalScroll(rememberScrollState())
.padding(horizontal = 4.dp)
.background(
HabiticaTheme.colors.windowBackground,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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"
}
}

Expand Down
7 changes: 4 additions & 3 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ kotlin {
js(IR) {
browser()
nodejs()
binaries.library()
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.habitrpg.shared.habitica

import android.os.Parcel

actual typealias HParcel = Parcel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package com.habitrpg.shared.habitica

import android.os.Parcelable
Expand Down
Original file line number Diff line number Diff line change
@@ -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?)
}
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.habitrpg.shared.habitica

actual class HParcel
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ actual class Platform actual constructor() {
}

actual interface HParcelable
actual class HParcel
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NAME=4.5.0
CODE=8051
CODE=8061

0 comments on commit 2d5dc6f

Please sign in to comment.