Skip to content
This repository was archived by the owner on Jun 20, 2018. It is now read-only.

Commit b14c7ab

Browse files
committed
Added Crashlytics support
Moved default prefs to App Added Internet permission for Crashlytics
1 parent b8167a1 commit b14c7ab

5 files changed

Lines changed: 51 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ freeline/
5555
freeline_project_description.json
5656
/.idea/markdown-navigator.xml
5757
/.idea/markdown-navigator/profiles_settings.xml
58+
/app/fabric.properties

app/build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1+
buildscript {
2+
repositories {
3+
maven { url 'https://maven.fabric.io/public' }
4+
}
5+
6+
dependencies {
7+
classpath 'io.fabric.tools:gradle:1.+'
8+
}
9+
}
110
apply plugin: 'com.android.application'
11+
apply plugin: 'io.fabric'
12+
13+
repositories {
14+
maven { url 'https://maven.fabric.io/public' }
15+
}
16+
217

318
android {
419
compileSdkVersion 25
@@ -17,6 +32,7 @@ android {
1732
minifyEnabled true
1833
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1934

35+
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
2036
ext.enableCrashlytics = true
2137
}
2238

@@ -25,6 +41,7 @@ android {
2541
versionNameSuffix "-build-" + getDate()
2642
minifyEnabled false
2743

44+
buildConfigField "boolean", "USE_CRASHLYTICS", "false"
2845
ext.enableCrashlytics = false
2946
}
3047

@@ -48,4 +65,7 @@ dependencies {
4865
compile fileTree(dir: 'libs', include: ['*.jar'])
4966
compile "com.android.support:appcompat-v7:$supportLibVersion"
5067
compile "com.android.support:design:$supportLibVersion"
68+
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
69+
transitive = true;
70+
}
5171
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="ca.mudar.rotationquicksetting">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
56
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
67

78
<application
9+
android:name=".RotationQSApp"
810
android:allowBackup="true"
911
android:icon="@mipmap/ic_launcher"
1012
android:label="@string/app_name"
@@ -39,4 +41,4 @@
3941
</service>
4042
</application>
4143

42-
</manifest>
44+
</manifest>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package ca.mudar.rotationquicksetting;
2+
3+
import android.app.Application;
4+
5+
import com.crashlytics.android.Crashlytics;
6+
7+
import ca.mudar.rotationquicksetting.data.UserPrefs;
8+
import io.fabric.sdk.android.Fabric;
9+
10+
/**
11+
* Created by mudar on 22/05/17.
12+
*/
13+
14+
public class RotationQSApp extends Application {
15+
@Override
16+
public void onCreate() {
17+
super.onCreate();
18+
19+
if (BuildConfig.USE_CRASHLYTICS) {
20+
Fabric.with(this, new Crashlytics());
21+
}
22+
23+
UserPrefs.setDefaults(this);
24+
25+
}
26+
27+
}

app/src/main/java/ca/mudar/rotationquicksetting/ui/MainActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ protected void onCreate(Bundle savedInstanceState) {
2121

2222
showOnboardingIfNecessary();
2323

24-
// Set default preferences
25-
UserPrefs.setDefaults(getApplicationContext());
26-
2724
if (savedInstanceState == null) {
2825
final Fragment fragment = SettingsFragment.newInstance();
2926
getFragmentManager().beginTransaction()

0 commit comments

Comments
 (0)