package com.sometrik.framework;

import android.app.Dialog;
import android.view.View;
import android.view.ViewGroup;

public class FWDialog extends Dialog implements NativeCommandHandler{

  FrameWork frame;
  ViewGroup baseView;
  int id;
  
  public FWDialog(FrameWork frame, int id) {
    super(frame);
    this.frame = frame;
    this.id = id;
  }

  @Override
  public void onScreenOrientationChange(boolean isLandscape) {
  }

  @Override
  public void addChild(View view) {
    if (baseView == null){
      baseView = (ViewGroup) view;
      setContentView(view);
    } else {
      baseView.addView(view);
    }
  }

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

  @Override
  public void addData(String text, int row, int column, int sheet) {
    System.out.println("FWDialog couldn't handle the command");
  }

  @Override
  public void setValue(String v) {
    setTitle(v);
  }

  @Override
  public void setValue(int v) {
    if (v > 0){
      show();
    } else {
      dismiss();
    }
  }

  @Override
  public void setViewEnabled(Boolean enabled) {
    if (enabled){
      show();
    } else {
      dismiss();
    }
  }

  @Override
  public void setViewVisibility(boolean visible) {
    if (visible){
      show();
    } else {
      dismiss();
    }
  }

  @Override
  public void setStyle(String key, String value) {
    System.out.println("FWDialog couldn't handle the command");
  }

  @Override
  public void setError(boolean hasError, String errorText) {
    System.out.println("FWDialog couldn't handle the command");
  }

  @Override
  public void clear() {
    dismiss();
  }

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

}

@@ -109,16 +109,50 @@
 ewGroup;
+%0Aimport android.widget.ScrollView;
 %0A%0Apublic
@@ -257,16 +257,41 @@
 seView;%0A
+  ScrollView scrollView;%0A
   int id
@@ -396,24 +396,96 @@
 is.id = id;%0A
+    scrollView = new ScrollView(frame);%0A    setContentView(scrollView);%0A
   %7D%0A%0A  @Over
@@ -678,23 +678,31 @@
    s
-etContentView(v
+crollView.addView(baseV
 iew)

Add scrolling by default to FWDialog