From a94c655c4384eca9ebd1f528584c16b07325e06f Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Wed, 10 Apr 2019 20:05:15 +0400 Subject: [PATCH] Enabled multidex --- app/build.gradle | 2 ++ .../io/github/chronosx88/influence/helpers/AppHelper.java | 3 ++- .../io/github/chronosx88/influence/helpers/ChatAdapter.java | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e95e8ed..600e0f5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,7 @@ android { versionCode 1 versionName "0.1alpha2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true javaCompileOptions { annotationProcessorOptions { arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] @@ -53,6 +54,7 @@ dependencies { implementation 'de.hdodenhof:circleimageview:3.0.0' implementation group: 'org.objenesis', name: 'objenesis', version: '2.6' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation 'com.android.support:multidex:1.0.3' } repositories { mavenCentral() diff --git a/app/src/main/java/io/github/chronosx88/influence/helpers/AppHelper.java b/app/src/main/java/io/github/chronosx88/influence/helpers/AppHelper.java index e86b406..311d511 100644 --- a/app/src/main/java/io/github/chronosx88/influence/helpers/AppHelper.java +++ b/app/src/main/java/io/github/chronosx88/influence/helpers/AppHelper.java @@ -5,6 +5,7 @@ import android.content.Context; import net.tomp2p.dht.PeerDHT; +import androidx.multidex.MultiDexApplication; import androidx.room.Room; import io.github.chronosx88.influence.observable.MainObservable; @@ -12,7 +13,7 @@ import io.github.chronosx88.influence.observable.MainObservable; * Extended Application class which designed for getting various objects from anywhere in the application. */ -public class AppHelper extends Application { +public class AppHelper extends MultiDexApplication { private static Application instance; private static MainObservable observable; private static String peerID; diff --git a/app/src/main/java/io/github/chronosx88/influence/helpers/ChatAdapter.java b/app/src/main/java/io/github/chronosx88/influence/helpers/ChatAdapter.java index 80f6a8c..64e2b28 100644 --- a/app/src/main/java/io/github/chronosx88/influence/helpers/ChatAdapter.java +++ b/app/src/main/java/io/github/chronosx88/influence/helpers/ChatAdapter.java @@ -10,6 +10,8 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; @@ -22,7 +24,7 @@ public class ChatAdapter extends RecyclerView.Adapter { private final static int LEFT_ITEM = 1; private final static int TECHNICAL_MESSAGE = 2; // TODO - private final static Context context = AppHelper.getContext(); + private final Context context = AppHelper.getContext(); private ArrayList messages = new ArrayList<>(); @NonNull