Skip to content

Commit

Permalink
Merge branch 'master' into show-notification-when-mysession-starts
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Jan 17, 2018
2 parents 3bad3b3 + efbff29 commit 1733377
Show file tree
Hide file tree
Showing 91 changed files with 718 additions and 282 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
.externalNativeBuild

# not ignore
!.idea/codeStyleSettings.xml
!.idea/codeStyleSettings.xml
!.idea/icon.png
!.idea/icon_dark.png
Binary file added .idea/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .idea/icon_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ github.dismiss_out_of_range_messages
checkstyle_format.base_path = Dir.pwd

checkstyle_format.report "app/build/reports/ktlint/ktlint-#{ENV['APP_BUILD_TYPE'].downcase}.xml"

# AndroidLint
android_lint.report_file = "app/build/reports/lint-results-#{ENV['APP_BUILD_TYPE'].downcase}.xml"
android_lint.skip_gradle_task = true
android_lint.severity = "Error"
android_lint.lint(inline_mode: true)
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ source "https://rubygems.org"

gem "danger"
gem "danger-checkstyle_format"
gem "danger-android_lint"
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ GEM
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
ansi (1.5.0)
ast (2.3.0)
claide (1.0.2)
claide-plugins (0.9.2)
cork
Expand All @@ -23,6 +25,9 @@ GEM
no_proxy_fix
octokit (~> 4.7)
terminal-table (~> 1)
danger-android_lint (0.0.6)
danger-plugin-api (~> 1.0)
oga
danger-checkstyle_format (0.1.1)
danger-plugin-api (~> 1.0)
ox (~> 2.0)
Expand All @@ -39,9 +44,15 @@ GEM
no_proxy_fix (0.1.2)
octokit (4.8.0)
sawyer (~> 0.8.0, >= 0.5.3)
oga (2.13)
ast
ruby-ll (~> 2.1)
open4 (1.3.4)
ox (2.8.2)
public_suffix (3.0.1)
ruby-ll (2.1.2)
ansi
ast
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
Expand All @@ -54,6 +65,7 @@ PLATFORMS

DEPENDENCIES
danger
danger-android_lint
danger-checkstyle_format

