diff --git a/.gitignore b/.gitignore index c9c2248..63e899b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,18 +15,16 @@ gen/ # Gradle files .gradle/ build/ +/*/build/ # Local configuration file (sdk path, etc) local.properties -# Proguard folder generated by Eclipse -proguard/ - # Log Files *.log -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ +.gradle +.idea +.DS_Store +/captures +*.iml diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..0fe0222 --- /dev/null +++ b/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.library' +apply plugin: 'me.tatarka.retrolambda' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + defaultConfig { + minSdkVersion 9 + targetSdkVersion 23 + } +} + +dependencies { + compile 'com.android.support:appcompat-v7:23.2.0' + provided 'com.android.support:multidex:1.0.1' + provided('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') { + transitive = true; + } +} diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c2fdd72 --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/src/main/java/ru/touchin/templates/TouchinApp.java b/src/main/java/ru/touchin/templates/TouchinApp.java new file mode 100644 index 0000000..c52b5e3 --- /dev/null +++ b/src/main/java/ru/touchin/templates/TouchinApp.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016 Touch Instinct + * + * This file is part of RoboSwag library. + * + * 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 ru.touchin.templates; + +import android.app.Application; +import android.content.Context; +import android.support.annotation.NonNull; +import android.support.multidex.MultiDex; + +import com.crashlytics.android.Crashlytics; + +import io.fabric.sdk.android.Fabric; + +/** + * Created by Gavriil Sitnikov on 10/03/16. + */ +public abstract class TouchinApp extends Application { + + protected abstract boolean isDebug(); + + @Override + protected void attachBaseContext(@NonNull final Context base) { + super.attachBaseContext(base); + MultiDex.install(base); + } + + @Override + public void onCreate() { + super.onCreate(); + if (isDebug()) { + //TODO + } else { + final Crashlytics crashlytics = new Crashlytics(); + Fabric.with(this, crashlytics); + } + } + +}