Sunday, March 10, 2019

Segment row slide animation in kony

//call this function in preshow()
function initCB(){
  flxTemp.setGestureRecognizer(2, {fingers: 1},animateRow);
}


function animateRow(widgetRef, gestureInfo, context){
  try{
   
   
    var animationObject = kony.ui.createAnimation(
    {"0":{"left":"0%","stepConfig":{"timingFunction":kony.anim.LINEAR}},
    "100":{"left":"-30%","stepConfig":{"timingFunction":kony.anim.LINEAR}}});
   
    var animationConfig = {
    duration: 0.2,
    fillMode: kony.anim.FILL_MODE_FORWARDS
    };
   
    var animationCallbacks = {"animationEnd":function(){
    }};
   
    var animationDefObject={definition:animationObject,config:animationConfig,callbacks:animationCallbacks};
   
     var row1 = {
    sectionIndex: context.sectionIndex,
    rowIndex: context.rowIndex
};
   
   
  var rowList = [row1];
  frmHome.segMain.animateRows({rows: rowList,widgets: ["flxFirst"],animation: animationDefObject });
   
  }catch(err){
alert("Error "+err);
  }
 
}