Skip to content

Commit

Permalink
Fixes #210
Browse files Browse the repository at this point in the history
  • Loading branch information
raamcosta committed Sep 13, 2022
1 parent 60070f5 commit 7b083f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.ramcosta.composedestinations.navargs.primitives

import android.net.Uri
import com.ramcosta.composedestinations.navargs.utils.encodeForRoute
const val ENCODED_NULL = "%02null%03"
const val DECODED_NULL: String = "\u0002null\u0003"

const val ENCODED_NULL = "%@null@"
val DECODED_NULL: String = Uri.decode(ENCODED_NULL)

val encodedComma = encodeForRoute(",")
const val encodedComma = "%2C"

@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
fun <E: Enum<*>> Class<E>.valueOfIgnoreCase(enumValueName: String): E {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.ramcosta.composedestinations.navargs.primitives

import android.net.Uri
import android.os.Bundle
import androidx.lifecycle.SavedStateHandle
import androidx.navigation.NavBackStackEntry
Expand All @@ -10,10 +9,10 @@ import com.ramcosta.composedestinations.navargs.utils.encodeForRoute
object DestinationsStringNavType : DestinationsNavType<String?>() {

internal const val ENCODED_EMPTY_STRING = "%02%03"
internal val DECODED_EMPTY_STRING: String = Uri.decode(ENCODED_EMPTY_STRING)
internal const val DECODED_EMPTY_STRING: String = "\u0002\u0003"

private const val ENCODED_DEFAULT_VALUE_STRING_PREFIX = "%@def@"
private val DECODED_DEFAULT_VALUE_STRING_PREFIX: String = Uri.decode(ENCODED_DEFAULT_VALUE_STRING_PREFIX)
private const val ENCODED_DEFAULT_VALUE_STRING_PREFIX = "%02def%03"
private const val DECODED_DEFAULT_VALUE_STRING_PREFIX: String = "\u0002def\u0003"

override fun put(bundle: Bundle, key: String, value: String?) {
StringType.put(bundle, key, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ fun DirectionDestination.DrawerContent(
}
GoToProfileConfirmationDestination,
SettingsScreenDestination,
ThemeSettingsDestination -> Unit
ThemeSettingsDestination,
TestScreen3Destination,
ProfileSettingsScreenDestination -> Unit
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProfileViewModel(
Log.d("ProfileViewModel", "navArgs= $navArgs")
}

override val groupName: String = navArgs.groupName?.ifEmpty { "user doesn't belong to any group" } ?: "null"
override val groupName: String = navArgs.groupName?.ifEmpty { "\"\"" } ?: "null"

override val id: Long = navArgs.id

Expand Down

0 comments on commit 7b083f7

Please sign in to comment.