-
Notifications
You must be signed in to change notification settings - Fork 392
Refactor screens to use preview parameter provider #6810
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
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 45 of 45 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @kl)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/FilterUiStatePreviewParameterProvider.kt
line 9 at r1 (raw file):
import net.mullvad.mullvadvpn.lib.model.ProviderId val PROVIDER = Provider(providerId = ProviderId("provider1"), ownership = Ownership.MullvadOwned)
Private?
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/SelectLocationsUiStatePreviewParameterProvider.kt
line 17 at r1 (raw file):
import net.mullvad.mullvadvpn.lib.model.RelayItem val RELAY =
Could this also be private?
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/VpnSettingsUiStatePreviewParameterProvider.kt
line 39 at r1 (raw file):
selectedWireguardPort = Constraint.Any, customWireguardPort = Port(PORT), availablePortRanges = listOf(PortRange(IntRange(PORT, PORT + PORT))),
PORT + PORT looks a bit weird to me. This also looks like a perfect reason to introduce the following function to our domain:
operator fun rangeTo(other: Port): PortRange
Then we can create a PortRange from two ports, e.g:
val lowerPort = Port(10)
val upperPort = Port(20)
val portRange: PortRange = lowerPort..upperPort
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreen.kt
line 47 at r1 (raw file):
import org.koin.androidx.compose.koinViewModel @Preview("Default|WithoutCustomApi|WithCustomApi")
Just wondering, these are the names for the previews with the order they were passed into the preview, correct? |
is a magical divider for preview names?
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/EditCustomListUiState.kt
line 7 at r1 (raw file):
import net.mullvad.mullvadvpn.lib.model.GeoLocationId sealed interface EditCustomListUiState {
Nice fixing these! ⭐
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 all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @kl)
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: all files reviewed, 4 unresolved discussions (waiting on @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/FilterUiStatePreviewParameterProvider.kt
line 9 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Private?
Done.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/SelectLocationsUiStatePreviewParameterProvider.kt
line 17 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Could this also be private?
Done.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/VpnSettingsUiStatePreviewParameterProvider.kt
line 39 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
PORT + PORT looks a bit weird to me. This also looks like a perfect reason to introduce the following function to our domain:
operator fun rangeTo(other: Port): PortRange
Then we can create a PortRange from two ports, e.g:
val lowerPort = Port(10) val upperPort = Port(20) val portRange: PortRange = lowerPort..upperPort
Done.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreen.kt
line 47 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Just wondering, these are the names for the previews with the order they were passed into the preview, correct?
|
is a magical divider for preview names?
|
does not have any special meaning. There's no way to specify a preview name for an individual preview when using preview parameters so I put the all the names separated by |
on the on the preview composable.
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 4 of 4 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Port.kt
line 15 at r2 (raw file):
override fun toString(): String = value.toString() operator fun rangeTo(other: Port): PortRange = PortRange(value..other.value)
🌟
4ea30b3
to
9dfe743
Compare
9dfe743
to
7f99e9a
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 2 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
This change is