Skip to content

Instantly share code, notes, and snippets.

View Foso's full-sized avatar
👨‍💻
Break stuff, fix stuff

Jens Klingenberg Foso

👨‍💻
Break stuff, fix stuff
View GitHub Profile
@Foso
Foso / mdi-react
Created November 5, 2018 21:29
mdi-react
package mdireact
import react.RClass
@JsModule("mdi-react")
external val IconImport: dynamic
var DownloadIcon: RClass<dynamic> = IconImport.DownloadIcon
var DeleteIcon: RClass<dynamic> = IconImport.DeleteIcon
var PlayArrowIcon: RClass<dynamic> = IconImport.PlayArrowIcon
@Foso
Foso / react-burger-menu
Created November 5, 2018 21:18
react-burger-menu
import react.RClass
import react.RProps
@JsModule("react-burger-menu/lib/BurgerMenu")
external val slideImport: dynamic
var slide: RClass<slideProps> = slideImport.slide
external interface State {
@Foso
Foso / Dropzone.kt
Created October 29, 2018 17:53
Import of react-dropzone for Kotlin React
import org.w3c.dom.events.Event
import react.RClass
import react.RProps
@JsModule("react-dropzone")
@JsName("default")
external val dropzoneImport: dynamic
var dropzone: RClass<DRopProps> = dropzoneImport.default
@Foso
Foso / Manifest.xml
Last active June 15, 2018 19:31
jkmanagespaceactivity
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.jensklingenberg.jkmanagespaceactivity">
<application
...
android:manageSpaceActivity=".ManageActivity"
...
</application>
@Component(modules = [(AppModule::class), (RemoteModule::class)])
@Singleton
interface AppComponent {
fun inject(mainActivity: MainActivity)
}
@Component(modules = [(AppModule::class), (RemoteModule::class)])
@Singleton
interface AppComponent {
}
@Module
class AppModule(private val application: Application) {
@Provides
@Singleton
fun provideContext(): Application = application
}
interface TestApi {
@GET("posts")
fun getPostList(): Single<Response<List<Post>>>
}
data class Post(
val id: Int? = null,
val title: String? = null,
val body: String? = null,
val userId: Int? = null
)
@Module
class RemoteModule {
@Provides
@Singleton
fun provideTestApi(retrofit: Retrofit) =
retrofit.create(TestApi::class.java)
@Provides
@Singleton
fun provideRetrofit(): Retrofit = Retrofit.Builder()
class App:Application(){
companion object {
lateinit var instance: App
lateinit var appComponent: AppComponent
}
fun initializeDagger() {
appComponent = DaggerAppComponent.builder()
.appModule(AppModule(this))
.remoteModule(RemoteModule())
.build()