Skip to content

Conversation

@wxxsfxyzm
Copy link
Contributor

Summary

This pull request introduces custom screen transition animations to enhance the overall user experience during navigation.

The key change is the implementation of a custom slide/fade effect for navigating from main screens (i.e., screens hosted in the bottom navigation bar) to detail screens. Transitions between the bottom navigation bar tabs themselves retain a simple, clean cross-fade effect to ensure a fast and smooth user interaction.

This PR also addresses the root cause of an issue where custom animations were being overridden by the navigation library's defaults.

Root Cause

During implementation, it was discovered that custom transition animations defined in the defaultTransitions parameter of the DestinationsNavHost in MainActivity were not being applied. Instead, a default fade-in/fade-out animation was always present.

The root cause was traced to the compose-destinations KSP (Kotlin Symbol Processing) code generator. By default, the generator creates a NavGraphSpec (e.g., RootNavGraph.kt) that includes its own defaultTransitions property. This property, defined at compile-time within the generated graph object, has a higher precedence than the defaultTransitions parameter supplied to the DestinationsNavHost composable at runtime.

As a result, our intended custom animations were being ignored and overridden by the generated default.

Solution

To resolve this precedence issue permanently, this PR adopts the official configuration method recommended by the compose-destinations library.

  • The following KSP argument has been added to the app/build.gradle.kts file:
ksp {
    arg("compose-destinations.defaultTransitions", "none")
}
  • This argument instructs the code generator to omit the defaultTransitions property from the generated NavGraphSpec.

  • By removing the higher-priority, generated default, the defaultTransitions parameter on DestinationsNavHost now functions as the effective default, allowing our custom animation logic to execute as intended.

Animation Logic Details

The new animation logic is conditional and defined within MainActivity. It distinguishes between two primary navigation types:

  • Main Screen → Detail Screen:

    • Enter: The new detail screen slides in from the right.

    • Exit: The old main screen slides out to the left while fading out.

  • Detail Screen → Main Screen (on Pop):

    • Pop Enter: The main screen slides back in from the left while fading in.

    • Pop Exit: The detail screen slides out to the right.

  • Between Bottom Navigation Tabs:

    • A simple cross-fade (fadeIn/fadeOut) is maintained for these transitions to provide a quick and non-disruptive experience when switching between primary sections of the app.

@tiann tiann merged commit ee72b8e into tiann:main Jul 14, 2025
16 of 22 checks passed
@rifsxd
Copy link
Contributor

rifsxd commented Jul 14, 2025

Feels like an AI coded PR to me not gonna lie

@0x-br0k3n
Copy link

0x-br0k3n commented Jul 14, 2025

Feels like an AI coded PR to me not gonna lie

Fr 😂

@nanoplayer
Copy link

Looks like AI while looking at the description and comments, i doubt anyone writes that much for real

rsuntk pushed a commit to rsuntk/KernelSU that referenced this pull request Jul 14, 2025
This pull request introduces custom screen transition animations to
enhance the overall user experience during navigation.

The key change is the implementation of a custom slide/fade effect for
navigating from main screens (i.e., screens hosted in the bottom
navigation bar) to detail screens. Transitions between the bottom
navigation bar tabs themselves retain a simple, clean cross-fade effect
to ensure a fast and smooth user interaction.

This PR also addresses the root cause of an issue where custom
animations were being overridden by the navigation library's defaults.
During implementation, it was discovered that custom transition
animations defined in the `defaultTransitions` parameter of the
`DestinationsNavHost` in `MainActivity` were not being applied. Instead,
a default fade-in/fade-out animation was always present.

The root cause was traced to the `compose-destinations` KSP (Kotlin
Symbol Processing) code generator. By default, the generator creates a
`NavGraphSpec` (e.g., `RootNavGraph.kt`) that includes its own
`defaultTransitions` property. This property, defined at compile-time
within the generated graph object, has a higher precedence than the
`defaultTransitions` parameter supplied to the `DestinationsNavHost`
composable at runtime.

As a result, our intended custom animations were being ignored and
overridden by the generated default.
To resolve this precedence issue permanently, this PR adopts the
official configuration method recommended by the `compose-destinations`
library.

- The following KSP argument has been added to the
`app/build.gradle.kts` file:

```kotlin
ksp {
    arg("compose-destinations.defaultTransitions", "none")
}
```

- This argument instructs the code generator to omit the
`defaultTransitions` property from the generated `NavGraphSpec`.

- By removing the higher-priority, generated default, the
`defaultTransitions` parameter on `DestinationsNavHost` now functions as
the effective default, allowing our custom animation logic to execute as
intended.
The new animation logic is conditional and defined within
`MainActivity`. It distinguishes between two primary navigation types:

- Main Screen → Detail Screen:

   - Enter: The new detail screen slides in from the right.

   - Exit: The old main screen slides out to the left while fading out.

- Detail Screen → Main Screen (on Pop):

- Pop Enter: The main screen slides back in from the left while fading
in.

   - Pop Exit: The detail screen slides out to the right.

- Between Bottom Navigation Tabs:

- A simple cross-fade (`fadeIn`/`fadeOut`) is maintained for these
transitions to provide a quick and non-disruptive experience when
switching between primary sections of the app.

