Skip to content

Instantly share code, notes, and snippets.

View gauntface's full-sized avatar
🤓
Mon-Fri: Working. Sat-Sun: Not Working.

Matt Gaunt-Seo gauntface

🤓
Mon-Fri: Working. Sat-Sun: Not Working.
View GitHub Profile
@gauntface
gauntface / Old Android Theme - Pre Holo
Created November 14, 2012 16:11
Old Android Theme - Pre Holo
android:theme="@android:style/Theme.NoTitleBar"
@gauntface
gauntface / New Android Theme - With Holo
Created November 14, 2012 16:12
New Android Theme - With Holo :)
android:theme="@android:style/Theme.Holo.NoActionBar"
@gauntface
gauntface / make-anymote-jar
Created November 14, 2012 16:45
Commands to Make Anymote Jar
./configure
make
make check
sudo make install
@gauntface
gauntface / Maven Package
Created November 14, 2012 16:46
Maven Package
mvn package
@gauntface
gauntface / Maven Package List
Created November 14, 2012 16:47
Maven Package Lite
mvn package -P lite
@gauntface
gauntface / css-zoom-vs-scaling.js
Created December 4, 2012 13:26
Scaling vs Zooming
var scaleElementWidth = $('body').width();
var scaleElementHeight = $('body').height();
var windowWidth = $(window).width();
var windowHeight = $(window).height();
var wRatio = windowWidth/scaleElementWidth;
var hRatio = windowHeight/scaleElementHeight;
var ratio = Math.min(wRatio, hRatio);
@gauntface
gauntface / focusController.js
Created December 27, 2012 15:38
FocusController constructor - Source which handles
/**
* This controller will take care of determining where the focus moves when
* a key press or mouse movement has occurred
*
* @constructor
*/
function FocusController() {
...
@gauntface
gauntface / focusController.js
Created December 27, 2012 15:58
focusController.js - Key Handling
/**
* On a key press this method will handle moving the focus
* @function
* @param {int} event Browser key code
*/
FocusController.prototype.onKeyDown = function (event) {
switch(event.keyCode) {
case 9:
// Tab
break;
@gauntface
gauntface / focusController.js
Created December 27, 2012 16:18
focusController.js - Move focus
/**
* This will take a direction vector and move the focus to the most
* appropriate item or make no change if there are no items to move to
* @param {array} direction A direction vector [x, y]
*/
this.moveFocus = function (direction) {
// We need an item to move down from
// TODO: Should initialise focus if not initialised
if(!currentlyFocusedItem) {
return;
@gauntface
gauntface / focusController.js
Created December 27, 2012 17:01
Focus Controller - Change focus to a new item.
/**
* This method performs a change of focus to the item index
* @param {int} itemIndex
*/
this.handleFocusChangeToItem = function (itemIndex) {
if(currentlyFocusedItem) {
currentlyFocusedItem.setFocusState(false);
}
var focusableItem = this.getFocusableItem(itemIndex);