Skip to content

Commit

Permalink
refactory and create new features
Browse files Browse the repository at this point in the history
  • Loading branch information
nadsonfernando committed Oct 6, 2017
1 parent 871e4c3 commit 5679de4
Show file tree
Hide file tree
Showing 11 changed files with 457 additions and 335 deletions.
Binary file added assets/fonts/FontAwesome.ttf
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
62 changes: 62 additions & 0 deletions controllers/_animation.js
@@ -0,0 +1,62 @@
var __animation_to = {};

exports.animate = animate;
exports.getPropertiesConfig = getPropertiesConfig;

function animate(element, propertiesTo, callComplete) {
var _a = Ti.UI.createAnimation(propertiesTo);
element.animate(_a);
callComplete && _a.addEventListener('complete', callComplete);
}
function getPropertiesConfig() {
return __animation_to;
}

__animation_to = {
up : {
footer : {
height : 2,
leftToRight: {
right: 0,
height: 2
},
leftToRightToRightOut: {
right: 0,
height: 2
},
expand: {
width: '100%',
height: 2
}
},
hint : {
top : 0
}
},
down : {
footer : {
height : 1,
leftToRight: {
right: '100%',
height: 2
},
leftToRightToRightOut: {
right: '-100%',
height: 2
},
expand: {
width: 0,
height: 2
}
}
},
minMaxSizeTo : {
right : -64,
duration : 350
},
minSizeMaxBack : {
right : 0,
duration : 350
}
};

6 changes: 6 additions & 0 deletions controllers/_eventsInteraction.js
@@ -0,0 +1,6 @@
exports.listener = listener;

function listener(element, nameEvent, callback) {
element.addEventListener(nameEvent, callback);
}

87 changes: 87 additions & 0 deletions controllers/_properties.js
@@ -0,0 +1,87 @@
var _properties = {};

exports.apply = apply;
exports.get = get;
exports.set = set;

function configutarionProperties(list, properties) {
for (var key in list) {
var element = get(list[key], properties);
if (_.isNull(element) || _.isUndefined(element))
continue;

set(list[key], element, true);
}
}
function apply(properties) {
properties = properties || {};

var list__verif = [
'titleHint',
'width',
'top',
'bottom',
'keyboardType',
'returnKey',
'password',
'editable',
'maxLength',
'minLength',
'toUpperCase',
'mask',
'required',
'colorFocus',
'colorDefault',
'colorExceeding',
'colorFont',
'colorExceeding',
'animationDuration',
'left',
'right',
'titleHintVisible'];

configutarionProperties(list__verif, properties);
}
function get(attr, _obj) {
var _objFind = _properties;

if (!_.isNull(_obj) && !_.isUndefined(_obj))
_objFind = _obj;

if (_.isNull(attr) || _.isUndefined(attr))
return _objFind;

return new Function('o', 'return o.'+ attr)(_objFind);
};
function set(path, value, isSetGrafhicFunction) {
if (isSetGrafhicFunction) {
new Function('o', 'o.'+ path + ' = ' + "'"+ value +"'")(_properties);
return;
}
_properties[path] = value;
}

_properties = {
animationDuration : 200,
position : {
left : '15dp',
right : '15dp'
},
color : {
default : '#AAA',
focus : '#208FE5',
exceeding : '#FF0000',
},
control : {
isEditable : true,
isExceeding : false,
isUp : false
},
EVENTS : {
CLICK : 'click',
FOCUS : 'focus',
BLUR : 'blur',
CHANGE : 'change'
}
};

0 comments on commit 5679de4

Please sign in to comment.