Skip to content

Commit b69678e

Browse files
committed
first version, v0.2
1 parent d77dd42 commit b69678e

File tree

12 files changed

+279
-96
lines changed

12 files changed

+279
-96
lines changed

app/build.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
apply plugin: 'com.android.application'
2-
32
apply plugin: 'kotlin-android'
4-
53
apply plugin: 'kotlin-android-extensions'
64

75
android {
@@ -25,7 +23,7 @@ android {
2523
dependencies {
2624
implementation fileTree(dir: 'libs', include: ['*.jar'])
2725
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
28-
implementation 'com.android.support:appcompat-v7:27.1.0'
26+
implementation 'com.android.support:appcompat-v7:27.1.1'
2927
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
3028
testImplementation 'junit:junit:4.12'
3129
androidTestImplementation 'com.android.support.test:runner:1.0.1'

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.2.30'
5-
ext.rotor_version = '0.1.2'
4+
ext.kotlin_version = '1.2.41'
5+
ext.rotor_version = '0.2'
66

77
repositories {
88
google()
@@ -12,10 +12,10 @@ buildscript {
1212
}
1313
}
1414
dependencies {
15-
classpath 'com.android.tools.build:gradle:3.0.1'
15+
classpath 'com.android.tools.build:gradle:3.1.2'
1616
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1717
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"
18-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
18+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1919
// NOTE: Do not place your application dependencies here; they belong
2020
// in the individual module build.gradle files
2121
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Mar 24 17:56:41 CET 2018
1+
#Mon Jun 04 01:36:22 CEST 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

notifications/build.gradle

+24-19
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ apply plugin: 'com.github.dcendents.android-maven'
44
apply plugin: 'com.jfrog.bintray'
55

66
version = rotor_version
7+
group = "com.rotor"
8+
79

810
android {
911
compileSdkVersion 27
@@ -12,7 +14,7 @@ android {
1214
minSdkVersion 21
1315
targetSdkVersion 27
1416
versionCode 1
15-
versionName version
17+
versionName rotor_version
1618
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1719
}
1820

@@ -28,27 +30,32 @@ android {
2830
dependencies {
2931
implementation fileTree(dir: 'libs', include: ['*.jar'])
3032

31-
implementation 'com.android.support:appcompat-v7:27.1.0'
33+
implementation 'com.android.support:appcompat-v7:27.1.1'
3234
testImplementation 'junit:junit:4.12'
3335
androidTestImplementation 'com.android.support.test:runner:1.0.1'
3436
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
3537

36-
implementation "com.android.support:support-compat:27.1.0"
37-
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
38-
// compile project(":core")
39-
// compile project(":database")
40-
implementation 'com.rotor:core:0.1.1@aar'
41-
compile ('com.rotor:database:0.1.1@aar') {
38+
implementation "com.android.support:support-compat:27.1.1"
39+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
40+
// implementation project(":core")
41+
// implementation project(":database")
42+
43+
implementation ('com.rotor:core:0.2@aar') {
44+
transitive = true
45+
}
46+
implementation ('com.rotor:database:0.2@aar') {
4247
transitive = true
4348
}
44-
compile 'com.google.code.gson:gson:2.8.2'
45-
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
46-
compile "com.stringcare:library:0.7"
47-
48-
compile "com.squareup.retrofit2:retrofit:2.3.0"
49-
compile "com.squareup.retrofit2:adapter-rxjava2:2.3.0"
50-
compile "com.squareup.retrofit2:converter-gson:2.3.0"
51-
compile "io.reactivex.rxjava2:rxandroid:2.0.2"
49+
implementation 'com.google.code.gson:gson:2.8.2'
50+
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
51+
implementation "com.stringcare:library:0.7"
52+
53+
implementation 'org.apache.commons:commons-lang3:3.6'
54+
55+
implementation "com.squareup.retrofit2:retrofit:2.3.0"
56+
implementation "com.squareup.retrofit2:adapter-rxjava2:2.3.0"
57+
implementation "com.squareup.retrofit2:converter-gson:2.3.0"
58+
implementation "io.reactivex.rxjava2:rxandroid:2.0.2"
5259
}
5360

5461
repositories {
@@ -58,15 +65,13 @@ repositories {
5865
def siteUrl = 'https://github.com/rotorlab/notifications-kotlin'
5966
def gitUrl = 'https://github.com/rotorlab/notifications-kotlin.git'
6067

61-
group = "com.rotor"
62-
6368
install {
6469
repositories.mavenInstaller {
6570
// This generates POM.xml with proper parameters
6671
pom {
6772
project {
6873
packaging 'aar'
69-
name 'Database module for Rotor client (kotlin)'
74+
name 'Notifications module for Rotor client (kotlin)'
7075
url siteUrl
7176
// Set your license
7277
licenses {
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
package com.rotor.notifications
22

3-
import android.content.Intent
43
import android.os.Bundle
54
import android.support.v7.app.AppCompatActivity
5+
import com.rotor.core.Rotor
66

77
/**
88
* Created by efraespada on 23/03/2018.
99
*/
1010
abstract class NotificationRouterActivity : AppCompatActivity() {
1111

12+
var enter: Boolean ? = false
13+
1214
interface NotificationsStatus {
1315
fun ready()
1416
}
1517

1618
override fun onCreate(savedInstanceState: Bundle?) {
1719
super.onCreate(savedInstanceState)
18-
20+
enter = true
1921
var requestCode : Int ? = null
2022
var id : String ? = null
21-
var data : String ? = null
23+
var room : String ? = null
2224
if (intent.hasExtra(Notifications.ID)) {
2325
id = intent.getStringExtra(Notifications.ID)
2426
if (id == null){
@@ -28,24 +30,37 @@ abstract class NotificationRouterActivity : AppCompatActivity() {
2830
if (intent.hasExtra(Notifications.RC)) {
2931
requestCode = intent.getIntExtra(Notifications.RC, 0)
3032
}
31-
if (intent.hasExtra(Notifications.DATA)) {
32-
data = intent.getStringExtra(Notifications.DATA)
33-
if (data == null){
34-
data = ""
33+
if (intent.hasExtra(Notifications.ROOM)) {
34+
room = intent.getStringExtra(Notifications.ROOM)
35+
if (room == null){
36+
room = ""
3537
}
3638
}
3739

3840
Notifications.listener(object : NotificationsStatus {
3941
override fun ready() {
40-
notificationTouched(requestCode!!, id!!, data!!)
42+
if (enter != null && enter as Boolean) {
43+
notificationTouched(requestCode!!, id!!, room!!)
44+
}
45+
enter = false
4146
}
4247
})
4348

44-
onCreate(savedInstanceState, requestCode!!, id!!, data!!)
49+
onCreate()
4550
}
4651

47-
abstract fun notificationTouched(action: Int, id: String, data: String)
52+
abstract fun notificationTouched(action: Int, id: String, room: String)
53+
54+
abstract fun onCreate()
4855

49-
abstract fun onCreate(savedInstanceState: Bundle?, action: Int, id: String, data: String)
56+
override fun onResume() {
57+
super.onResume()
58+
Rotor.onResume()
59+
}
60+
61+
override fun onPause() {
62+
Rotor.onPause()
63+
super.onPause()
64+
}
5065

5166
}

0 commit comments

Comments
 (0)