BUNDLED WITH
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ SessionsFragment.kt
})
```
## iOS App with Kotlin/Native and Kotlin Multiplatform Projects
Some contributors are challenging to develop iOS app with [Kotlin/Native](https://kotlinlang.org/docs/reference/native-overview.html) and [Kotlin Multiplatform Projects](https://kotlinlang.org/docs/reference/multiplatform.html).
We are watching this project.
[DroidKaigi2018iOS](https://github.com/kikuchy/DroidKaigi2018iOS)
## Thanks
Thank you for contributing!
Expand Down
198 changes: 97 additions & 101 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: 'io.fabric'
apply plugin: 'com.github.ben-manes.versions'

// Manifest version
def versionMajor = 0
def versionMinor = 1
def versionPatch = 0

android {
compileSdkVersion 27
compileSdkVersion versions.compileSdk
dataBinding.enabled = true

defaultConfig {
applicationId "io.github.droidkaigi.confsched2018"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "0.1"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "$versionMajor.$versionMinor.$versionPatch"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down Expand Up @@ -52,8 +57,17 @@ android {
signingConfig signingConfigs.release
debuggable false
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled true
proguardFile getDefaultProguardFile('proguard-android.txt')
// global proguard settings
proguardFile file("proguard-rules.pro")
// library proguard settings
def files = rootProject.file("proguard")
.listFiles()
.findAll { it.name.startsWith("proguard") }
.toList()
.toArray()
proguardFiles(files)
}
}
testOptions {
Expand All @@ -66,112 +80,94 @@ android {
}
}

// See versions.gradle
dependencies {

implementation project(':model')

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

// Retrofit
def retrofitVersion = '2.3.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"

// Kotshi
def kotshiVersion = '0.3.0-beta1'
implementation "se.ansman.kotshi:api:$kotshiVersion"
kapt "se.ansman.kotshi:compiler:$kotshiVersion"

// Android Architecture Components
implementation 'android.arch.lifecycle:runtime:1.0.3'
implementation 'android.arch.lifecycle:extensions:1.0.0'
implementation 'android.arch.lifecycle:reactivestreams:1.0.0'
implementation 'android.arch.persistence.room:runtime:1.0.0'
implementation "android.arch.persistence.room:rxjava2:1.0.0"
kapt 'android.arch.persistence.room:compiler:1.0.0'

// RxJava
implementation "io.reactivex.rxjava2:rxjava:2.1.8"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'

// OkHttp
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'

// Support Library
def supportLibraryVersion = '27.0.2'
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:support-vector-drawable:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:customtabs:$supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta4'

// DataBinding
kapt "com.android.databinding:compiler:3.0.1"

// Dagger
def daggerVersion = '2.13'
implementation "com.google.dagger:dagger:$daggerVersion"
implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"

// Firebase
// Adjust version for emulator
def firebaseVersion = '11.6.2'
implementation "com.google.firebase:firebase-firestore:$firebaseVersion"
implementation "com.google.firebase:firebase-auth:$firebaseVersion"
implementation "com.google.firebase:firebase-core:$firebaseVersion"
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation depends.kotlin.stdlib

//==================== Support Library ====================
implementation depends.support.v4
implementation depends.support.appcompat
implementation depends.support.design
implementation depends.support.cardview
implementation depends.support.customtabs
implementation depends.support.constraint
implementation depends.support.multidex

//==================== Network ====================
implementation depends.okhttp3.loggingIntercepter

implementation depends.retrofit.core
implementation depends.retrofit.converterMoshi
implementation depends.retrofit.adapterRxJava2

//==================== Structure ====================
implementation depends.kotshi.api
kapt depends.kotshi.compiler

implementation depends.lifecycle.runtime
implementation depends.lifecycle.extensions
implementation depends.lifecycle.reactivestreams
implementation depends.room.runtime
implementation depends.room.rxjava2
kapt depends.room.compiler

implementation depends.rxjava2.core
implementation depends.rxjava2.android
implementation depends.rxjava2.kotlin

// ThreeTenABP for JSR-310 backport
implementation 'com.jakewharton.threetenabp:threetenabp:1.0.5'
testImplementation 'org.threeten:threetenbp:1.3.3'
kapt depends.binding.compiler

// groupie for RecyclerView Adapter
def groupieVersion = '2.0.0'
implementation "com.xwray:groupie-databinding:$groupieVersion"
implementation "com.xwray:groupie:$groupieVersion"
implementation depends.dagger.core
implementation depends.dagger.android
implementation depends.dagger.androidSupport
kapt depends.dagger.compiler
kapt depends.dagger.androidProcessor

implementation depends.firebase.firestore
implementation depends.firebase.auth
implementation depends.firebase.core

implementation depends.threetenabp

//==================== UI ====================
implementation depends.glide.core
implementation depends.glide.okhttp3
kapt depends.glide.compiler

implementation depends.groupie.core
implementation depends.groupie.binding

implementation depends.downloadableCalligraphy

//==================== Debug ====================
debugImplementation depends.stetho.core
debugImplementation depends.stetho.okhttp3

implementation(depends.crashlytics) {
transitive = true
}

// MultiDex
implementation 'com.android.support:multidex:1.0.2'
implementation depends.timber

// Glide
def glideVersion = '4.4.0'
implementation "com.github.bumptech.glide:glide:$glideVersion"
implementation "com.github.bumptech.glide:okhttp3-integration:$glideVersion"
kapt "com.github.bumptech.glide:compiler:$glideVersion"
debugImplementation depends.leakcanary

// Timber
implementation 'com.jakewharton.timber:timber:4.6.0'
debugImplementation depends.debot.core
releaseImplementation depends.debot.noop

// Downloadable Calligraphy
implementation 'com.github.takahirom.downloadable.calligraphy:downloadable-calligraphy:0.1.2'
//==================== Test ====================
testImplementation depends.junit
testImplementation depends.mockitoKotlin

// LeakCanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
testImplementation depends.robolectric.core
testImplementation depends.assertk

// Stetho
def stethoVersion = '1.5.0'
debugImplementation "com.facebook.stetho:stetho:$stethoVersion"
debugImplementation "com.facebook.stetho:stetho-okhttp3:$stethoVersion"
testImplementation depends.threetenbp

// Test
testImplementation 'junit:junit:4.12'
testImplementation "com.nhaarman:mockito-kotlin:1.5.0"
// Unit Test
testImplementation "org.robolectric:robolectric:3.5.1"
testImplementation 'com.willowtreeapps.assertk:assertk:0.9'
// Instrumentation Test
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation depends.supporttest.runner
androidTestImplementation depends.supporttest.espresso

}

Expand All @@ -180,7 +176,7 @@ repositories {
}

ktlint {
version = "0.14.0"
version = versions.ktlint
android = true
reporter = "checkstyle"
ignoreFailures = true
Expand Down
7 changes: 7 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Keep the names of our models so that Moshi can use them
-keepnames class io.github.droidkaigi.confsched2018.data.api.response.** { *; }

# Keep SourceFile names & Line Numbers for stack traces. (Note: If we are really security concious,
# we should remove this line.
-keepattributes SourceFile,LineNumberTable
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.github.droidkaigi.confsched2018.presentation

import android.app.Activity
import android.app.Application
import android.os.Bundle
import android.support.v4.app.FragmentActivity
import com.tomoima.debot.Debot

class DebotObserver : Application.ActivityLifecycleCallbacks {

val debot: Debot by lazy {
Debot.getInstance()
}

override fun onActivityCreated(activity: Activity?, savedInstanceState: Bundle?) {
if (activity !is Activity) return
debot.allowShake(activity.applicationContext)
}

override fun onActivityStarted(activity: Activity?) {
// no-op
}

override fun onActivityResumed(activity: Activity?) {
if (activity !is FragmentActivity) return
debot.startSensor(activity)
}

override fun onActivityPaused(activity: Activity?) {
debot.stopSensor()
}

override fun onActivityStopped(activity: Activity?) {
// no-op
}

override fun onActivitySaveInstanceState(activity: Activity?, outState: Bundle?) {
// no-op
}

override fun onActivityDestroyed(activity: Activity?) {
// no-op
}
}
Loading

0 comments on commit 1733377

Please sign in to comment.