@@ -158,6 +158,17 @@ public boolean saveComments(Context context) {

return false;
}

// Save checkins into database
public boolean saveCheckinsComments(Context context) {
List<Comment> comments = getCheckinCommentsList(context);
if (comments != null) {

return Database.mCommentDao.addComment(comments);
}

return false;
}

private void log(String message) {
if (MainApplication.LOGGING_MODE)
@@ -19,13 +19,12 @@
**/
package com.ushahidi.android.app.views;

import com.ushahidi.android.app.R;

import android.app.Activity;
import android.app.ProgressDialog;
import android.widget.EditText;
import android.widget.TextView;

import com.ushahidi.android.app.R;

/**
* @author eyedol
*
@@ -38,7 +37,7 @@ public class AddCommentView extends View {
public EditText fullName;
public EditText emailAddress;
public EditText comment;
public ProgressDialog dialog;


/**
* @param activity
@@ -53,12 +52,8 @@ public AddCommentView(Activity activity) {
emailAddress = (EditText) activity.findViewById(R.id.comment_email);
commentLbl = (TextView) activity.findViewById(R.id.comment_message);
comment = (EditText) activity.findViewById(R.id.comment_message);
this.dialog = new ProgressDialog(activity);
this.dialog.setCancelable(true);
this.dialog.setIndeterminate(true);
this.dialog.setMessage(activity.getResources().getString(
R.string.uploading));

}

}
@@ -23,7 +23,10 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

import com.ushahidi.android.app.R;

import android.app.Activity;
import android.app.ProgressDialog;
import android.util.Log;

/**
@@ -33,6 +36,8 @@
* annotation
*/
public abstract class View {

public ProgressDialog dialog;

/**
* View Map View
@@ -41,6 +46,12 @@ public abstract class View {
* Activity
*/
public View(Activity activity) {
this.dialog = new ProgressDialog(activity);
this.dialog.setCancelable(true);
this.dialog.setIndeterminate(true);
this.dialog.setMessage(activity.getResources().getString(
R.string.uploading));

for (Class<?> clazz : new Class[] { getClass(),
getClass().getSuperclass() }) {
if (clazz != null && View.class.isAssignableFrom(clazz)) {
@@ -75,6 +86,7 @@ public View(Activity activity) {
* View
*/
public View(android.view.View view) {

for (Class<?> clazz : new Class[] { getClass(),
getClass().getSuperclass() }) {
if (clazz != null && View.class.isAssignableFrom(clazz)) {
@@ -105,6 +105,8 @@ public ViewReportView(Activity activity) {
newsAdapter = new ListNewsAdapter(activity);
videoAdapter = new ListVideoAdapter(activity);
commentAdapter = new ListCommentAdapter(activity);
this.dialog.setMessage(activity.getResources().getString(
R.string.please_wait));
listNewsEmptyView = (TextView) activity
.findViewById(R.id.empty_list_for_news);
if (listNewsEmptyView != null) {
@@ -132,6 +134,7 @@ public ViewReportView(Activity activity) {
if (listCommentEmptyView != null) {
listComments.setEmptyView(listCommentEmptyView);
}


}

@@ -345,6 +345,8 @@

<!-- Services -->
<service android:name=".services.UploadCheckins" />
<service android:name=".services.FetchCheckinsComments"/>
<service android:name=".services.FetchReportsComments"/>
<service android:name=".services.UploadComments" />
<service android:name=".services.FetchReports" />
<service android:name=".services.FetchCheckins" />