Этот коммит содержится в:
Anton Tananaev
2017-09-03 10:28:53 +12:00
родитель 56eb501b5e
Коммит 5705bc2c90
13 изменённых файлов: 93 добавлений и 17 удалений
+23
Просмотреть файл
@@ -12,6 +12,11 @@ android {
versionName "2.3"
}
productFlavors {
regular
google
}
buildTypes {
release {
minifyEnabled false
@@ -21,6 +26,24 @@ android {
}
dependencies {
compile 'com.android.support:design:26.0.1'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.0'
googleCompile 'com.google.firebase:firebase-core:11.2.0'
googleCompile 'com.google.firebase:firebase-crash:11.2.0'
}
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Google")) {
apply plugin: 'com.google.gms.google-services'
task copyJson(type: Copy) {
from '../../traccar-shared/google-services'
into '.'
include 'traccar-manager-android.json'
rename('traccar-manager-android.json', 'google-services.json')
}
afterEvaluate {
preBuild.dependsOn copyJson
}
}
+12
Просмотреть файл
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:name="org.traccar.client.GoogleMainApplication"
tools:replace="android:name">
</application>
</manifest>
+32
Просмотреть файл
@@ -0,0 +1,32 @@
/*
* Copyright 2017 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.traccar.client;
import android.app.Application;
import com.google.firebase.analytics.FirebaseAnalytics;
public class GoogleMainApplication extends Application {
private FirebaseAnalytics firebaseAnalytics;
@Override
public void onCreate() {
super.onCreate();
firebaseAnalytics = FirebaseAnalytics.getInstance(this);
}
}
+2 -1
Просмотреть файл
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.traccar.manager">
<uses-permission android:name="android.permission.INTERNET" />
+2 -2
Просмотреть файл
@@ -15,11 +15,11 @@
*/
package org.traccar.manager;
import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
public class MainActivity extends Activity {
public class MainActivity extends AppCompatActivity {
public static final String PREFERENCE_URL = "url";
+1 -1
Просмотреть файл
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<background android:drawable="@color/primary"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
+1 -1
Просмотреть файл
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<background android:drawable="@color/primary"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
-4
Просмотреть файл
@@ -1,4 +0,0 @@
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light.NoActionBar">
</style>
</resources>
+9
Просмотреть файл
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#1E88E5</color>
<color name="primary_dark">#1565C0</color>
<color name="accent">#1976D2</color>
<color name="white">#FFFFFF</color>
</resources>
-4
Просмотреть файл
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#1E88E5</color>
</resources>
-4
Просмотреть файл
@@ -1,4 +0,0 @@
<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light.NoActionBar">
</style>
</resources>
+10
Просмотреть файл
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
</style>
</resources>
+1
Просмотреть файл
@@ -4,6 +4,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}