Skip to content

Commit

Permalink
use kotlin file in java
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzhang committed Feb 9, 2018
1 parent b873f88 commit 3e0c5a0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.3-2'
ext.kotlin_version = '1.2.21'
repositories {
jcenter()
maven { url "https://jitpack.io" }
Expand Down
5 changes: 5 additions & 0 deletions readercomponent/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.dd.comgradle'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 26
Expand Down Expand Up @@ -43,9 +44,13 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}

combuild {
applicationName = 'com.luojilab.reader.runalone.application.ReaderApplication'
isRegisterCompoAuto = false
}
repositories {
mavenCentral()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.luojilab.component.componentlib.router.Router;
import com.luojilab.component.componentlib.router.ui.UIRouter;
import com.luojilab.componentservice.readerbook.ReadBookService;
import com.luojilab.reader.serviceimpl.ReadBookServiceImpl;
import com.luojilab.reader.serviceimpl.ReadBookServiceImplKotlin;

/**
* Created by mrzhang on 2017/6/15.
Expand All @@ -18,7 +18,8 @@ public class ReaderAppLike implements IApplicationLike {
@Override
public void onCreate() {
uiRouter.registerUI("reader");
router.addService(ReadBookService.class.getSimpleName(), new ReadBookServiceImpl());
// router.addService(ReadBookService.class.getSimpleName(), new ReadBookServiceImpl());
router.addService(ReadBookService.class.getSimpleName(), new ReadBookServiceImplKotlin());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.luojilab.reader.serviceimpl

import android.support.v4.app.Fragment
import com.luojilab.componentservice.readerbook.ReadBookService
import com.luojilab.reader.ReaderFragment

/**
* Created by mrzhang on 2018/2/9.
*/
class ReadBookServiceImplKotlin : ReadBookService {
override fun getReadBookFragment(): Fragment {
return ReaderFragment()
}
}

0 comments on commit 3e0c5a0

Please sign in to comment.