Skip to content

Instantly share code, notes, and snippets.

View nuno's full-sized avatar

Nuno Costa nuno

View GitHub Profile
@nuno
nuno / README.md
Last active August 29, 2015 14:23 — forked from manumaticx/README.md
Fading ActionBar in Titanium

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

License

The MIT License (MIT)
@nuno
nuno / InfiniteScrollableView.js
Last active August 29, 2015 14:22 — forked from dawsontoth/InfiniteScrollableView.js
Infinite scrollable list.
/**
* We're going to create an infinite scrollable list. In this case, we're going to show a date. When you swipe left,
* you'll see yesterday. Then the day before yesterday, and so on. Swiping right shows you tomorrow, and so on.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var isAndroid = Ti.Platform.osname === 'android';
/**
* Track where we are in the infinite scrollable views, and define how large of a step goes between each view.
*/
var currentDate = new Date(), msIntervalBetweenViews = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/;
@nuno
nuno / alloy.js
Last active August 29, 2015 14:22 — forked from rblalock/alloy.js
Alloy override for analytics
Alloy.createWidget = function(id, name, args) {
Ti.Analytics.featureEvent("widget." + id, args);
return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);
};
Alloy.createController = function(name, args) {
Ti.Analytics.featureEvent("controller." + name, args);
return new (require("alloy/controllers/" + name))(args);
};
@nuno
nuno / index.xml
Last active August 29, 2015 14:21 — forked from jasonkneen/index.xml
Flipboard style tabgroup indicator for iOS. Drop tabIndicator.js into your Alloy lib folder, then add the module tag to your tabgroup and parameters to override the defaults. As you click on each tab, the indicator will slide across. VIDEO https://www.dropbox.com/s/cbw5e1ruksud9uo/tabindicator.mp4?dl=0
<!-- note the ONLY change to this is the additional module="tabIndicator"
attribute + properties to override indicator defaults //-->
<Alloy>
<TabGroup module="tabIndicator" tabsBackgroundColor="#000" tabIndicatorHeight="1" tabIndicatorColor="white" tabIndicatorWidth="75%">
<Tab title="Tab 1" icon="/images/icons/519-tools-1.png" activeIcon="/images/icons/519-tools-1_active.png" color="#555" activeColor="#fff">
<Window title="Tab 1" barColor="black" navTextColor = "#fff">
<Label onClick="openWin1">Tab 1</Label>
</Window>
</Tab>
<Tab title="Tab 2" icon="/images/icons/516-archive-box.png" activeIcon="/images/icons/516-archive-box_active.png" color="#555" activeColor="#fff">
@nuno
nuno / index.js
Last active August 29, 2015 14:21 — forked from mcvendrell/index.js
Titanium: How to re-use the launch image in the app (TiDev.io): Alloy style
// Animated start. Comments for code here: http://www.tidev.io/2015/01/06/how-to-re-use-the-launch-image-in-the-app
var img = Ti.UI.createImageView({
// Get the launch image
image: (function getImage() {
if (OS_IOS) {
// Working around orientation-bug
if (Ti.Platform.osname === 'ipad' || Math.max(Ti.Platform.displayCaps.platformWidth, Ti.Platform.displayCaps.platformHeight) === 736) {
return 'Default-' + (Ti.Gesture.isPortrait() ? 'Portrait' : 'Landscape') + '.png';
} else {
return 'Default.png';
@nuno
nuno / app.js
Last active August 29, 2015 14:20 — forked from mstepanov/app.js
Titanium ListView Examples
var rootWin = Ti.UI.createWindow();
var navGroup = Ti.UI.iPhone.createNavigationGroup({
window: rootWin
});
var button = Ti.UI.createButton({
title: 'Open ListView Tests'
});
button.addEventListener('click', function() {
openTestsWindow();
});
@nuno
nuno / Get Total Shares (returns JSON)
Last active September 30, 2019 23:37 — forked from teybannerman/Get Total Shares (returns JSON)
AddThis Public sharing endpoints & API URL to retrieve total share count for any given URL
http://api-public.addthis.com/url/shares.json?url=http%3A%2F%2Fwww.twitter.com
@nuno
nuno / _ReadMe.md
Last active August 29, 2015 14:18 — forked from aaronksaunders/_ReadMe.md
Alternate Implementation Appcelerator Titanium Models/Collections

Implementing Appcelerator Titanium Models/Collections for Cloud Services without all the extra files

It is a PITA working with Appecelerator Alloy Models and Collection because you need to create these template files for everything, even of you are not using them. This is a "HACK" that I came up with after a few hours that appears to address the issue.

I am certain that there might be a cleaner way, which would require deeper understand of the underpinnings of Alloy, maybe someone can make a suggestion, maybe it will come to me later.

###Notes This code is using a ACS Sync Adapter customize for cloud services with promises integration

https://github.com/aaronksaunders/Appcelerator-Cloud-Services-Sync-Adapter

@nuno
nuno / shortExample.js
Last active March 15, 2017 18:50 — forked from bender-rulez/shortExample
Twitter like image dismiss Titanium
var fadeIntro = Titanium.UI.createAnimation();
fadeIntro.opacity = 1.0;
fadeIntro.duration = 250;
var fadeOutro = Titanium.UI.createAnimation();
fadeOutro.opacity = 0.0;
fadeOutro.duration = 250;
var fadeOutSlow = Titanium.UI.createAnimation();
@nuno
nuno / gist:43f25736331ec763854e
Last active August 29, 2015 14:14
NavBar buttons
<Alloy>
<NavigationWindow id="nav" formFactor="handheld">
<Window id="win" class="container">
<LeftNavButton>
<Button systemButton="Titanium.UI.iPhone.SystemButton.EDIT" onClick="doClick"/>
</LeftNavButton>
<RightNavButton>
<Button systemButton="Titanium.UI.iPhone.SystemButton.ADD" onClick="doClick"/>