-
Notifications
You must be signed in to change notification settings - Fork 545
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
[Android] Log warning if card element has a ShowCard select action #2717
[Android] Log warning if card element has a ShowCard select action #2717
Conversation
General: Dont forget the "How Verified" section in the description :) |
{ | ||
m_viewDictionary.put(elementId, foundView); | ||
} | ||
renderedCard.addWarning(new AdaptiveWarning(AdaptiveWarning.SELECT_SHOW_CARD_ACTION, "ShowCard not supported for SelectAction")); |
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.
addWarning [](start = 29, length = 10)
Cool is this coming from teh sharedmodel now?
String elementId = target.GetElementId(); | ||
|
||
View foundView = rootView.findViewWithTag(new TagContent(elementId)); | ||
if (foundView != 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.
do you expect to not find the target element in the rootView object? What are the cases where this is null? Do we care about those cases ? (looks like today we dont since we'll silently not add them them to dictionary yeah? #ByDesign
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.
if the card creator were to toggle the visibility of an element that doesn't exist (giving an id that doesn't exist for any element in the card) then the found view will be null and as such we can't change the visibility for that view
In reply to: 277106481 [](ancestors = 277106481)
} | ||
|
||
v.setPressed(m_invisibleCard.getVisibility() != View.VISIBLE); | ||
for (int i = 0; i < m_hiddenCardsLayout.getChildCount(); ++i) |
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 [](start = 69, length = 3)
Nit: Consider using the more concise foreach equivalent syntax (i think for (View child : m_hiddenCardsLayout) ) ; #ByDesign
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.
Android API is weird in this kind of stuff so we have to get the elements one by one as it doesn't provide a "getChildren" method
In reply to: 277107266 [](ancestors = 277107266)
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.
Hmm you mean there is a requirement for being able to use the foreach java syntax for this collection?
In reply to: 278224177 [](ancestors = 278224177,277107266)
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.
As far as I know, to use the foreach syntax you must have the collection or be able to get the collection with a getter method that returns the complete collection, in this case, Android only allows us to grab one element at a time by querying each index
https://stackoverflow.com/questions/18668897/android-get-all-children-elements-of-a-viewgroup
In reply to: 278771455 [](ancestors = 278771455,278224177,277107266)
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.
…icrosoft#2717) * Add warning for showcard action in select action * Reverse the inheritance between SelectAction and regular action
Adds warning log for card elements having a select action with type ShowCard