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

Add auto connect and lockdown mode screen #5592

Conversation

MaryamShaghaghi
Copy link
Contributor

@MaryamShaghaghi MaryamShaghaghi commented Dec 13, 2023


This change is Reviewable

@albin-mullvad albin-mullvad added the Android Issues related to Android label Dec 14, 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.

Reviewed 25 of 25 files at r1, all commit messages.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @MaryamShaghaghi)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 48 at r1 (raw file):

@Composable
fun AutoConnectCarousel() {
    val pagerState = rememberPagerState(pageCount = { 3 })

Should define this as a constant, such as const val CAROUSEL_PAGE_SIZE = 3


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 62 at r1 (raw file):

                pageIndicatorRef) =
                createRefs()
            HtmlText(

Use annotated string instead of HtmlText


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 78 at r1 (raw file):

                            }
                    ),
                textSize = 12.sp.value,

Try to use a style instead.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 98 at r1 (raw file):

                        contentDescription = null,
                        tint = Color.Unspecified,
                        modifier = Modifier.rotate(180f).alpha(AlphaDescription)

Magic number


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 121 at r1 (raw file):

            )

            if (page != 2) {

This is better to write as page < CAROUSEL_PAGE_SIZE


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 142 at r1 (raw file):

            }

            HtmlText(

Same as above user AnnotatedString


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 158 at r1 (raw file):

                            }
                    ),
                textSize = 12.sp.value,

Use style instead (which you can do if you use annotated string)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 175 at r1 (raw file):

                repeat(pagerState.pageCount) { iteration ->
                    val color =
                        if (pagerState.currentPage == iteration) Color.LightGray else Color.DarkGray

Use theme colors instead.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt line 277 at r1 (raw file):

            state = lazyListState
        ) {
            item {

Can we wrap this in requireActivity(Intent("android.settings.VPN_SETTINGS")) ?


android/lib/resource/src/main/res/values/strings.xml line 80 at r1 (raw file):

    <string name="auto_connect_and_lockdown_mode_footer">Makes sure the device is always on the VPN tunnel.</string>
    <string name="go_to_vpn_settings">Go to VPN settings</string>
    <string name="carousel_slide_1_text_1">The Auto-connect and Lockdown mode settings can be found in the Android system settings, follow this guide to enable one or both.</string>

Is it possible to make this a bit more expressive? Like auto_connect_carousel_first_slide_top_text or something? The same is applicable to all of these.


android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/dimensions/Dimensions.kt line 11 at r1 (raw file):

    val backButtonSideMargin: Dp = 30.dp,
    val bigIconSize: Dp = 44.dp,
    val bottomPadding: Dp = 3.dp,

Preferable use something divided by 2 or even better 4.

@MaryamShaghaghi MaryamShaghaghi force-pushed the add-auto-connect-and-lockdown-mode-screen branch from 63972f0 to 95751dc Compare December 14, 2023 13:38
Copy link
Contributor Author

@MaryamShaghaghi MaryamShaghaghi 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: 24 of 25 files reviewed, 11 unresolved discussions (waiting on @Pururun)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 48 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Should define this as a constant, such as const val CAROUSEL_PAGE_SIZE = 3

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 62 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Use annotated string instead of HtmlText

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 78 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Try to use a style instead.

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 98 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Magic number

do we need to create another icon for back arrow instead of rotating it, or we should have another const val?


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 121 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

This is better to write as page < CAROUSEL_PAGE_SIZE

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 142 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Same as above user AnnotatedString

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 158 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Use style instead (which you can do if you use annotated string)

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 175 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Use theme colors instead.

Done.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt line 277 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Can we wrap this in requireActivity(Intent("android.settings.VPN_SETTINGS")) ?

Done.


android/lib/resource/src/main/res/values/strings.xml line 80 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Is it possible to make this a bit more expressive? Like auto_connect_carousel_first_slide_top_text or something? The same is applicable to all of these.

Done.


android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/dimensions/Dimensions.kt line 11 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Preferable use something divided by 2 or even better 4.

Done.

@MaryamShaghaghi MaryamShaghaghi force-pushed the add-auto-connect-and-lockdown-mode-screen branch from d6c6335 to 6e085e5 Compare December 15, 2023 09:41
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 6 of 6 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MaryamShaghaghi)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 98 at r1 (raw file):

Previously, MaryamShaghaghi (Maryam Shaghaghi) wrote…

do we need to create another icon for back arrow instead of rotating it, or we should have another const val?

I will retract this since we have used hardcoded numbers elsewhere in the app.


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/AutoConnectCarousel.kt line 193 at r3 (raw file):

                    .constrainAs(pageIndicatorRef) {
                        top.linkTo(lowerTextRef.bottom)

Remove this line

MaryamShaghaghi and others added 2 commits December 15, 2023 11:22
Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>
Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>

Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>
@MaryamShaghaghi MaryamShaghaghi force-pushed the add-auto-connect-and-lockdown-mode-screen branch from 6e085e5 to a01ffb0 Compare December 15, 2023 10:24
MaryamShaghaghi and others added 5 commits December 15, 2023 11:29
Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>

Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>
Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>

Co-Authored-By: Boban Sijuk <49131853+Boki91@users.noreply.github.com>
@MaryamShaghaghi MaryamShaghaghi force-pushed the add-auto-connect-and-lockdown-mode-screen branch from a01ffb0 to 8649867 Compare December 15, 2023 15:15
@Pururun
Copy link
Contributor

Pururun commented Jan 3, 2024

This will be continued here: #5643

@Pururun Pururun closed this Jan 3, 2024
Copy link
Contributor

@sabercodic sabercodic left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 7 files at r4, 3 of 3 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MaryamShaghaghi and @Pururun)

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.

4 participants