Fixed
Status Update
Comments
do...@traveloka.com <do...@traveloka.com> #2
Yes, this is correct. Having individual navigation graphs on each activities overrides or disallow up navigation to the main activity.
pa...@gmail.com <pa...@gmail.com> #3
I believe I have found the potential problem that is causing this:
// @ androidx.navigation.NavController
// line 124
// Now record the pop operation that we were sent
if (!mBackStack.isEmpty()) {
mBackStack.removeLast();
}
// We never want to leave NavGraphs on the top of the stack
while (!mBackStack.isEmpty()
&& mBackStack.peekLast() instanceof NavGraph) {
popBackStack();
}
the condition in while loop is never satisfied because of the above `if` statement above it has already removed the last item of the mBackStack (which was the NavGraph) and thus popBackStack() is never called again.
// @ androidx.navigation.NavController
// line 124
// Now record the pop operation that we were sent
if (!mBackStack.isEmpty()) {
mBackStack.removeLast();
}
// We never want to leave NavGraphs on the top of the stack
while (!mBackStack.isEmpty()
&& mBackStack.peekLast() instanceof NavGraph) {
popBackStack();
}
the condition in while loop is never satisfied because of the above `if` statement above it has already removed the last item of the mBackStack (which was the NavGraph) and thus popBackStack() is never called again.
pa...@gmail.com <pa...@gmail.com> #4
According to Ian Lake, NavigationUI does not support up navigation yet, that is why this is a feature request.
+Pedro Varela - we don't support navigating up through activities as part of NavigationUI yet, please star the feature request:https://issuetracker.google.com/issues/79993862 (this issue)
+Pedro Varela - we don't support navigating up through activities as part of NavigationUI yet, please star the feature request:
ga...@google.com <ga...@google.com> #5
Ian Lake said Up navigation is not supported through activities, only through fragments.
pa...@google.com <pa...@google.com> #6
With the introduction of AppBarConfiguration, this is now possible with the setupActionBarWithNavController method by using an empty set of top level destinations (to always show the up button) and then overriding onSupportNavigateUp() as per the documentation: https://developer.android.com/topic/libraries/architecture/navigation/navigation-ui#action_bar
I'll leave this bug open as we still need an equivalent API for the Toolbar versions.
I'll leave this bug open as we still need an equivalent API for the Toolbar versions.
ap...@google.com <ap...@google.com> #7
This allows you to call onSupportNavigateUp() (or super.onSupportNavigateUp() if you're using an ActionBar) from that method to have your Up button transition between activities.
This will be available in 1.0.0-alpha09.
pa...@google.com <pa...@google.com> #8
There is Jarks when implementing this way to navigate up between activities.
pa...@gmail.com <pa...@gmail.com> #9
Thanks pa..., it's really nice to receive updates and useful details (root cause, CL, workaround) about the issue. I wish everyone was like this!
Description
Java version "1.8.0_121"
Jetifier version: 1.0.0-beta04
Let there be a Library Foo with the following 'proguard-rules.txt' file:
# DBFlow
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }
-dontwarn com.raizlabs.android.dbflow.**
# Note: the configuration keeps the entry point 'com.raizlabs.android.dbflow.config.FlowManager$GlobalDatabaseHolder { FlowManager$GlobalDatabaseHolder(com.raizlabs.android.dbflow.config.FlowManager$1); }', but not the descriptor class 'com.raizlabs.android.dbflow.config.FlowManager$1'
-keep class com.raizlabs.android.dbflow.config.FlowManager$*
When trying to jetify this library:
./jetifier-standalone -i /Users/someuser/Downloads/foo/foo.aar -o newfoo.aar
The Jetifier fails with the following output:
Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition near index 147
com/raizlabs/android/dbflow/.*
# Note: the configuration keeps the entry point 'com/raizlabs/android/dbflow/config/FlowManager$GlobalDatabaseHolder { FlowManager$GlobalDatabaseHolder(com/raizlabs/android/dbflow/config/FlowManager$1); }'
^
at java.util.regex.Pattern.error(Pattern.java:1955)
at java.util.regex.Pattern.closure(Pattern.java:3157)
at java.util.regex.Pattern.sequence(Pattern.java:2134)
at java.util.regex.Pattern.expr(Pattern.java:1996)
at java.util.regex.Pattern.compile(Pattern.java:1696)
at java.util.regex.Pattern.<init>(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at com.android.tools.build.jetifier.core.type.TypesMap.matchOldProguardForNewTypes(TypesMap.kt:112)
[...]
If i remove the notes, the new 'proguard-rules.txt' looks like this:
# DBFlow
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }
-dontwarn com.raizlabs.android.dbflow.**
-keep class com.raizlabs.android.dbflow.config.FlowManager$*
And this runs through the jetifier just fine. Please provide a fix for this issue, since i have to patch my dependencies currently in order to make AndroidX work for me.