package com.sometrik.framework;

import android.content.Context;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;

public class FWRadioGroup extends RadioGroup implements NativeCommandHandler {
  
  private Context context;
  
  public FWRadioGroup(Context context){
    super(context);
    this.context = context;
  }

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

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

  @Override
  public void showView() {
    System.out.println("FWRadioGroup couldn't handle command");
  }

  @Override
  public void addOption(int optionId, String text) {
    RadioButton button = new RadioButton(context);
    button.setId(optionId);
    button.setText(text);
    addView(button);
  }

  @Override
  public void setValue(String v) {
    System.out.println("FWRadioGroup couldn't handle command");
  }

  @Override
  public void setValue(int v) {
    System.out.println("FWRadioGroup couldn't handle command");
  }

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

}

@@ -84,16 +84,54 @@
 w.View;%0A
+import android.widget.CompoundButton;%0A
 import a
@@ -149,32 +149,32 @@
 et.RadioButton;%0A
-
 import android.w
@@ -301,16 +301,43 @@
 ontext;%0A
+  private FrameWork frame;%0A
   %0A  pub
@@ -387,24 +387,24 @@
 r(context);%0A
-
     this.con
@@ -419,16 +419,299 @@
 ontext;%0A
+    frame = (FrameWork)context;%0A%0A    setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()%7B%0A      @Override%0A      public void onCheckedChanged(RadioGroup group, int checkedId) %7B%0A%09frame.intChangedEvent(System.currentTimeMillis() / 1000.0, checkedId, 1);%0A      %7D%0A    %7D);%0A
   %7D%0A%0A  @

Add listener to FWRadioGroup