// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Released under the MIT License https://raw.github.com/mit-cml/app-inventor/master/mitlicense.txt

package com.google.appinventor.components.runtime;

import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.common.YaVersion;
import com.google.appinventor.components.runtime.errors.YailRuntimeError;
import com.google.appinventor.components.runtime.util.TextViewUtil;


import android.view.View;
import android.widget.TextView;


@DesignerComponent(version = YaVersion.%s,
    description = "A new component ",
    category = ComponentCategory.%s,
    nonVisible = false,
    iconName = "images/%s.png")
@SimpleObject
public final class %s extends AndroidViewComponent {

  // change to reflect the view of the component
  private final TextView view;

  /**
   * Creates a new component.
   *
   * @param container  container, component will be placed in
   */
  public %s(ComponentContainer container) {
    super(container);
    view = new TextView(container.$context());

    // Adds the component to its designated container
    container.$add(this);

    // Default property values
    TextViewUtil.setText(view, "your new %s");
  }

  @Override
  public View getView() {
    return view;
  }

}
