Skip to content

Instantly share code, notes, and snippets.

@GaborWnuk
Created August 1, 2018 11:11
Show Gist options
  • Save GaborWnuk/e74095bca909a97bf6e1eae6bd347058 to your computer and use it in GitHub Desktop.
Save GaborWnuk/e74095bca909a97bf6e1eae6bd347058 to your computer and use it in GitHub Desktop.
FancyViewManager.kt for React Native project based on Kotlin
package pl.wp.wdi
import android.graphics.Color;
import android.view.View
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
class FancyViewManager: SimpleViewManager<View>() {
override fun getName(): String {
return "FancyViewManager"
}
override fun createViewInstance(reactContext: ThemedReactContext?): View {
var view = View(reactContext);
view.setBackgroundColor(Color.MAGENTA);
return view
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment