Skip to content

Instantly share code, notes, and snippets.

View nuno's full-sized avatar

Nuno Costa nuno

View GitHub Profile
@nuno
nuno / index.js
Created April 19, 2016 12:10 — forked from grantges/index.js
Cleaning Up Subviews in Appcelerator Titanium
$.index.open();
var subViews = [];
function _doSomething(){
alert('Something!');
}
@nuno
nuno / README.md
Last active May 31, 2020 06:21 — forked from grantges/README.md
Titanium TSS for Transparent NavigationBar / Shadow on iOS

Creating a transparent NavigationBar using Titanium Style Sheets

Appcelerator Titanium offers many ways to style the navigation bar for iOS apps, from changing out the title view all together, or just using simple colors. However, one of the most frequent requests I hear is how to make a truly transparent NavigationBar. This tutorial will cover that.

Getting started

Lets start with a pretty simple window style in the app.tss. This will ensure that the window style is applied globally.

Note: This can be used in a specific controller *.tss file if you only want this effect on a particular window.

import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.Scroller;
/**
* @author androidseb
@nuno
nuno / Readme.md
Created April 5, 2016 15:56 — forked from grantges/Readme.md
Shapes With Appcelerator Titanium and Hyperloop

Custom Alloy Tags based on Appcelerator Hyperloop modules

With Alloy and Hyperloop, you can quickly and easily expose native UI as Custom Alloy tags by leveraging the namespace (ns) attribute and commonjs modules.

Alloy allows you to create your own UI element that can be included into the XML View heirarchy in one of two ways, an Alloy Widget or through the use of Custom Tags.

To create your own custom tag, you link the tag to the commonjs module with the namespace attribute (ns). Here is an example using a custom tag to render a standard Titanium View:

@nuno
nuno / resetAllSimulators.sh
Created March 29, 2016 16:25 — forked from ZevEisenberg/resetAllSimulators.sh
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@nuno
nuno / app.js
Created February 22, 2016 21:46 — forked from someguycrafting/app.js
Titanium ListView (CommonJS) with reponsive orientation changes layout
var countryData = [];
var countrySection;
var countryList;
var maxFetchRows = 20;
var currentListMarker = 0;
var testWin = Titanium.UI.createWindow({
top:20,
var args = arguments[0] || {};var url = "https://api.github.com/search/repositories?q=pushed:>2015-09-01&order=desc";
var page = 1,
loading = false;
function init() {
$.activityIndicator.show();
load(function(items) {
$.list.setItems(transform(items));
$.activityIndicator.hide();
@nuno
nuno / index.js
Created January 14, 2016 15:12 — forked from afranioce/index.js
Appcelerator swipe card like tinder
var win = Titanium.UI.createWindow({
backgroundColor: "#ffffff",
title: "win"
});
// animations
var animateLeft = Ti.UI.createAnimation({
left: -520,
transform: Ti.UI.create2DMatrix({rotate: 60}),
opacity: 0,
@nuno
nuno / index.js
Created January 10, 2016 18:07 — forked from grantges/index.js
Chaining using Appcelerator Titanium / Alloy (Thanks Jason Kneen!)
Alloy.createController(“login”).on(“submit”, function(e) {
doStuffWith(e)
}).getView().open();
@nuno
nuno / app.js
Created January 10, 2016 15:44 — forked from iskugor/app.js
Remove all child elements in Titanium
function removeAllChildren(viewObject){
//copy array of child object references because view's "children" property is live collection of child object references
var children = viewObject.children.slice(0);
for (var i = 0; i < children.length; ++i) {
viewObject.remove(children[i]);
}
}