Skip to content

Commit 595a8c4

Browse files
jossiwolfcopybara-github
authored andcommitted
[GH] [Navigation] Make NamedNavArgument's fields public
## Proposed Changes Relnote: NamedNavArgument's `name`, `argument` and destructuring functions are now public ## Testing Test: N/A ## Issues Fixed Fixes: b/181320559 This is an imported pull request from #174. Resolves #174 Github-Pr-Head-Sha: 4343fab GitOrigin-RevId: 59a1b48 Change-Id: I03782da5f97d1fcd461ae017ac28be6c1c7dc7f5
1 parent 4d0cb0b commit 595a8c4

4 files changed

Lines changed: 37 additions & 4 deletions

File tree

‎navigation/navigation-compose/api/current.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ package androidx.navigation.compose {
1111
}
1212

1313
public final class NamedNavArgument {
14+
method public operator String component1();
15+
method public operator androidx.navigation.NavArgument component2();
16+
method public androidx.navigation.NavArgument getArgument();
17+
method public String getName();
18+
property public final androidx.navigation.NavArgument argument;
19+
property public final String name;
1420
}
1521

1622
public final class NamedNavArgumentKt {

‎navigation/navigation-compose/api/public_plus_experimental_current.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ package androidx.navigation.compose {
1111
}
1212

1313
public final class NamedNavArgument {
14+
method public operator String component1();
15+
method public operator androidx.navigation.NavArgument component2();
16+
method public androidx.navigation.NavArgument getArgument();
17+
method public String getName();
18+
property public final androidx.navigation.NavArgument argument;
19+
property public final String name;
1420
}
1521

1622
public final class NamedNavArgumentKt {

‎navigation/navigation-compose/api/restricted_current.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ package androidx.navigation.compose {
1111
}
1212

1313
public final class NamedNavArgument {
14+
method public operator String component1();
15+
method public operator androidx.navigation.NavArgument component2();
16+
method public androidx.navigation.NavArgument getArgument();
17+
method public String getName();
18+
property public final androidx.navigation.NavArgument argument;
19+
property public final String name;
1420
}
1521

1622
public final class NamedNavArgumentKt {

‎navigation/navigation-compose/src/main/java/androidx/navigation/compose/NamedNavArgument.kt‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,24 @@ public fun navArgument(
3333
* Construct a named [NavArgument] by using the [navArgument] method.
3434
*/
3535
public class NamedNavArgument internal constructor(
36-
private val name: String,
37-
private val argument: NavArgument
36+
37+
/**
38+
* The name the argument is associated with
39+
*/
40+
public val name: String,
41+
42+
/**
43+
* The [NavArgument] associated with the name
44+
*/
45+
public val argument: NavArgument
3846
) {
39-
internal operator fun component1(): String = name
40-
internal operator fun component2(): NavArgument = argument
47+
/**
48+
* Provides destructuring access to this [NamedNavArgument]'s [name]
49+
*/
50+
public operator fun component1(): String = name
51+
52+
/**
53+
* Provides destructuring access to this [NamedNavArgument]'s [argument]
54+
*/
55+
public operator fun component2(): NavArgument = argument
4156
}

0 commit comments

Comments
 (0)