@Override
 public void setChildHeight(AndroidViewComponent component, int height) {
   if (orientation == ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL) {
     ViewUtil.setChildHeightForHorizontalLayout(component.getView(), height);
   } else {
     ViewUtil.setChildHeightForVerticalLayout(component.getView(), height);
   }
 }
Пример #2
0
 @Override
 public void remove(AndroidViewComponent component) {
   if (resourceId != -1) {
     ((android.widget.ScrollView) ((Form) context).findViewById(resourceId))
         .removeView(component.getView());
   } else {
     layoutManager.removeView(component.getView());
   }
 }
Пример #3
0
 public void add(AndroidViewComponent component) {
   if (resourceId != -1) {
     ((android.widget.ScrollView) ((Form) context).findViewById(resourceId))
         .addView(
             component.getView(),
             new android.widget.LinearLayout.LayoutParams(
                 ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, 0f));
   } else {
     layoutManager.addView(
         component.getView(),
         new android.widget.LinearLayout.LayoutParams(
             ViewGroup.LayoutParams.WRAP_CONTENT, // width
             ViewGroup.LayoutParams.WRAP_CONTENT, // height
             0f)); // weight
   }
 }
Пример #4
0
 @Override
 @SimpleProperty()
 public void Height(int height) {
   if (height == LENGTH_PREFERRED) {
     height = LENGTH_FILL_PARENT;
   }
   super.Height(height);
 }
Пример #5
0
 // Components don't normally override Width and Height, but we do it here so that
 // the automatic width and height will be fill parent.
 @Override
 @SimpleProperty()
 public void Width(int width) {
   if (width == LENGTH_PREFERRED) {
     width = LENGTH_FILL_PARENT;
   }
   super.Width(width);
 }
Пример #6
0
  /**
   * Specifies the component's vertical height, measured in pixels.
   *
   * @param height in pixels
   */
  @Override
  @SimpleProperty(userVisible = true)
  public void Height(int height) {
    super.Height(height);

    // Forces a layout of the ResizableVideoView
    videoView.changeVideoSize(videoView.forcedWidth, height);
  }
Пример #7
0
  /**
   * Specifies the component's horizontal width, measured in pixels.
   *
   * @param width in pixels
   */
  @Override
  @SimpleProperty(userVisible = true)
  public void Width(int width) {
    super.Width(width);

    // Forces a layout of the ResizableVideoView
    videoView.changeVideoSize(width, videoView.forcedHeight);
  }
 /**
  * Sets the width of the listView on the screen
  *
  * @param width for width length
  */
 @Override
 @SimpleProperty(
     description = "Determines the width of the list on the view.",
     category = PropertyCategory.APPEARANCE)
 public void Width(int width) {
   if (width == LENGTH_PREFERRED) {
     width = LENGTH_FILL_PARENT;
   }
   super.Width(width);
 }
 /**
  * Sets the height of the listView on the screen
  *
  * @param height for height length
  */
 @Override
 @SimpleProperty(
     description = "Determines the height of the list on the view.",
     category = PropertyCategory.APPEARANCE)
 public void Height(int height) {
   if (height == LENGTH_PREFERRED) {
     height = LENGTH_FILL_PARENT;
   }
   super.Height(height);
 }
 @Override
 public void setChildHeight(AndroidViewComponent component, int height) {
   // A form is a vertical layout.
   ViewUtil.setChildHeightForVerticalLayout(component.getView(), height);
 }
 @Override
 public void setChildWidth(AndroidViewComponent component, int width) {
   // A form is a vertical layout.
   ViewUtil.setChildWidthForVerticalLayout(component.getView(), width);
 }