Created
March 30, 2020 15:17
-
-
Save pavi2410/211607ae22e263ca8f3c89eb909766fb to your computer and use it in GitHub Desktop.
GSOC Proposal for Visible Component Extensions in App Inventor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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