Skip to content
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-24765] Android: Implement Ti.UI.ShortcutItem pinning #9536

Merged
merged 1 commit into from Oct 17, 2018

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Oct 18, 2017

#9426 MUST BE MERGED FIRST

  • Implement Titanium.UI.ShortcutItem.pin() to pin shortcuts to the launcher
TEST CASE
var win = Ti.UI.createWindow({backgroundColor: 'grey'}),
    btn = Ti.UI.createButton({title: 'PIN SHORTCUT'}),
    shortcut = Ti.UI.createShortcutItem({
        id: 'test_shortcut',
        icon: Ti.Android.R.drawable.ic_dialog_info,
        title: 'TEST',
        description: 'DESCRIPTION'
    });

Ti.App.addEventListener('shortcutitemclick', function() {
    win.backgroundColor = 'blue';
});

btn.addEventListener('click', () => {
    win.backgroundColor = 'red';
    shortcut.pin();
});

win.add(btn);
win.open();

JIRA Ticket

@build
Copy link
Contributor

build commented Oct 18, 2017

Fails
🚫

😥 npm test failed. See below for details.

🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Messages
📖
> titanium-mobile@7.3.0 test /Users/build/jenkins/workspace/sdk_titanium_mobile_PR-9536-D2LTM57TF7WWOTYNXXE4VBVVT7CIP4VMS4GGP2CSJIA73OQM5AVQ
> grunt

Running "appcJs:src:lintOnly" (appcJs) task

Running "eslint:src" (eslint) task

/Users/build/jenkins/workspace/sdk_titanium_mobile_PR-9536-D2LTM57TF7WWOTYNXXE4VBVVT7CIP4VMS4GGP2CSJIA73OQM5AVQ/tests/Resources/ti.ui.maskedimage.addontest.js
27:3  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
32:3  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
33:3  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions

/Users/build/jenkins/workspace/sdk_titanium_mobile_PR-9536-D2LTM57TF7WWOTYNXXE4VBVVT7CIP4VMS4GGP2CSJIA73OQM5AVQ/tests/Resources/ti.ui.picker.addontest.js
11:5  warning  'should' is assigned a value but never used  no-unused-vars

✖ 4 problems (0 errors, 4 warnings)


Running "checkFormat:ios" (checkFormat) task

Running "checkFormat:android" (checkFormat) task
Fatal error: Error: Formatting incorrect on "android/modules/ui/src/java/ti/modules/titanium/ui/ShortcutItemProxy.java", proposed changes: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='940' length='0'> </replacement>
<replacement offset='941' length='0'> </replacement>
<replacement offset='1961' length='6'>&#10;&#10;		</replacement>
<replacement offset='2671' length='0'> </replacement>
<replacement offset='4211' length='4'> </replacement>
</replacements>

Error: Formatting incorrect on "android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java", proposed changes: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='38108' length='1'>&#10;			</replacement>
</replacements>

Error: Formatting incorrect on "android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java", proposed changes: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='2058' length='8'>&#10;&#10;			</replacement>
</replacements>
�
npm ERR! Test failed.  See above for more details.

Generated by 🚫 dangerJS

Copy link
Contributor

@ypbnv ypbnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@sgtcoolguy sgtcoolguy modified the milestones: 7.0.0, 7.1.0 Nov 30, 2017
@hansemannn hansemannn modified the milestones: 7.1.0, 7.2.0 Feb 26, 2018
@sgtcoolguy sgtcoolguy modified the milestones: 7.2.0, 7.3.0 May 16, 2018
@sgtcoolguy sgtcoolguy modified the milestones: 7.3.0, 7.4.0 May 23, 2018
@hansemannn hansemannn modified the milestones: 7.4.0, 7.5.0 Aug 24, 2018
@garymathews garymathews force-pushed the TIMOB-24765 branch 2 times, most recently from 6bff032 to 8c43088 Compare October 2, 2018 21:12
@build
Copy link
Contributor

build commented Oct 12, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@ssjsamir
Copy link
Contributor

@garymathews Please could you take a look at the merge conflicts?

@garymathews garymathews force-pushed the TIMOB-24765 branch 2 times, most recently from 1d6682e to f6b6bc5 Compare October 17, 2018 17:23
[TIMOB-25048] Implement shortcutitemclick event

[TIMOB-25048] Rename to Ti.UI.ShortcutItem

[TIMOB-25048] Add documentation

[TIMOB-24765] Implement shortcut pinning for Android

[TIMOB-24765] Fix formatting
@lokeshchdhry
Copy link
Contributor

FR Passed.

Shortcut pinning works as expected.

Studio Ver: 5.1.2.201810080801
SDK Ver: 7.5.0 local build
OS Ver: 10.14
Xcode Ver: Xcode 10.0
Appc NPM: 4.2.14-2
Appc CLI: 7.0.6
Daemon Ver: 1.1.3
Ti CLI Ver: 5.1.1
Alloy Ver: 1.13.2
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 10.0.2
Devices: ⇨ google Pixel (Android 9.0)
⇨ google Nexus 6P (Android 8.1.0)

@lokeshchdhry lokeshchdhry merged commit 2474699 into tidev:master Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants