Last active
November 8, 2018 18:17
-
-
Save GantMan/a6cdd68794f05d73e4c4b30d7b76c6b6 to your computer and use it in GitHub Desktop.
Simple Welcome component in Java
This file contains hidden or 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 com.diveintonative; | |
import android.widget.TextView; | |
import com.facebook.react.uimanager.SimpleViewManager; | |
import com.facebook.react.uimanager.ThemedReactContext; | |
import com.facebook.react.uimanager.annotations.ReactProp; | |
public class RNTWelcomeViewManager extends SimpleViewManager<TextView> { | |
public static final String REACT_CLASS = "RNTWelcomeView"; | |
@Override | |
public String getName() { | |
return REACT_CLASS; | |
} | |
@Override | |
protected TextView createViewInstance(ThemedReactContext reactContext) { | |
TextView myTextView = new TextView(reactContext); | |
myTextView.setText("WELCOME!"); | |
return myTextView; | |
} | |
@ReactProp(name = "text") | |
public void setText(TextView view, String myText) { | |
view.setText("WELCOME " + myText.toUpperCase() + "!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment