Browse Source

fixed command exec data binding; cleaned imports

tags/0.0.5
Robin Thoni 9 years ago
parent
commit
5d2b00bf41

BIN
app/app-release.apk View File


+ 0
- 1
app/src/main/java/com/rthoni/camotion/business/CamotionAccountBusiness.java View File

10
 import android.content.Intent;
10
 import android.content.Intent;
11
 import android.os.Bundle;
11
 import android.os.Bundle;
12
 import android.os.IBinder;
12
 import android.os.IBinder;
13
-import android.util.Log;
14
 
13
 
15
 import com.rthoni.camotion.ui.AddAccountActivity;
14
 import com.rthoni.camotion.ui.AddAccountActivity;
16
 
15
 

+ 3
- 10
app/src/main/java/com/rthoni/camotion/business/CommandsBusiness.java View File

1
 package com.rthoni.camotion.business;
1
 package com.rthoni.camotion.business;
2
 
2
 
3
-import android.graphics.Bitmap;
4
-import android.graphics.BitmapFactory;
5
-import android.util.Base64;
6
-
7
 import com.luticate.utils.business.LuBusinessManager;
3
 import com.luticate.utils.business.LuBusinessManager;
8
 import com.luticate.utils.business.LuPromise;
4
 import com.luticate.utils.business.LuPromise;
9
-import com.luticate.utils.dbo.LuBoolDbo;
10
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
5
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
11
-import com.rthoni.camotion.dataaccess.CamerasDataAccess;
6
+import com.luticate.utils.dbo.LuVoidDbo;
12
 import com.rthoni.camotion.dataaccess.CommandsDataAccess;
7
 import com.rthoni.camotion.dataaccess.CommandsDataAccess;
13
-import com.rthoni.camotion.dbo.CameraDbo;
14
-import com.rthoni.camotion.dbo.CameraImageDbo;
15
 import com.rthoni.camotion.dbo.CommandDbo;
8
 import com.rthoni.camotion.dbo.CommandDbo;
16
 
9
 
