Alloy ViewPager Widget On my way to Ti.Connect the in-flight movie was boring so I thought: why not do a widget? I just read chapter 5 of the awesone book Ricardo is in the process of writing. In this chapter he uses the native Android ViewPager module for a second layer of navigation. I already did a widget […]
Supporting multiple widget controllers Update: The pull request for this feature has been accepted. If you require a widget in a XML view like this: 1 <widget src="nl.fokkezb.tweetsView" foo="bar" id="myWidget"></widget> It generates code like this: 1234 $.__views.myWidget = Alloy.createWidget("nl.fokkezb.tweetsView", "widget", { id: "myWidget", foo: "bar"}); Let’s take a look at the code for createWidget in alloy.js: 123 exports.createWidget = function(id, name, args) { return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);}; Multiple view-controllers As you can see, the second argument specifies the controller to require from […]
Child elements in Widgets Sometimes it can be refreshing to look at the implications, but also the opportunities, that come with a certain technique. By doing so I managed to convince (#ALOY-382) Tony to implement RightNavButton and similar features in Alloy in the way they are now :) Child elements in <Require> Likewise, I was looking at how we […]
“TweetsView” twitter widget for Titanium Alloy Add a Twitter timeline to you app using just a single line of code. I’m working on some Alloy widgets that enable me to quickly add basic views to mostly tabbed apps. First up is a Twitter timeline using Twitters 1.0 public search API. It’s styled pretty much like the iOS Twitter app and currently […]
“Dynamic Scrolling” Titanium Alloy widget Where would a Pull to refresh widget be without it’s companion: Dynamic Scrolling. Where the former widget allows the user to load newer content, the dynamic scrolling mechanism allows you to scroll the table down and automatically load older content. All this can be accomplished by just 4 lines of code: 1234 var scrollCtrl = Alloy.createWidget('nl.fokkezb.dynamicScrolling', null, { table: $.myTable, loader: myLoaderCallback}); Check the code […]
Updated: “Pull to refresh” Titanium Alloy widget In preparation of releasing some more widgets; working together in another widget for adding a Twitter tab to your apps, I’ve updated my “Pull to refresh” widget with new API methods to manually show, hide, update and fully trigger the widget. You can use this for example to show the headerPullView upon first load. WANTED: […]
“Pull to refresh” widget for Titanium Alloy Who can live without it? The concept of pulling down a view (mostly a table) to refresh its contents can nowadays be found in almost any app. And now, you can add it to your apps using the new MVC framework Alloy for Appcelerator Titanium in just 4 lines of code: 1234 var ptrCtrl = Alloy.createWidget('nl.fokkezb.pullToRefresh', null, { table: $.myTable, load: myLoadCallback}); Just pull the code from Github! Updated […]
Caching remote images in Titanium Alloy I’ve coded my first widget for Appcelerator Titanium’s new MVC framework Alloy. Yeah! It implements the best practice to cache remote images. My goal was to minimize the changes needed from using a plain ImageView in a view and no controller scripting. Check the before and after below and pull the code from GitHub. Before: […]