Signed-off-by: rsuntk <[email protected]>
@devnoname120
Copy link

No reason not to merge IMO if the PR is good. Whether it was written by slamming one's head against the keyboard, with esoteric telepathy, or using AI, all that matters is the question: is the PR good and maintainable? Everything else is gate-keeping and status signaling.

@wxxsfxyzm
Copy link
Contributor Author

wxxsfxyzm commented Jul 15, 2025

Feels like an AI coded PR to me not gonna lie

Using AI to generate comments and pr descriptions is not allowed here? I'm new here, if so, I'll be more careful.
The code implementation, however, is my own work, not AI-generated. I first use it in my Andrid Application. After a casual conversation with one of the repository's contributors, he encouraged me to contribute the animation implementation here.

@ghost
Copy link

ghost commented Jul 15, 2025

Feels like an AI coded PR to me not gonna lie

What's wrong with that if PR is good?

rsuntk pushed a commit to rsuntk/KernelSU that referenced this pull request Sep 1, 2025
This pull request introduces custom screen transition animations to
enhance the overall user experience during navigation.

The key change is the implementation of a custom slide/fade effect for
navigating from main screens (i.e., screens hosted in the bottom
navigation bar) to detail screens. Transitions between the bottom
navigation bar tabs themselves retain a simple, clean cross-fade effect
to ensure a fast and smooth user interaction.

This PR also addresses the root cause of an issue where custom
animations were being overridden by the navigation library's defaults.

During implementation, it was discovered that custom transition
animations defined in the `defaultTransitions` parameter of the
`DestinationsNavHost` in `MainActivity` were not being applied. Instead,
a default fade-in/fade-out animation was always present.

The root cause was traced to the `compose-destinations` KSP (Kotlin
Symbol Processing) code generator. By default, the generator creates a
`NavGraphSpec` (e.g., `RootNavGraph.kt`) that includes its own
`defaultTransitions` property. This property, defined at compile-time
within the generated graph object, has a higher precedence than the
`defaultTransitions` parameter supplied to the `DestinationsNavHost`
composable at runtime.

As a result, our intended custom animations were being ignored and
overridden by the generated default.

To resolve this precedence issue permanently, this PR adopts the
official configuration method recommended by the `compose-destinations`
library.

- The following KSP argument has been added to the
`app/build.gradle.kts` file:

```kotlin
ksp {
    arg("compose-destinations.defaultTransitions", "none")
}
```

- This argument instructs the code generator to omit the
`defaultTransitions` property from the generated `NavGraphSpec`.

- By removing the higher-priority, generated default, the
`defaultTransitions` parameter on `DestinationsNavHost` now functions as
the effective default, allowing our custom animation logic to execute as
intended.

The new animation logic is conditional and defined within
`MainActivity`. It distinguishes between two primary navigation types:

- Main Screen → Detail Screen:

   - Enter: The new detail screen slides in from the right.

   - Exit: The old main screen slides out to the left while fading out.

- Detail Screen → Main Screen (on Pop):

- Pop Enter: The main screen slides back in from the left while fading
in.

   - Pop Exit: The detail screen slides out to the right.

- Between Bottom Navigation Tabs:

- A simple cross-fade (`fadeIn`/`fadeOut`) is maintained for these
transitions to provide a quick and non-disruptive experience when
switching between primary sections of the app.
fadlyas07 added a commit to bengal-upstream/KernelSU that referenced this pull request Sep 13, 2025
* 'main' of https://github.com/tiann/KernelSU: (42 commits)
  Unmount isolated process which forks from zygote unconditionally (tiann#2747)
  fix 'for' loop problem (tiann#2745)
  update resetprop (tiann#2733)
  Strip JNI debug logs on release build (tiann#2732)
  manager: Support search module (tiann#2730)
  manager: Add uninstall 2nd confirm (tiann#2729)
  manager: Fix some issues (tiann#2725)
  manager: fix button issues in module cards (tiann#2719)
  manager: switch ui to miuix design style (tiann#2710)
  Revert "Handle unmount for isolated process correctly" (tiann#2718)
  Handle unmount for isolated process correctly (tiann#2696)
  Reset seccomp filter count when escaping to root (tiann#2708)
  kernel: selinux: rules: Micro-optimize get_policydb() and fix illegal RCU lock usage in handle_sepolicy() (tiann#2695)
  Update resetprop from Magisk v30.2 (tiann#2700)
  ksud: support vendor_boot patching for some odd devices (tiann#2650)
  ksud: make clippy happy (tiann#2683)
  feat(ui): improve predictive back animations (tiann#2675)
  kernel: added new prctl CMD_GET_MANAGER_UID to get the uid of the crowned manager (tiann#2673)
  kernel: selinux: rules: Fix illegal RCU lock usage in apply_kernelsu_rules() (tiann#2646)
  manger: fix lkm detection (tiann#2654)
  ...

 Conflicts:
	kernel/core_hook.c
	kernel/selinux/rules.c
	kernel/throne_tracker.c

Change-Id: Iebf7dd870a7d9e35f4cecbf97fa13eeb174b7b5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants