Skip to content

Commit

Permalink
Move to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Nov 27, 2016
1 parent 7ccb190 commit 8a40ce2
Show file tree
Hide file tree
Showing 221 changed files with 6,597 additions and 8,606 deletions.
40 changes: 24 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
android {
compileSdkVersion 25
buildToolsVersion "25"
buildToolsVersion "25.0.1"
dexOptions {
javaMaxHeapSize "2048M"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
// }
defaultConfig {
applicationId "moe.tlaster.openween"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "0.89757.3"
jackOptions {
enabled true
}
// jackOptions {
// enabled true
// }
resValue "string", "tray__authority", "${applicationId}.tray"
manifestPlaceholders = [HOCKEYAPP_APP_ID: properties.getProperty("HOCKEYAPP_APP_ID")]

Expand All @@ -30,19 +31,22 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.mikepenz:materialdrawer:5.7.0@aar') {
compile('com.mikepenz:materialdrawer:5.8.0@aar') {
transitive = true
}
compile group: 'org.ocpsoft.prettytime', name: 'prettytime', version: '4.0.1.Final'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:gridlayout-v7:25.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.android.support:gridlayout-v7:25.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.zhy:okhttputils:2.6.2'
Expand All @@ -51,14 +55,13 @@ dependencies {
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v2.5.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
compile 'com.jaeger.ninegridimageview:library:1.0.2'
compile 'com.github.liuguangqiang.swipeback:library:1.0.2@aar'
compile 'me.relex:circleindicator:1.2.1@aar'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'net.grandcentrix.tray:tray:0.11.0'
compile 'com.annimon:stream:1.1.2'
compile 'com.klinkerapps:sliding-activity:1.4.4'
compile 'com.andkulikov:transitionseverywhere:1.6.9'
compile 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
Expand All @@ -68,6 +71,11 @@ dependencies {
compile 'com.github.goka.flickableview:flickableview:1.0.0'
compile 'net.hockeyapp.android:HockeySDK:4.1.1'
compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.3'
compile 'com.jakewharton:kotterknife:0.1.0-SNAPSHOT'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
repositories {
mavenCentral()
}
60 changes: 0 additions & 60 deletions app/src/main/java/moe/tlaster/openween/App.java

This file was deleted.

57 changes: 57 additions & 0 deletions app/src/main/java/moe/tlaster/openween/App.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package moe.tlaster.openween

import android.app.Application
import android.app.job.JobInfo
import android.app.job.JobScheduler
import android.content.ComponentName
import android.content.Context
import android.graphics.drawable.Drawable
import android.net.Uri
import android.widget.ImageView

import com.bumptech.glide.Glide
import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader
import com.mikepenz.materialdrawer.util.DrawerImageLoader
import com.mikepenz.materialdrawer.util.DrawerUIUtils

import moe.tlaster.openween.common.service.NotificationService

import android.app.job.JobInfo.NETWORK_TYPE_ANY

/**
* Created by Tlaster on 2016/9/10.
*/
class App : Application() {

override fun onCreate() {
super.onCreate()
context = applicationContext
DrawerImageLoader.init(object : AbstractDrawerImageLoader() {
override fun set(imageView: ImageView?, uri: Uri?, placeholder: Drawable?) {
Glide.with(imageView!!.context).load(uri).placeholder(placeholder).centerCrop().into(imageView)
}

override fun cancel(imageView: ImageView?) {
Glide.clear(imageView!!)
}

override fun placeholder(ctx: Context, tag: String?): Drawable {
if (DrawerImageLoader.Tags.PROFILE.name == tag) {
return DrawerUIUtils.getPlaceHolder(ctx)
} else if (DrawerImageLoader.Tags.ACCOUNT_HEADER.name == tag) {
return IconicsDrawable(ctx).iconText(" ").backgroundColorRes(com.mikepenz.materialdrawer.R.color.primary).sizeDp(56)
} else if ("customUrlItem" == tag) {
return IconicsDrawable(ctx).iconText(" ").backgroundColorRes(R.color.md_red_500).sizeDp(56)
}
return super.placeholder(ctx, tag)
}
})
}

companion object {

var context: Context? = null
private set
}
}

This file was deleted.

Loading

0 comments on commit 8a40ce2

Please sign in to comment.