reworked a whole bunch of stuff

moved from assistant to one single activity model with dialogs and navigation drawer as main content holder
completed separate threaded queue based service to communicate with daemon(s)
added first few elements to the nav drawer
This commit is contained in:
Giovanni Harting
2015-09-01 05:56:48 +02:00
parent ab8b864bee
commit aaa9c5da02
51 changed files with 677 additions and 2037 deletions

View File

@@ -0,0 +1,35 @@
package com.idlegandalf.ledd.components;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.UUID;
import lombok.Getter;
@Getter
public class Sendable {
private Host recipient;
private JSONObject message;
private String ref;
private AnswerTask onAnswer;
public Sendable(JSONObject msg, AnswerTask task, Host host) throws JSONException {
this(msg, UUID.randomUUID().toString(), task, host);
}
public Sendable(JSONObject msg, String ref, AnswerTask task, Host recipient) throws JSONException {
this.message = msg;
this.ref = ref;
this.message.put("ref", ref);
this.onAnswer = task;
this.recipient = recipient;
}
public void onResponse(JSONObject object) {
if (onAnswer != null) {
onAnswer.response = object;
onAnswer.run();
}
}
}