-
Notifications
You must be signed in to change notification settings - Fork 384
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
Scroll to first checked custom location on open #7870
Scroll to first checked custom location on open #7870
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 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 183 at r1 (raw file):
} lazyListState.ScrollToFirstCheckedItem(state)
We hide away the Launched effect a bit here I feel like. It would be nice to have it one the top level if possible.
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, 2 unresolved discussions (waiting on @kl)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 247 at r1 (raw file):
LaunchedEffect(Unit) { if (firstChecked != -1) { scrollToItem(firstChecked)
In select location we also have the animateScrollAndCentralizeItem
function which we could use here also if we make it public and move it somewhere.
254b02b
to
2fe917f
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: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @kl and @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 247 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
In select location we also have the
animateScrollAndCentralizeItem
function which we could use here also if we make it public and move it somewhere.
Does this one animate? Or just scroll to it? Not sure what we want though 🙃
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: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @kl and @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 247 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
Does this one animate? Or just scroll to it? Not sure what we want though 🙃
IIRC animateScrollAndCentralizeItem
is so that the item is centered and not at the top. Why we need both is a bit of mystery to me as well,
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: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @kl and @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 247 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
IIRC
animateScrollAndCentralizeItem
is so that the item is centered and not at the top. Why we need both is a bit of mystery to me as well,
Just checked and without scrollToItem
you get this weird flickering and without animateScrollAndCentralizeItem
it will just show the scrolled to item at the top of the list so I think both are required.
2fe917f
to
abf5001
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: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @Pururun and @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 183 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
We hide away the Launched effect a bit here I feel like. It would be nice to have it one the top level if possible.
Done.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt
line 247 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
Just checked and without
scrollToItem
you get this weird flickering and withoutanimateScrollAndCentralizeItem
it will just show the scrolled to item at the top of the list so I think both are required.
Done.
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 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/extensions/LazyListExtensions.kt
line 45 at r3 (raw file):
} suspend fun LazyListState.animateScrollAndCentralizeItem(index: Int) {
Nice
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 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (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, 1 unresolved discussion (waiting on @kl)
abf5001
to
c35a459
Compare
This change is