Quellcode durchsuchen

added crashlytics; fixed add shortcut

tags/0.0.6
Robin Thoni vor 9 Jahren
Ursprung
Commit
69936949de

+ 19
- 1
app/build.gradle Datei anzeigen

@@ -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
+}
1 10
 apply plugin: 'com.android.application'
11
+apply plugin: 'io.fabric'
12
+
13
+repositories {
14
+    maven { url 'https://maven.fabric.io/public' }
15
+}
16
+
2 17
 
3 18
 android {
4 19
     compileSdkVersion 22
@@ -9,7 +24,7 @@ android {
9 24
         minSdkVersion 14
10 25
         targetSdkVersion 22
11 26
         versionCode 1
12
-        versionName "1.0"
27
+        versionName "0.1"
13 28
     }
14 29
     buildTypes {
15 30
         release {
@@ -26,4 +41,7 @@ dependencies {
26 41
     compile 'com.android.support:design:22.2.1'
27 42
     compile project(':luticateauth')
28 43
     compile project(':luticateutils')
44
+    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
45
+        transitive = true;
46
+    }
29 47
 }

+ 3
- 0
app/fabric.properties Datei anzeigen

@@ -0,0 +1,3 @@
1
+#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public.
2
+#Mon Dec 14 14:31:41 CET 2015
3
+apiSecret=71c666a848cbc681b75cb5f752d99f14ba72dc750df64d7fcd297346ba7d19c8

+ 4
- 0
app/src/main/AndroidManifest.xml Datei anzeigen

@@ -7,6 +7,7 @@
7 7
     <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
8 8
     <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
9 9
     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
10
+    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
10 11
 
11 12
     <application
12 13
         android:allowBackup="true"
@@ -69,6 +70,9 @@
69 70
                 <action android:name="android.intent.action.MAIN"/>
70 71
             </intent-filter>
71 72
         </activity>
73
+        <meta-data
74
+            android:name="io.fabric.ApiKey"
75
+            android:value="14e66de5fb5aa5919032a19ebb8a160f0bc393a8" />
72 76
     </application>
73 77
 
74 78
 </manifest>

+ 3
- 2
app/src/main/java/com/rthoni/camotion/ui/AddCommandShortcutActivity.java Datei anzeigen

@@ -78,11 +78,12 @@ public class AddCommandShortcutActivity extends Activity {
78 78
         shortcutIntent.putExtra("COMMAND", command.toString());
79 79
         Intent.ShortcutIconResource iconResource = Intent.ShortcutIconResource.fromContext(this, R.mipmap.ic_command_bg);
80 80
 
81
-        Intent intent = new Intent();
81
+        Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
82 82
         intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
83 83
         intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, command.getName());
84 84
         intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
85
-        setResult(RESULT_OK, intent);
85
+
86
+        sendBroadcast(intent);
86 87
         finish();
87 88
     }
88 89
 }

+ 3
- 0
app/src/main/java/com/rthoni/camotion/ui/MainActivity.java Datei anzeigen

@@ -16,6 +16,7 @@ import android.view.SubMenu;
16 16
 import android.widget.TextView;
17 17
 import android.widget.Toast;
18 18
 
19
+import com.crashlytics.android.Crashlytics;
19 20
 import com.luticate.auth.dbo.LuFullLoginDbo;
20 21
 import com.luticate.utils.business.LuPromise;
21 22
 import com.luticate.utils.business.LuRequest;
@@ -28,6 +29,7 @@ import com.rthoni.camotion.ui.fragments.CamotionFragment;
28 29
 import com.rthoni.camotion.ui.fragments.CommandsFragment;
29 30
 import com.rthoni.camotion.ui.fragments.SensorsFragment;
30 31
 
32
+import io.fabric.sdk.android.Fabric;
31 33
 import java.util.List;
32 34
 
33 35
 public class MainActivity extends AppCompatActivity
@@ -45,6 +47,7 @@ public class MainActivity extends AppCompatActivity
45 47
     @Override
46 48
     protected void onCreate(Bundle savedInstanceState) {
47 49
         super.onCreate(savedInstanceState);
50
+        Fabric.with(this, new Crashlytics());
48 51
         LuRequest.init(this);
49 52
         setContentView(R.layout.activity_main);
50 53
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);

+ 2
- 2
app/src/main/java/com/rthoni/camotion/ui/dialogs/CommandExecDialog.java Datei anzeigen

@@ -44,7 +44,7 @@ public abstract class CommandExecDialog {
44 44
         CommandsBusiness.exec(config, command).then(new LuPromise.LuConsumer<LuVoidDbo>() {
45 45
             @Override
46 46
             public void execute(LuVoidDbo data) {
47
-                dlg.hide();
47
+                dlg.dismiss();
48 48
                 showEndDialog(context, context.getString(R.string.command_success, command.getName()))
49 49
                     .then(new LuPromise.LuConsumer<Boolean>() {
50 50
                         @Override
@@ -56,7 +56,7 @@ public abstract class CommandExecDialog {
56 56
         }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
57 57
             @Override
58 58
             public void execute(final LuPromise.LuPromiseError error) {
59
-                dlg.hide();
59
+                dlg.dismiss();
60 60
                 showEndDialog(context, context.getString(R.string.error, error.toString()))
61 61
                         .then(new LuPromise.LuConsumer<Boolean>() {
62 62
                             @Override

+ 4
- 4
app/src/main/java/com/rthoni/camotion/ui/dialogs/LoginDialog.java Datei anzeigen

@@ -33,13 +33,13 @@ public class LoginDialog extends ProgressDialog {
33 33
                 .then(new LuPromise.LuConsumer<LuLoginDbo>() {
34 34
                     @Override
35 35
                     public void execute(LuLoginDbo data) {
36
-                        hide();
36
+                        dismiss();
37 37
                         promise.resolve(data);
38 38
                     }
39 39
                 }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
40 40
                     @Override
41 41
                     public void execute(LuPromise.LuPromiseError data) {
42
-                        hide();
42
+                        dismiss();
43 43
                         promise.reject(data);
44 44
                     }
45 45
                 });
@@ -62,7 +62,7 @@ public class LoginDialog extends ProgressDialog {
62 62
                                         LuFullLoginDbo dbo = new LuFullLoginDbo();
63 63
                                         dbo.setPermissions(permissions.getData());
64 64
                                         dbo.setLoginDbo(loginDbo);
65
-                                        hide();
65
+                                        dismiss();
66 66
                                         promise.resolve(dbo);
67 67
                                     }
68 68
                                 });
@@ -70,7 +70,7 @@ public class LoginDialog extends ProgressDialog {
70 70
                 }, new LuPromise.LuConsumer<LuPromise.LuPromiseError>() {
71 71
                     @Override
72 72
                     public void execute(LuPromise.LuPromiseError data) {
73
-                        hide();
73
+                        dismiss();
74 74
                         promise.reject(data);
75 75
                     }
76 76
                 });

Laden…
Abbrechen
Speichern