Skip to content

Add feature indicators to connect screen #6778

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

Merged
merged 7 commits into from
Sep 18, 2024

Conversation

Rawa
Copy link
Contributor

@Rawa Rawa commented Sep 10, 2024

This PR will rework the Connect screen and add support for feature indicators showing which features are currently active.


This change is Reviewable

Copy link

linear bot commented Sep 10, 2024

@Rawa Rawa self-assigned this Sep 10, 2024
@Rawa Rawa added the Android Issues related to Android label Sep 10, 2024
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 52 files reviewed, all discussions resolved


-- commits line 5 at r1:
I'll split the commits at a later stage

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.

Reviewed 32 of 52 files at r1, 20 of 20 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Rawa)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/button/MullvadButton.kt line 160 at r2 (raw file):

        contentPadding =
            if (hasIcon) {
                PaddingValues(horizontal = 0.dp, vertical = Dimens.buttonVerticalPadding)

IIRC this was added for a reason, I guess this works fine now?


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt line 239 at r2 (raw file):

        val screenHeight = configuration.screenHeightDp.dp
        val indicatorPercentOffset =
            if (screenHeight < 700.dp) INDICATOR_PERCENT_OFFSET_UNDER_700_DP

Magic number?


android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt line 138 at r2 (raw file):

        small = RoundedCornerShape(4.dp),
        medium = RoundedCornerShape(4.dp),
        large = RoundedCornerShape(12.dp),

Should check if we are using large somewhere else, it was set 0.dp for some reason.

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.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Rawa)


android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt line 138 at r2 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Should check if we are using large somewhere else, it was set 0.dp for some reason.

Seems like it is not being used anywhere. Retracting.

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: all files reviewed, 1 unresolved discussion (waiting on @Pururun)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/button/MullvadButton.kt line 160 at r2 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

IIRC this was added for a reason, I guess this works fine now?

This is the default


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt line 239 at r2 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Magic number?

Yes! Fixing

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.

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

@Pururun Pururun self-requested a review September 10, 2024 13:55
Pururun
Pururun previously approved these changes Sep 10, 2024
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.

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

@Rawa Rawa requested a review from Pururun September 16, 2024 07:45
@Rawa Rawa force-pushed the add-feature-indicators-to-the-main-screen-droid-1108 branch from 3a23588 to e1bddac Compare September 16, 2024 09:16
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.

Found a crash after I increased font scaling:

java.lang.IllegalArgumentException: Key "true40" was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item.

Reviewable status: 51 of 55 files reviewed, all discussions resolved

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.

Reviewable status: 51 of 55 files reviewed, 1 unresolved discussion (waiting on @Rawa)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/ConnectionDetailPanel.kt line 77 at r6 (raw file):

                },
        )
        Text(

This should be single line

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.

Great find:
https://issuetracker.google.com/issues/367440149 & https://issuetracker.google.com/issues/355003185

Apparently a limitation with how FlowRow works today, it is experimental and this will be addressed in upcoming changes according to the comment in the second issue, however it is unclear when this will be done. I guess it probably won't be until compose 1.8.

Reviewable status: 49 of 55 files reviewed, 1 unresolved discussion (waiting on @Pururun)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/ConnectionDetailPanel.kt line 77 at r6 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

This should be single line

Fixed

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.

I've set maxLines to 2 for now, alignment with design is needed before merging of this PR.

Reviewable status: 49 of 55 files reviewed, 1 unresolved discussion (waiting on @Pururun)

@Rawa Rawa force-pushed the add-feature-indicators-to-the-main-screen-droid-1108 branch 2 times, most recently from b74ec58 to e0707b6 Compare September 18, 2024 12:14
@Rawa Rawa force-pushed the add-feature-indicators-to-the-main-screen-droid-1108 branch from e0707b6 to 3e607a6 Compare September 18, 2024 12:35
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.

Nice work with the crash workaround!
Just a minor thing with the changelog.

Reviewed 3 of 4 files at r6, 29 of 29 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)


android/CHANGELOG.md line 32 at r7 (raw file):

### Changed
- Update colors in the app to be more in line with material design.
- Connect screen has been redesigned and now includes feature indicators.

Feature indicators is defined as a new thing that is added in the desktop changelog I think we should do that as well. It is a new feature after all.

@Rawa Rawa force-pushed the add-feature-indicators-to-the-main-screen-droid-1108 branch from 3e607a6 to 4906946 Compare September 18, 2024 12:55
@Rawa Rawa requested a review from Pururun September 18, 2024 12:55
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 1 of 1 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)

@Rawa Rawa merged commit b50a829 into main Sep 18, 2024
31 of 32 checks passed
@Rawa Rawa deleted the add-feature-indicators-to-the-main-screen-droid-1108 branch September 18, 2024 12:57
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.

2 participants