-
Notifications
You must be signed in to change notification settings - Fork 381
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
Add auto connect and lockdown mode screen #5592
Conversation
There was a problem hiding this 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.
63972f0
to
95751dc
Compare
There was a problem hiding this 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.
d6c6335
to
6e085e5
Compare
There was a problem hiding this 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
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>
6e085e5
to
a01ffb0
Compare
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>
a01ffb0
to
8649867
Compare
This will be continued here: #5643 |
There was a problem hiding this 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)
This change is