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
[TIMOB-24503] Android: Implement notification quick actions #9278
Conversation
parameters: | ||
- name: icon | ||
summary: Icon of the action button as URL or resource ID | ||
type: [Number, String] |
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.
We should indicate that the icon must be 32x32 dp (ie: 32x32 pixels for mdpi).
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 think the icons have to use a holo dark theme on Android 4.x and a light material theme on Android 5.0 and above. Which means developers need to provide versioned drawable resources (ie: "drawable-mdpi-v21" for material). Or perhaps those details should go into the notification guide?
@@ -154,6 +154,22 @@ methods: | |||
summary: Allows to enable the indeterminate mode. | |||
type: Boolean | |||
|
|||
- name: addAction | |||
summary: Add an action button to the notification |
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.
We should document that a notification can have up to 3 action buttons. Additional actions added will be ignored.
|
||
- name: title | ||
summary: Title of the action button | ||
type: Number |
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.
"title" type should be "String", not "Number".
String iconFullUrl = resolveUrl(null, iconUrl); | ||
iconId = TiUIHelper.getResourceId(iconFullUrl); | ||
} | ||
notificationBuilder.addAction(iconId, title, pendingIntent.getPendingIntent()); |
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.
Perhaps we should do the following if title is null. (I'm thinking icon-only action buttons.)
if (title == null) {
title = "";
}
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.
And if "pendingIntent" is null, we should log an error or throw an exception indicating that this argument cannot be null.
@jquick-axway Updated PR, |
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.
CR: Pass
9f832af
to
86c6bc5
Compare
FR Passed.
Studio Ver: 4.9.1.201707200100 |
Requires support library
26.0.0
#927426.0.0
featuresetGroupAlertBehavior()
TEST CASE
JIRA Ticket