-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for UNAssociationsPopupElement to Popup #981
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
remove support for hasEdits from contentAwareTopbar
replace form references with popup remove caching attachments in popupstate
add doc
deprecate popup composable
disable lint for missing translations
# Conflicts: # toolkit/popup/api/popup.api
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.
@puneet-pdx I wasn't able to load any map to test in the micro-app but here is some initial feedback.
...PopupApp/app/src/main/java/com/arcgismaps/toolkit/popupapp/screens/mapscreen/MapViewModel.kt
Outdated
Show resolved
Hide resolved
toolkit/popup/src/main/java/com/arcgismaps/toolkit/popup/Popup.kt
Outdated
Show resolved
Hide resolved
*/ | ||
@Deprecated( | ||
message = "Maintained for binary compatibility. Use the overload that uses the PopupState object.", | ||
level = DeprecationLevel.HIDDEN |
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.
Any particular reason this is hidden? Imo this would be confusing to anyone who upgrades to v300 and is not able to see this function. Not sure what the user story for Popup is but imo having this as a warning with later removal or a full removal in 300.0 might be a better approach.
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.
I vaguely remember Soren mentioning it(I am not 100%). I have changed it to warning for now. Soren can chime in later.
toolkit/popup/src/main/java/com/arcgismaps/toolkit/popup/Popup.kt
Outdated
Show resolved
Hide resolved
...smaps/toolkit/popup/internal/element/utilityassociationselement/UtilityAssociationDetails.kt
Outdated
Show resolved
Hide resolved
...s/toolkit/popup/internal/element/utilityassociationselement/UtilityAssociationGroupResult.kt
Show resolved
Hide resolved
...toolkit/popup/internal/element/utilityassociationselement/UtilityAssociationsElementState.kt
Outdated
Show resolved
Hide resolved
.../arcgismaps/toolkit/popup/internal/element/utilityassociationselement/UtilityAssociations.kt
Outdated
Show resolved
Hide resolved
...kit/popup/src/main/java/com/arcgismaps/toolkit/popup/internal/navigation/NavigationAction.kt
Outdated
Show resolved
Hide resolved
optimize mediaElementState
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.
Looking good! Just a few more comments below.
...popup/src/main/java/com/arcgismaps/toolkit/popup/internal/element/media/MediaElementState.kt
Outdated
Show resolved
Hide resolved
...popup/src/main/java/com/arcgismaps/toolkit/popup/internal/element/media/MediaPopupElement.kt
Show resolved
Hide resolved
onBackPressed: () -> Unit, | ||
onClose: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { |
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.
One thing I noticed while running the app is, the popup shows up in an expandable group with an empty title. So I was wondering why the expandable group since there is no group element in popups.
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.
All the element types are displayed as an expandable cards with title being the title of the element. This is a requirement coming from the design
A stretch goal is to have the individual view elements be "collapsible". When collapsed, a popup element view just displays the title of the element.
https://devtopia.esri.com/runtime/common-toolkit/blob/main/designs/Popup/Popup.md#miscellaneous
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.
Ah I see. Perhaps it is a design discussion then, because the collapsed elements do have a title. I will leave that up to you..
add doc
@kaushikrw I have addressed your comments here and also enabled the close button in the micro app. I am looking into updating |
update AssociationItem properties to display with the latest on FeatureBranch
Change bottomsheet behavior for onDismiss
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.
Looks good! I just have one comment below.
LaunchedEffect(scaffoldState.bottomSheetState.currentValue) { | ||
if (scaffoldState.bottomSheetState.currentValue == SheetValue.Hidden) { | ||
unselectFeature(viewModel.geoElement, viewModel.layer) | ||
viewModel.updatePopupState(null) | ||
viewModel.setGeoElement(null) | ||
} | ||
} |
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.
These sequence of steps are already happening in the Popup.onDismiss
event so it seems redundant to do the same here.
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.
The Popup.onDismiss
does not get invoked if the user manually closes the bottomsheet. If that happens then without this there will be no bottomsheet on the screen and there will be a feature selected on the screen. This makes sure that the behavior is consistent for both the workflows.
Update API file
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.
Wow! that's quite an undertaking. I will test it out tomorrow. For now here is my review of the code.
if (viewModel.popupState != null) { | ||
Popup( | ||
viewModel.popupState!!, |
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.
could use smart casting here rather than the !! operator.
if (viewModel.popupState != null) { | |
Popup( | |
viewModel.popupState!!, | |
val state = viewModel.popupState | |
if (state != null) { | |
Popup( | |
state, |
// guard against null value | ||
as? UtilityAssociationsElementState ?: return@composable | ||
// Display the association details | ||
UtilityAssociationDetails( |
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.
It seems like this function should not be called if the result and filter are null, rather than passing in the state and returning early from a composable function. Could the parameters be
val result = utilityAssociationsElementState.state.selectedAssociationResult
val filter = state.selectedFilterResult?.filter
if (result != null && filter != null) {
UtilityAssociationDetails(
result,
filter,
modifier = Modifier.fillMaxSize()
)
}
val associationResult = state.selectedAssociationResult ?: return | ||
val filter = state.selectedFilterResult?.filter ?: return |
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.
see comment on this function at the call site
} | ||
associationResult.getFractionAlongEdge()?.let { fraction -> | ||
FractionAlongEdgeControl( | ||
fraction = associationResult.getFractionAlongEdge()!!.toFloat(), |
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.
fraction = associationResult.getFractionAlongEdge()!!.toFloat(), | |
fraction = fraction.toFloat(), |
private var _loading: MutableState<Boolean> = mutableStateOf(true) | ||
|
||
private var _filters: MutableState<List<UtilityAssociationsFilterResult>> = | ||
mutableStateOf(emptyList()) |
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.
nitpick: normally a backing var is directly above the val that uses it.
// TODO remove for release | ||
println("encountered element of type ${element::class.java}") |
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.
don't forget to remove this!
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.
Great work!
Thanks @kaushikrw and @sorenoid for the reviews! Merging this. |
Related to issue: # https://devtopia.esri.com/runtime/apollo/issues/1407
Description:
Add support for UNAssociations in Popups.
Summary of changes:
PopupState
, Add new Popup Composable that takes the State objectPre-merge Checklist