Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Added Firebase crashlytics support and transitioned app to AndroidX u…
Browse files Browse the repository at this point in the history
…sage (#1104)
  • Loading branch information
Langston Smith authored Jul 9, 2019
1 parent 927b6e8 commit c0f66bd
Show file tree
Hide file tree
Showing 235 changed files with 693 additions and 644 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ build
gradlew.bat
*.properties
src/main/res/
MapboxAndroidDemo/google-services.json

14 changes: 8 additions & 6 deletions MapboxAndroidDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.triplet.play'
apply plugin: 'io.fabric'
apply from: "$project.rootDir/gradle/script-git-version.gradle"
apply from: "$project.rootDir/gradle/gradle-dependencies-graph.gradle"

Expand Down Expand Up @@ -38,7 +39,7 @@ android {
buildConfigField "int", "MIN_SDK_VERSION", "$minSdkVersion.apiLevel"

playAccountConfig = playAccountConfigs.defaultAccountConfig
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

flavorDimensions "default"
Expand Down Expand Up @@ -72,6 +73,7 @@ android {
applicationIdSuffix '.debug'
versionNameSuffix '-Debug'
minifyEnabled false
ext.enableCrashlytics = false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

Expand Down Expand Up @@ -107,17 +109,16 @@ if (isGlobal) {
dependencies {

// Wearable application module
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
globalWearApp project(':MapboxAndroidWearDemo')

// Support libraries
implementation dependenciesList.supportGridLayout
implementation dependenciesList.supportAppcompatV4
implementation dependenciesList.supportAppcompatV7
implementation dependenciesList.supportCardView
implementation dependenciesList.supportRecyclerView
implementation dependenciesList.supportDesign
implementation dependenciesList.supportMaterialDesign
implementation dependenciesList.supportCustomTabs
implementation dependenciesList.supportV4
implementation dependenciesList.supportConstraintLayout
implementation dependenciesList.supportAnimation

Expand All @@ -137,8 +138,9 @@ dependencies {
implementation dependenciesList.mapboxPluginScalebar

// Firebase
globalImplementation dependenciesList.firebaseCrash
globalImplementation dependenciesList.firebaseCore
globalImplementation dependenciesList.firebasePerf
globalImplementation dependenciesList.firebaseCrashlytics

// Other dependencies
implementation dependenciesList.gson
Expand Down Expand Up @@ -169,4 +171,4 @@ dependencies {
}

apply from: "${rootDir}/gradle/checkstyle.gradle"
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android-extensions'
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.IdlingResourceTimeoutException;
import android.support.test.rule.ActivityTestRule;

import com.mapbox.mapboxandroiddemo.R;
import com.mapbox.mapboxsdk.maps.MapboxMap;
Expand All @@ -19,12 +16,15 @@
import org.junit.Before;
import org.junit.Rule;

import androidx.test.espresso.Espresso;
import androidx.test.espresso.IdlingResourceTimeoutException;
import androidx.test.rule.ActivityTestRule;
import timber.log.Timber;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;


public abstract class BaseActivityTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.mapbox.mapboxsdk.testapp.action;

import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.view.View;

import org.hamcrest.Matcher;

import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;

import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;

public final class WaitAction implements ViewAction {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import com.mapbox.mapboxandroiddemo.examples.<%- subPackage %>.<%- activity %>;
import com.mapbox.mapboxsdk.testapp.BaseActivityTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import android.support.test.runner.AndroidJUnit4;

import androidx.test.ext.junit.runners.AndroidJUnit4;

/**
* Sanity test for <%- activity %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.mapbox.mapboxsdk.testapp.utils;

import android.app.Activity;
import android.support.test.espresso.IdlingResource;

import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;

import java.lang.reflect.Field;

import androidx.test.espresso.IdlingResource;

public class OnMapReadyIdlingResource implements IdlingResource, OnMapReadyCallback {

private MapboxMap mapboxMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import androidx.annotation.NonNull;
import com.google.android.material.navigation.NavigationView;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.NonNull;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mapbox.mapboxandroiddemo.examples;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.annotation.NonNull;
import android.view.Menu;
import android.view.MenuItem;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand All @@ -14,4 +14,4 @@
mapbox:mapbox_cameraZoom="3.5"
/>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand All @@ -17,7 +17,7 @@
mapbox:mapbox_cameraTilt="60"
mapbox:mapbox_cameraZoom="16" />

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabBuilding"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -99,4 +99,4 @@

</LinearLayout>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
mapbox:mapbox_cameraZoom="16"
/>

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabLightPosition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -27,7 +27,7 @@
mapbox:backgroundTint="@color/mapboxPink"
mapbox:layout_anchorGravity="top"/>

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabLightColor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand All @@ -14,4 +14,4 @@
mapbox:mapbox_cameraZoom="12"
/>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand All @@ -14,4 +14,4 @@
mapbox:mapbox_cameraZoom="4.3"
/>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand All @@ -13,4 +13,4 @@
mapbox:mapbox_cameraZoom="3.853171"
/>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down Expand Up @@ -39,4 +39,4 @@

</LinearLayout>

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand Down Expand Up @@ -53,4 +53,4 @@

</com.getbase.floatingactionbutton.FloatingActionsMenu>

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
mapbox:mapbox_cameraZoom="12"
/>

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_on_top_of_map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
app:mapbox_cameraTargetLng="136.711369"
app:mapbox_cameraZoom="4.5257" />

<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/language_one_cardview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -35,9 +35,9 @@
android:text="@string/arabic"
android:textColor="@color/mapboxWhite" />

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/language_two_cardview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -54,10 +54,10 @@
android:text="@string/russian"
android:textColor="@color/mapboxWhite" />

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>


<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:id="@+id/language_three_cardview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -74,11 +74,11 @@
android:text="@string/chinese"
android:textColor="@color/mapboxWhite" />

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/match_map_to_device_language"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/switch_heatmap_style_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
Loading

0 comments on commit c0f66bd

Please sign in to comment.