Skip to content

Commit

Permalink
Merge pull request #136 from wbrunette/nine
Browse files Browse the repository at this point in the history
add multidexing support
  • Loading branch information
linl33 authored Sep 16, 2019
2 parents 5003f75 + b98385a commit f6daf1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions tables_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ android {

testApplicationId(groupId + tablesName + testNameSuffix)
testInstrumentationRunner(instrumentationRunner)

multiDexEnabled true
}

flavorDimensions "stage", "testing"
Expand Down Expand Up @@ -134,6 +136,8 @@ dependencies {
transitive =true;
}

implementation 'androidx.multidex:multidex:2.0.1'

if (libraryProjectPath.exists() && gradle.useLocal) { // Local project is favoured
implementation project(libraryProjectName)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

package org.opendatakit.tables.application;

import android.content.Context;

import androidx.multidex.MultiDex;

import com.crashlytics.android.Crashlytics;
import com.google.firebase.analytics.FirebaseAnalytics;
import io.fabric.sdk.android.Fabric;
Expand Down Expand Up @@ -44,6 +48,13 @@ public static Tables getInstance() {
return ref.get();
}

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}


@Override
public int getApkDisplayNameResourceId() {
return R.string.app_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public class DefaultViewTypePreference extends ListPreference {
*/
public DefaultViewTypePreference(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = ((ContextThemeWrapper) context).getBaseContext();
if (mContext instanceof IAppAwareActivity) {
mAppName = ((IAppAwareActivity) mContext).getAppName();
if (context instanceof IAppAwareActivity) {
mContext = context;
mAppName = ((IAppAwareActivity) context).getAppName();
} else {
throw new IllegalArgumentException("Must be in an activity that knows the app name");
}
Expand Down

0 comments on commit f6daf1c

Please sign in to comment.