Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix list animations for split tunneling #5145

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

Rawa
Copy link
Contributor

@Rawa Rawa commented Sep 11, 2023

This pull requests fixes the animations on the Split tunneling view in 3 ways:

  • Removes alpha on list items causing them to overlap and look weird.
  • Adds animateItemPlacement on missing items
  • Fixes modifier on BaseCell so it is applied on top most item

Note: Animations only fully work in release mode and thus might look a bit choppy or incorrect when using emulator and/or debug mode.


This change is Reviewable

@linear
Copy link

linear bot commented Sep 11, 2023

DROID-321 Fix list animation for split tunneling

When adding or removing apps for split tunneling the list does not animate nicely. Items pop in and out. The row item also has alpha which causes it to look extra weird.

@Rawa Rawa changed the title Fix list animation for split tunneling droid 321 Fix list animations for split tunneling Sep 11, 2023
Copy link
Contributor Author

@Rawa Rawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/BaseCell.kt line 92 at r1 (raw file):

        Spacer(modifier = Modifier.weight(1.0f))

        Column(modifier = modifier.wrapContentWidth().wrapContentHeight()) { bodyView() }

I looked through the uses of this modifier, as far as I can tell it is only used to animate rows, thus I repurposed correctly it to the top most element.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SplitTunnelingCell.kt line 72 at r1 (raw file):

                .padding(vertical = Dimens.listItemDivider)
                .background(
                    MaterialTheme.colorScheme.primaryContainer.compositeOver(

Since primaryContainer has alpha we need to compositeOver the background color to not make it transparent. Long-term we should fix the colors to not use any alpha.

@Pururun Pururun added the Android Issues related to Android label Sep 11, 2023
@Rawa Rawa self-assigned this Sep 11, 2023
Copy link
Contributor

@Pururun Pururun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Rawa)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/BaseCell.kt line 92 at r1 (raw file):

Previously, Rawa (David Göransson) wrote…

I looked through the uses of this modifier, as far as I can tell it is only used to animate rows, thus I repurposed correctly it to the top most element.

I think this was a remnant from when the base cell was more complex, so should fine to move it.

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Rawa Rawa force-pushed the fix-list-animation-for-split-tunneling-droid-321 branch from 911612a to 28c2cb7 Compare September 12, 2023 08:51
@Pururun Pururun force-pushed the fix-list-animation-for-split-tunneling-droid-321 branch from 28c2cb7 to 1f68473 Compare September 12, 2023 09:20
@Pururun Pururun merged commit fa73320 into main Sep 12, 2023
9 checks passed
@Pururun Pururun deleted the fix-list-animation-for-split-tunneling-droid-321 branch September 12, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants