|
|
@ -27,6 +27,7 @@ import com.todoroo.astrid.data.RemoteModel;
|
|
|
|
import com.todoroo.astrid.data.Task;
|
|
|
|
import com.todoroo.astrid.data.Task;
|
|
|
|
import com.todoroo.astrid.data.UserActivity;
|
|
|
|
import com.todoroo.astrid.data.UserActivity;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.tasks.R;
|
|
|
|
import org.tasks.R;
|
|
|
|
import org.tasks.activities.CameraActivity;
|
|
|
|
import org.tasks.activities.CameraActivity;
|
|
|
@ -46,6 +47,7 @@ import butterknife.ButterKnife;
|
|
|
|
import butterknife.OnClick;
|
|
|
|
import butterknife.OnClick;
|
|
|
|
import butterknife.OnEditorAction;
|
|
|
|
import butterknife.OnEditorAction;
|
|
|
|
import butterknife.OnTextChanged;
|
|
|
|
import butterknife.OnTextChanged;
|
|
|
|
|
|
|
|
import timber.log.Timber;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.tasks.files.FileHelper.getPathFromUri;
|
|
|
|
import static org.tasks.files.FileHelper.getPathFromUri;
|
|
|
|
import static org.tasks.files.ImageHelper.sampleBitmap;
|
|
|
|
import static org.tasks.files.ImageHelper.sampleBitmap;
|
|
|
@ -221,7 +223,7 @@ public class CommentBarFragment extends TaskEditControlFragment {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String picture = null;
|
|
|
|
String picture = null;
|
|
|
|
if (pendingCommentPicture != null) {
|
|
|
|
if (pendingCommentPicture != null) {
|
|
|
|
JSONObject pictureJson = RemoteModel.PictureHelper.savePictureJson(pendingCommentPicture);
|
|
|
|
JSONObject pictureJson = savePictureJson(pendingCommentPicture);
|
|
|
|
if (pictureJson != null) {
|
|
|
|
if (pictureJson != null) {
|
|
|
|
picture = pictureJson.toString();
|
|
|
|
picture = pictureJson.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -236,6 +238,17 @@ public class CommentBarFragment extends TaskEditControlFragment {
|
|
|
|
callback.addComment(message, actionCode, picture);
|
|
|
|
callback.addComment(message, actionCode, picture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static JSONObject savePictureJson(final Uri uri) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
|
|
|
json.put("uri", uri.toString());
|
|
|
|
|
|
|
|
return json;
|
|
|
|
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
|
|
|
Timber.e(e, e.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void resetPictureButton() {
|
|
|
|
private void resetPictureButton() {
|
|
|
|
TypedValue typedValue = new TypedValue();
|
|
|
|
TypedValue typedValue = new TypedValue();
|
|
|
|
getActivity().getTheme().resolveAttribute(R.attr.actionBarPrimaryText, typedValue, true);
|
|
|
|
getActivity().getTheme().resolveAttribute(R.attr.actionBarPrimaryText, typedValue, true);
|
|
|
|