(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import android.util.SparseArray; | |
| import android.widget.AbsListView; | |
| /** | |
| * Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the | |
| * position of child views. | |
| */ | |
| public class ListViewScrollTracker { | |
| private AbsListView mListView; | |
| private SparseArray<Integer> mPositions; |
| # This hosts file is brought to you by Dan Pollock and can be found at | |
| # http://someonewhocares.org/hosts/ | |
| # You are free to copy and distribute this file for non-commercial uses, | |
| # as long the original URL and attribution is included. | |
| #<localhost> | |
| 127.0.0.1 localhost | |
| 127.0.0.1 localhost.localdomain | |
| 255.255.255.255 broadcasthost | |
| ::1 localhost |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| if (OS_ANDROID) { | |
| // Somehow, only in alloy.js we can get the data (URL) that opened the app | |
| Alloy.Globals.url = Ti.Android.currentActivity.intent.data; | |
| Ti.API.info('launch data: '+Ti.Android.currentActivity.intent.data); | |
| Ti.Android.currentActivity.addEventListener('newintent',function(e){ | |
| Ti.API.info('newintent ' + JSON.stringify(e.intent.data)); | |
| }); | |
| Ti.Android.currentActivity.onCreate = function(e){ |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParentNote: < i=OS 5.1 use
prefs:. > 5.1 useapp-settings:
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.
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
*.tssfile if you only want this effect on a particular window.
| /** | |
| * @fileoverview Generated externs. DO NOT EDIT! | |
| * @externs | |
| */ | |
| /** | |
| * An extension of the [NSURLConnectionDelegate](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) protocol to allow users to participate in authentication and resource management for this HTTPClient. | |
| * @typedef {{ | |
| * }} | |
| */ |