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-25048] Android: Implement Ti.UI.ShortcutItem for dynamic application shortcuts #9426
Conversation
Mhh, it's very different from how iOS handle shortcut-items. iOS places them on the home-screen and does not allow any hide/show interactions with it. Except for the "title" property, there is not mich parity right now. Also, it should be "ShortcutItem" to match the API. We may want to write up a wiki-page to discuss the API design before taking this into further review. Let's discuss this on Teams! |
@hansemannn Maybe I should rename iOS has this: add
remove
The only creation parameter iOS doesn't have is CREATION PARAMETERS
I'm trying not to abide by either platforms naming scheme since it's our Titanium API and should not be platform specific. |
Ahh, now it's making sense! Using "add" and "remove" would be awesome! And being able to move the intent out would also be brilliant. For the properties, we may want to use:
What do you think? And yeah, the Ti.App.iOS events may also need to move. Do you have |
cc3fd81
to
507ebbd
Compare
@hansemannn Updated PR. |
b0de39b
to
6b43702
Compare
Tests:
Generated by 🚫 dangerJS |
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.
LGTM! Just two minor things - check in comments.
import org.appcelerator.kroll.common.Log; | ||
import org.appcelerator.titanium.TiApplication; | ||
import org.appcelerator.titanium.TiC; | ||
import org.appcelerator.titanium.proxy.IntentProxy; |
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.
Unused import.
apidoc/Titanium/UI/ShortcutItem.yml
Outdated
|
||
var win = Ti.UI.createWindow({backgroundColor: 'grey'}), | ||
btn = Ti.UI.createButton({title: 'TOGGLE SHORTCUT'}), | ||
shortcut = Ti.UI.createShortcut({ |
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.
Typo in Ti.UI.createShortcut
, should be Ti.UI.createShortcutItem
.
8c86cb5
to
a06c73e
Compare
@hansemannn @ypbnv Updated PR |
@garymathews Will do the iOS change shortly after 7.0.0. |
platforms: [android, iphone, ipad] | ||
|
||
properties: | ||
- name: id |
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.
Can we use identifier
here? It's a more common property name on Titanium. iOS right now uses itemtype
, which I am okay with changing it for parity.
- name: icon | ||
summary: Shortcut icon. | ||
description: This can be set as a resource id or file path. | ||
type: [String, 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.
We should add iOS-specific notes here, because it can be a Ti.Contacts.Person instance, a constant (SHORTCUT_ICON_TYPE_*
) or name of an image (e.g. settings
for an image named settings.png
).
88f215a
to
6288401
Compare
@garymathews , Clicking the |
0ad5da9
to
cf53e76
Compare
Generated by 🚫 dangerJS |
c2a1ed3
to
4fb7e14
Compare
4fb7e14
to
07c3bb5
Compare
@lokeshchdhry Updated PR |
FR Passed. Studio Ver: 5.1.2.201810080801 |
Titanium.UI.ShortcutItem
for dynamic application shortcutsTEST CASE
REQUIREMENTS
JIRA Ticket