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
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KClass | |
import kotlin.reflect.KProperty | |
/* | |
* Using the Injection framework: | |
* | |
* Create bindings somewhere in the application before the injections would occur. | |
* | |
* factory<MyInterface>(named = "specialName") { SomeImplementation() } |
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 delegation | |
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KProperty | |
class Foo: Injectable by ScopeWrapper() { | |
val bar: Bar by inject() | |
} |
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
class Village(val name: String, val huts: MutableList<Hut>) | |
class Hut(val address: String, | |
val vikings: MutableList<Viking>, | |
val dragons: MutableList<Dragon>) | |
class Viking(val name: String) | |
class Dragon(val name: String) |
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
data class AddresBook(val contactGroups: List<ContactGroup>, val contacts: List<Contact>) | |
data class Contact(val name: String, val phones: List<String>) | |
data class ContactGroup(val name: String, val contacts: List<Contact>) | |
fun addressBook(lambda: AddressBookBuilder.()->Unit) = AddressBookBuilder().apply(lambda).build() | |
@DslMarker | |
annotation class AdressBookDslMarker |
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
import java.lang.reflect.Proxy; | |
import java.util.Arrays; | |
public class ProxyExample { | |
public static void main(String[] args) { | |
// Setup... this is where the magic happens... | |
ApiInterface service = (ApiInterface) Proxy.newProxyInstance( | |
ApiInterface.class.getClassLoader(), | |
new Class[]{ ApiInterface.class }, |
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
... | |
intellij { | |
version '2017.1' | |
pluginName 'YOUR PLUGIN NAME HERE' | |
plugins 'android' | |
updateSinceUntilBuild false | |
alternativeIdePath "/Applications/Android Studio 3.0 Preview.app/Contents/" | |
} |
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 com.example.plugin; | |
import com.intellij.openapi.components.ProjectComponent; | |
import org.jetbrains.annotations.NotNull; | |
public class TestProjectComponent implements ProjectComponent { | |
private static final String TEST_PROJECT_COMPONENT_NAME = "TestProjectComponent"; | |
@Override |
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
<idea-plugin> | |
<id>com.example.plugin</id> | |
<name>ExamplePlugin</name> | |
<vendor email="[email protected]" url="http://www.example.com">Example</vendor> | |
<description><![CDATA[ | |
Some description of the plugin, what it does, so people can have a better idea if they want to use it | |
]]></description> | |
<change-notes><![CDATA[ |
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
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
url "https://plugins.gradle.org/m2/" | |
} | |
maven { | |
url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' | |
} | |
} |
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
public class Activity1$$IntentBuilder<NEXT> { | |
protected Map<String, String> params = new HashMap<>(); | |
public Activity1FirstParam createActivity1() { | |
return new Activity1FirstParam(); | |
} | |
protected class Activity1FirstParam { | |
public AfterExtra1 extra1(String extra1) { |
NewerOlder