Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pavi2410
Created March 30, 2020 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavi2410/211607ae22e263ca8f3c89eb909766fb to your computer and use it in GitHub Desktop.
Save pavi2410/211607ae22e263ca8f3c89eb909766fb to your computer and use it in GitHub Desktop.
GSOC Proposal for Visible Component Extensions in App Inventor
package test;
import android.view.View;
import android.widget.TextView;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidViewComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
@DesignerComponent(version = 1,
description = "Simple Label extension",
category = ComponentCategory.EXTENSION,
iconName = "images/extension.png")
@SimpleObject(external = true)
public class SimpleLabel extends AndroidViewComponent {
private TextView tv;
public SimpleLabel(ComponentContainer container) {
super(container.$form());
tv = new TextView(container.$context());
container.$add(this);
}
@Override
public View getView() {
return tv;
}
@SimpleFunction()
public void Text(String text) {
tv.setText(text);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment