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.babedev.javapoetcodelab.sample; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| import java.lang.Override; | |
| class SampleActivity extends Activity implements SampleView { | |
| private SamplePresenter mPresenter; |
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
| public static void main(String[] args) throws IOException { | |
| MvpPoet poet = new MvpPoet("com.babedev.javapoetcodelab", "Sample"); | |
| poet.generateMvp(); | |
| } |
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
| fun ImageView.show(imageUrl: String = "") { | |
| if (context == null) return | |
| if (context is Activity && ((context as Activity).isFinishing || (context as Activity).isDestroyed)) return | |
| Glide.with(context) | |
| .load(imageUrl) | |
| .crossFade() | |
| .signature(StringSignature(UUID.randomUUID().toString())) | |
| .into(this) |
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
| pragma solidity ^0.4.7; | |
| contract Report { | |
| struct report { | |
| uint id; | |
| string detail; | |
| } | |
| mapping(uint => report) public reports; |
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
| fun ImageView.show(imageUrl: String = "") { | |
| if (imageUrl.isBlank()) return | |
| if (context == null) return | |
| if (context is Activity && ((context as Activity).isFinishing || (context as Activity).isDestroyed)) return | |
| Glide.with(context) | |
| .load(imageUrl) | |
| .crossFade() |
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
| private fun generateActivity() { | |
| val onCreate = FunSpec.builder("onCreate") | |
| .addModifiers(KModifier.OVERRIDE, KModifier.PUBLIC) | |
| .addParameter("savedInstanceState", Bundle::class) | |
| .addStatement("super.onCreate(savedInstanceState)") | |
| .addComment("TODO setContentView()") | |
| .addStatement("mPresenter = %T()", presenterType) | |
| .addStatement("mPresenter.attachView(this)") | |
| .build() |
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.babedev.playground | |
| fun greet() = "Hello" | |
| @JsName("sayHello") | |
| fun greet(text: String) { | |
| console.log(text) | |
| } |
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
| var Hello = require('./dist/hello.js') | |
| console.log(Hello.com.babedev.playground.greet()) | |
| Hello.com.babedev.playground.sayHello("Hello Kotlin") |
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
| group 'com.babedev' | |
| version '1.0-SNAPSHOT' | |
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| maven { | |
| url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" | |
| } | |
| } |
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
| fun main(args: Array<String>) { | |
| print("Hello Native") | |
| } |