package com.sometrik.framework;

import com.sometrik.formtest.R;

import android.content.Context;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;

public class FWButton extends Button implements NativeCommandHandler {

  FrameWork frame;
  
  public FWButton(FrameWork frameWork) {
    super(frameWork);
    this.frame = frameWork;
    
  }


  @Override
  public void addChild(View view) {
    System.out.println("FWButton couldn't handle command");
  }
  
  @Override
  public void removeChild(int id) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void addOption(int optionId, String text) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void setValue(String v) {
    setText(v);
    //FIXME Debug animation
    Animation shake = AnimationUtils.loadAnimation(frame, R.anim.shake);
    startAnimation(shake);
  }
  
  @Override
  public void setValue(int v) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public int getElementId() {
    return getId();
  }

  @Override
  public void setEnabled(Boolean enabled) {
    System.out.println("FWButton couldn't handle command");
  }

}

@@ -204,16 +204,63 @@
 nUtils;%0A
+import android.view.animation.RotateAnimation;%0A
 import a
@@ -931,16 +931,22 @@
 ion%0A    
+Rotate
 Animatio
@@ -951,64 +951,142 @@
 ion 
-shake = AnimationUtils.loadAnimation(frame, R.anim.shake
+r = new RotateAnimation(-5f, 5f,50,50); %0A    r.setDuration(100);%0A    r.setRepeatCount(10);%0A    r.setRepeatMode(RotateAnimation.REVERSE
 );%0A 
@@ -1107,13 +1107,9 @@
 ion(
-shake
+r
 );%0A 

Change debug animation to programmatic