17
 /**
10
 /**
23
         return CommandsDataAccess.getAll(config, page, perPage);
16
         return CommandsDataAccess.getAll(config, page, perPage);
24
     }
17
     }
25
 
18
 
26
-    public static LuPromise<LuBoolDbo> exec(LuDataAccessConfigDbo config, int commandId)
19
+    public static LuPromise<LuVoidDbo> exec(LuDataAccessConfigDbo config, int commandId)
27
     {
20
     {
28
         return CommandsDataAccess.exec(config, commandId);
21
         return CommandsDataAccess.exec(config, commandId);
29
     }
22
     }
30
 
23
 
31
-    public static LuPromise<LuBoolDbo> exec(LuDataAccessConfigDbo config, CommandDbo command)
24
+    public static LuPromise<LuVoidDbo> exec(LuDataAccessConfigDbo config, CommandDbo command)
32
     {
25
     {
33
         return exec(config, command.getId());
26
         return exec(config, command.getId());
34
     }
27
     }

+ 3
- 5
app/src/main/java/com/rthoni/camotion/dataaccess/CommandsDataAccess.java View File

3
 import com.luticate.utils.business.LuPromise;
3
 import com.luticate.utils.business.LuPromise;
4
 import com.luticate.utils.business.LuRequest;
4
 import com.luticate.utils.business.LuRequest;
5
 import com.luticate.utils.dataaccess.LuDataAccess;
5
 import com.luticate.utils.dataaccess.LuDataAccess;
6
-import com.luticate.utils.dbo.LuBoolDbo;
7
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
6
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
7
+import com.luticate.utils.dbo.LuVoidDbo;
8
 import com.rthoni.camotion.dbo.CommandDbo;
8
 import com.rthoni.camotion.dbo.CommandDbo;
9
-import com.rthoni.camotion.dbo.SensorDbo;
10
-import com.rthoni.camotion.dbo.SensorValueDbo;
11
 
9
 
12
 import java.util.HashMap;
10
 import java.util.HashMap;
13
 
11
 
24
         return LuRequest.get(config, CommandDbo.MultipleCommandDbo.class, "/api/commands", params);
22
         return LuRequest.get(config, CommandDbo.MultipleCommandDbo.class, "/api/commands", params);
25
     }
23
     }
26
 
24
 
27
-    public static LuPromise<LuBoolDbo> exec(LuDataAccessConfigDbo config, int id)
25
+    public static LuPromise<LuVoidDbo> exec(LuDataAccessConfigDbo config, int id)
28
     {
26
     {
29
-        return LuRequest.post(config, LuBoolDbo.class, "/api/commands/" + id + "/exec");
27
+        return LuRequest.post(config, LuVoidDbo.class, "/api/commands/" + id + "/exec");
30
     }
28
     }
31
 }
29
 }

+ 0
- 1
app/src/main/java/com/rthoni/camotion/dbo/LocationDbo.java View File

1
 package com.rthoni.camotion.dbo;
1
 package com.rthoni.camotion.dbo;
2
 
2
 
3
-import com.luticate.auth.dbo.LuFullLoginDbo;
4
 import com.luticate.auth.dbo.LuLoginDbo;
3
 import com.luticate.auth.dbo.LuLoginDbo;
5
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
4
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
6
 import com.luticate.utils.dbo.LuDbo;
5
 import com.luticate.utils.dbo.LuDbo;

+ 0
- 1
app/src/main/java/com/rthoni/camotion/ui/AddCommandShortcutActivity.java View File

6
 import android.widget.Toast;
6
 import android.widget.Toast;
7
 
7
 
8
 import com.luticate.auth.dbo.LuFullLoginDbo;
8
 import com.luticate.auth.dbo.LuFullLoginDbo;
9
-import com.luticate.auth.dbo.LuLoginDbo;
10
 import com.luticate.utils.business.LuPromise;
9
 import com.luticate.utils.business.LuPromise;
11
 import com.luticate.utils.business.LuRequest;
10
 import com.luticate.utils.business.LuRequest;
12
 import com.rthoni.camotion.R;
11
 import com.rthoni.camotion.R;

+ 0
- 2
app/src/main/java/com/rthoni/camotion/ui/CommandExecActivity.java View File

6
 import android.support.v7.app.AlertDialog;
6
 import android.support.v7.app.AlertDialog;
7
 import android.widget.Toast;
7
 import android.widget.Toast;
8
 
8
 
9
-import com.luticate.auth.dbo.LuFullLoginDbo;
10
 import com.luticate.auth.dbo.LuLoginDbo;
9
 import com.luticate.auth.dbo.LuLoginDbo;
11
 import com.luticate.utils.business.LuPromise;
10
 import com.luticate.utils.business.LuPromise;
12
 import com.rthoni.camotion.R;
11
 import com.rthoni.camotion.R;
16
 import com.rthoni.camotion.ui.dialogs.CommandExecDialog;
15
 import com.rthoni.camotion.ui.dialogs.CommandExecDialog;
17
 import com.rthoni.camotion.ui.dialogs.LoginDialog;
16
 import com.rthoni.camotion.ui.dialogs.LoginDialog;
18
 
17
 
19
-import org.json.JSONException;
20
 import org.json.JSONObject;
18
 import org.json.JSONObject;
21
 
19
 
22
 import java.util.List;
20
 import java.util.List;

+ 0
- 1
app/src/main/java/com/rthoni/camotion/ui/MainActivity.java View File

26
 import com.rthoni.camotion.ui.fragments.CamerasFragment;
26
 import com.rthoni.camotion.ui.fragments.CamerasFragment;
27
 import com.rthoni.camotion.ui.fragments.CamotionFragment;
27
 import com.rthoni.camotion.ui.fragments.CamotionFragment;
28
 import com.rthoni.camotion.ui.fragments.CommandsFragment;
28
 import com.rthoni.camotion.ui.fragments.CommandsFragment;
29
-import com.rthoni.camotion.ui.fragments.DefaultFragment;
30
 import com.rthoni.camotion.ui.fragments.SensorsFragment;
29
 import com.rthoni.camotion.ui.fragments.SensorsFragment;
31
 
30
 
32
 import java.util.List;
31
 import java.util.List;

+ 3
- 10
app/src/main/java/com/rthoni/camotion/ui/dialogs/CommandExecDialog.java View File

1
 package com.rthoni.camotion.ui.dialogs;
1
 package com.rthoni.camotion.ui.dialogs;
2
 
2
 
3
-import android.app.Dialog;
4
 import android.app.ProgressDialog;
3
 import android.app.ProgressDialog;
5
 import android.content.Context;
4
 import android.content.Context;
6
 import android.content.DialogInterface;
5
 import android.content.DialogInterface;
7
 import android.support.v7.app.AlertDialog;
6
 import android.support.v7.app.AlertDialog;
8
 
7
 
9
-import com.luticate.auth.business.LuticatePermissionsBusiness;
10
-import com.luticate.auth.business.LuticateUsersBusiness;
11
-import com.luticate.auth.dbo.LuFullLoginDbo;
12
-import com.luticate.auth.dbo.LuLoginDbo;
13
-import com.luticate.auth.dbo.LuPermissionDbo;
14
 import com.luticate.utils.business.LuPromise;
8
 import com.luticate.utils.business.LuPromise;
15
-import com.luticate.utils.dbo.LuBoolDbo;
16
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
9
 import com.luticate.utils.dbo.LuDataAccessConfigDbo;
10
+import com.luticate.utils.dbo.LuVoidDbo;
17
 import com.rthoni.camotion.R;
11
 import com.rthoni.camotion.R;
18
 import com.rthoni.camotion.business.CommandsBusiness;
12
 import com.rthoni.camotion.business.CommandsBusiness;
19
 import com.rthoni.camotion.dbo.CommandDbo;
13
 import com.rthoni.camotion.dbo.CommandDbo;
20
-import com.rthoni.camotion.dbo.LocationDbo;
21
 
14
 
22
 /**
15
 /**
23
  *
16
  *
48
         dlg.setMessage(context.getString(R.string.command_loading, command.getName()));
41
         dlg.setMessage(context.getString(R.string.command_loading, command.getName()));
49
         dlg.setCancelable(false);
42
         dlg.setCancelable(false);
50
         dlg.show();
43
         dlg.show();
51
-        CommandsBusiness.exec(config, command).then(new LuPromise.LuConsumer<LuBoolDbo>() {
44
+        CommandsBusiness.exec(config, command).then(new LuPromise.LuConsumer<LuVoidDbo>() {
52
             @Override
45
             @Override
53
-            public void execute(LuBoolDbo data) {
46
+            public void execute(LuVoidDbo data) {
54
                 dlg.hide();
47
                 dlg.hide();
55
                 showEndDialog(context, context.getString(R.string.command_success, command.getName()))
48
                 showEndDialog(context, context.getString(R.string.command_success, command.getName()))
56
                     .then(new LuPromise.LuConsumer<Boolean>() {
49
                     .then(new LuPromise.LuConsumer<Boolean>() {

+ 0
- 3
app/src/main/java/com/rthoni/camotion/ui/fragments/SensorsFragment.java View File

2
 
2
 
3
 import com.luticate.utils.business.LuPromise;
3
 import com.luticate.utils.business.LuPromise;
4
 import com.luticate.utils.dbo.LuMultipleDbo;
4
 import com.luticate.utils.dbo.LuMultipleDbo;
5
-import com.rthoni.camotion.business.CamerasBusiness;
6
 import com.rthoni.camotion.business.SensorsBusiness;
5
 import com.rthoni.camotion.business.SensorsBusiness;
7
-import com.rthoni.camotion.dbo.CameraDbo;
8
 import com.rthoni.camotion.dbo.SensorDbo;
6
 import com.rthoni.camotion.dbo.SensorDbo;
9
-import com.rthoni.camotion.ui.views.CameraView;
10
 import com.rthoni.camotion.ui.views.SensorView;
7
 import com.rthoni.camotion.ui.views.SensorView;
11
 
8
 
12
 /**
9
 /**

+ 0
- 1
app/src/main/java/com/rthoni/camotion/ui/views/CommandView.java View File

11
 import com.rthoni.camotion.R;
11
 import com.rthoni.camotion.R;
12
 import com.rthoni.camotion.dbo.CommandDbo;
12
 import com.rthoni.camotion.dbo.CommandDbo;
13
 import com.rthoni.camotion.dbo.LocationDbo;
13
 import com.rthoni.camotion.dbo.LocationDbo;
14
-import com.rthoni.camotion.ui.dialogs.CommandExecDialog;
15
 
14
 
16
 /**
15
 /**
17
  * Created by robin on 12/10/15.
16
  * Created by robin on 12/10/15.

+ 0
- 5
app/src/main/java/com/rthoni/camotion/ui/views/SensorView.java View File

1
 package com.rthoni.camotion.ui.views;
1
 package com.rthoni.camotion.ui.views;
2
 
2
 
3
 import android.content.Context;
3
 import android.content.Context;
4
-import android.graphics.Bitmap;
5
 import android.os.Handler;
4
 import android.os.Handler;
6
 import android.util.AttributeSet;
5
 import android.util.AttributeSet;
7
-import android.view.View;
8
-import android.widget.ImageView;
9
 import android.widget.RelativeLayout;
6
 import android.widget.RelativeLayout;
10
 import android.widget.TextView;
7
 import android.widget.TextView;
11
 
8
 
12
 import com.luticate.auth.dbo.LuFullLoginDbo;
9
 import com.luticate.auth.dbo.LuFullLoginDbo;
13
 import com.luticate.utils.business.LuPromise;
10
 import com.luticate.utils.business.LuPromise;
14
 import com.rthoni.camotion.R;
11
 import com.rthoni.camotion.R;
15
-import com.rthoni.camotion.business.CamerasBusiness;
16
 import com.rthoni.camotion.business.SensorsBusiness;
12
 import com.rthoni.camotion.business.SensorsBusiness;
17
-import com.rthoni.camotion.dbo.CameraDbo;
18
 import com.rthoni.camotion.dbo.LocationDbo;
13
 import com.rthoni.camotion.dbo.LocationDbo;
19
 import com.rthoni.camotion.dbo.SensorDbo;
14
 import com.rthoni.camotion.dbo.SensorDbo;
20
 import com.rthoni.camotion.dbo.SensorValueDbo;
15
 import com.rthoni.camotion.dbo.SensorValueDbo;

Loading…
Cancel
Save