Skip to content

Commit

Permalink
Release 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMarquis committed Jan 24, 2020
1 parent 62423e8 commit 41cfd4c
Show file tree
Hide file tree
Showing 58 changed files with 1,549 additions and 2,141 deletions.
88 changes: 70 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
def versionMajor = 1
def versionMinor = 7
def versionMinor = 8
def versionPatch = 0
def versionBuild = 0

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
Expand All @@ -15,38 +21,84 @@ android {
versionCode versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

javaCompileOptions {
annotationProcessorOptions {
arguments = [
"room.schemaLocation" : "$projectDir/schemas".toString(),
"room.incremental" : "true",
"room.expandProjection": "true"
]
}
}
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
testOptions {
unitTests.includeAndroidResources = true
unitTests.returnDefaultValues = true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
/* AndroidX */
implementation 'androidx.appcompat:appcompat:1.2.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'androidx.core:core-ktx:1.2.0-rc01'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.preference:preference-ktx:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.transition:transition:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'

/* Material Design */
implementation 'com.google.android.material:material:1.2.0-alpha04'

/* Firebase */
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-database:19.2.0'

/* Koin: Dependency Injection */
implementation 'org.koin:koin-android:2.0.1'
implementation 'org.koin:koin-android-scope:2.0.1'
implementation 'org.koin:koin-android-viewmodel:2.0.1'
testImplementation 'org.koin:koin-test:2.0.1'
androidTestImplementation 'org.koin:koin-test:2.0.1'

/* Moshi: JSON parsing */
implementation 'com.squareup.moshi:moshi-adapters:1.9.2'
implementation 'com.squareup.moshi:moshi-kotlin:1.9.2'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.2'

/* Room: SQLite persistence */
implementation 'androidx.room:room-runtime:2.2.3'
kapt 'androidx.room:room-compiler:2.2.3'
implementation 'androidx.room:room-ktx:2.2.3'
testImplementation 'androidx.room:room-testing:2.2.3'

/* Kotlin Coroutines */
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3'

/* JUnit */
testImplementation 'junit:junit:4.13'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.preference:preference-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-database:19.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.moshi:moshi:1.8.0'
implementation 'com.squareup.moshi:moshi-adapters:1.8.0'
}

apply plugin: 'com.google.gms.google-services'
94 changes: 94 additions & 0 deletions app/schemas/fr.smarquis.fcm.data.db.AppDatabase/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "564aa2fa1b2faa8cd7b3abf4a25296e2",
"entities": [
{
"tableName": "Message",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`messageId` TEXT NOT NULL, `from` TEXT, `to` TEXT, `data` TEXT NOT NULL, `collapseKey` TEXT, `messageType` TEXT, `sentTime` INTEGER NOT NULL, `ttl` INTEGER NOT NULL, `priority` INTEGER NOT NULL, `originalPriority` INTEGER NOT NULL, `payload` TEXT, PRIMARY KEY(`messageId`))",
"fields": [
{
"fieldPath": "messageId",
"columnName": "messageId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "from",
"columnName": "from",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "to",
"columnName": "to",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "data",
"columnName": "data",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "collapseKey",
"columnName": "collapseKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "messageType",
"columnName": "messageType",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "sentTime",
"columnName": "sentTime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "ttl",
"columnName": "ttl",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "priority",
"columnName": "priority",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "originalPriority",
"columnName": "originalPriority",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "payload",
"columnName": "payload",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"messageId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '564aa2fa1b2faa8cd7b3abf4a25296e2')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fr.smarquis.fcm

package fr.smarquis.fcm;

import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
* @see [Testing documentation](http://d.android.com/tools/testing)
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {

@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("fr.smarquis.fcm", appContext.getPackageName());
fun useAppContext() { // Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
Assert.assertEquals("fr.smarquis.fcm", appContext.packageName)
}
}
}
12 changes: 8 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />

<application
android:name=".App"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">

<activity
android:name=".MainActivity"
android:name=".view.ui.MainActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@style/AppTheme">
Expand All @@ -43,15 +45,17 @@
</activity>

<service
android:name=".FcmService"
android:name=".data.services.FcmService"
tools:ignore="ExportedService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<activity
android:name=".CopyToClipboardActivity"
android:name=".view.ui.CopyToClipboardActivity"
android:theme="@android:style/Theme.NoDisplay" />

</application>

</manifest>
22 changes: 22 additions & 0 deletions app/src/main/java/fr/smarquis/fcm/App.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package fr.smarquis.fcm

import androidx.multidex.MultiDexApplication
import fr.smarquis.fcm.di.database
import fr.smarquis.fcm.di.json
import fr.smarquis.fcm.di.main
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin


@Suppress("unused")
class App : MultiDexApplication() {

override fun onCreate() {
super.onCreate()
startKoin {
androidContext(this@App)
modules(listOf(main, json, database))
}
}

}
70 changes: 0 additions & 70 deletions app/src/main/java/fr/smarquis/fcm/FcmService.java

This file was deleted.

Loading

0 comments on commit 41cfd4c

Please sign in to comment.