diff --git a/smssync/src/main/java/org/addhen/smssync/activities/BaseActivity.java b/smssync/src/main/java/org/addhen/smssync/activities/BaseActivity.java index 88324353a..8c065fec4 100644 --- a/smssync/src/main/java/org/addhen/smssync/activities/BaseActivity.java +++ b/smssync/src/main/java/org/addhen/smssync/activities/BaseActivity.java @@ -55,6 +55,9 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; +import java.util.ArrayList; +import java.util.List; + /** * BaseActivity Add shared functionality that exists between all Activities */ @@ -75,6 +78,13 @@ public abstract class BaseActivity extends SherlockFragmentActiv */ protected final Class viewClass; + protected final int drawerLayoutId; + + /** + * ListView resource id + */ + protected final int listViewId; + /** * View */ @@ -86,27 +96,21 @@ public abstract class BaseActivity extends SherlockFragmentActiv protected ActionBarDrawerToggle drawerToggle; - protected final int drawerLayoutId; - protected DrawerLayout drawerLayout; protected ListView listView; - /** - * ListView resource id - */ - protected final int listViewId; - /** * BaseActivity - * - * @param view View class - * @param layout layout resource id - * @param menu menu resource id + * + * @param view View class + * @param layout layout resource id + * @param menu menu resource id * @param drawerLayoutId resource id for the drawerLayout - * @param listViewId the resource id for the list view + * @param listViewId the resource id for the list view */ - protected BaseActivity(Class view, int layout, int menu, int drawerLayoutId, int listViewId) { + protected BaseActivity(Class view, int layout, int menu, int drawerLayoutId, + int listViewId) { this.viewClass = view; this.layout = layout; @@ -117,10 +121,10 @@ protected BaseActivity(Class view, int layout, int menu, int drawerLayoutId, /** * BaseActivity - * - * @param view View class + * + * @param view View class * @param layout layout resource id - * @param menu menu resource id + * @param menu menu resource id */ protected BaseActivity(Class view, int layout, int menu) { this(view, layout, menu, 0, 0); @@ -136,11 +140,13 @@ public void onCreate(Bundle savedInstanceState) { setContentView(layout); } - if (drawerLayoutId != 0) + if (drawerLayoutId != 0) { drawerLayout = (DrawerLayout) findViewById(drawerLayoutId); + } - if (listViewId != 0) + if (listViewId != 0) { listView = (ListView) findViewById(listViewId); + } view = Objects.createInstance(viewClass, Activity.class, this); @@ -233,7 +239,7 @@ public boolean onOptionsItemSelected(MenuItem item) { } else { drawerLayout.openDrawer(listView); } - + } else { finish(); } @@ -254,18 +260,7 @@ public void openActivityOrFragment(Intent intent) { protected void createNavDrawer() { navDrawerAdapter = new NavDrawerAdapter(this); - new LoadingStatusTask(this).execute((String)null); - - } - - private class NavDrawerItemClickListener implements ListView.OnItemClickListener { - - @Override - public void onItemClick(AdapterView parent, android.view.View view, int position, long id) { - selectItem(position); - view.getFocusables(position); - view.setSelected(true); - } + new NavDrawerItemTask(this).execute((String) null); } @@ -315,50 +310,25 @@ public void onDrawerOpened(android.view.View drawerView) { } /** - * When using the ActionBarDrawerToggle, you must call it during - * onPostCreate() and onConfigurationChanged()... + * When using the ActionBarDrawerToggle, you must call it during onPostCreate() and + * onConfigurationChanged()... */ @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. - if (drawerToggle != null) + if (drawerToggle != null) { drawerToggle.syncState(); + } } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Pass any configuration change to the drawer toggls - if (drawerToggle != null) + if (drawerToggle != null) { drawerToggle.onConfigurationChanged(newConfig); - } - - private class LoadingStatusTask extends ProgressTask { - - protected LoadingStatusTask(Activity activity) { - super(activity); - } - - @Override - protected void onPreExecute() { - super.onPreExecute(); - dialog.cancel(); - } - - @Override - protected Boolean doInBackground(String... strings) { - // load all checked syncurl - navDrawerAdapter.refresh(); - return true; - } - - @Override - protected void onPostExecute(Boolean success) { - super.onPostExecute(success); - initNavDrawer(); - selectItem(0); } } @@ -438,4 +408,71 @@ protected void toastShort(CharSequence message) { Toast.makeText(this, message.toString(), Toast.LENGTH_SHORT).show(); } + private class NavDrawerItemClickListener implements ListView.OnItemClickListener { + + @Override + public void onItemClick(AdapterView parent, android.view.View view, int position, + long id) { + selectItem(position); + view.getFocusables(position); + view.setSelected(true); + } + + } + + private class NavDrawerItemTask extends ProgressTask { + + PendingMessagesNavDrawerItem pendingMessagesNavDrawerItem; + + SentMessagesNavDrawerItem sentMessagesNavDrawerItem; + + SyncUrlNavDrawerItem syncUrlNavDrawerItem; + + List navDrawerItem; + + protected NavDrawerItemTask(Activity activity) { + super(activity); + pendingMessagesNavDrawerItem + = new PendingMessagesNavDrawerItem( + getString(R.string.pending_messages), + R.drawable.pending, BaseActivity.this); + + sentMessagesNavDrawerItem = new SentMessagesNavDrawerItem( + getString(R.string.sent_messages), + R.drawable.sent, BaseActivity.this); + syncUrlNavDrawerItem = new SyncUrlNavDrawerItem(getString( + R.string.sync_url), + R.drawable.sync_url, BaseActivity.this); + navDrawerItem = new ArrayList(); + + } + + @Override + protected void onPreExecute() { + super.onPreExecute(); + dialog.cancel(); + } + + @Override + protected Boolean doInBackground(String... strings) { + // load all checked syncurl + sentMessagesNavDrawerItem.setCounter(); + pendingMessagesNavDrawerItem.setCounter(); + syncUrlNavDrawerItem.setCounter(); + navDrawerItem.add(pendingMessagesNavDrawerItem); + navDrawerItem.add(sentMessagesNavDrawerItem); + navDrawerItem.add(syncUrlNavDrawerItem); + + return true; + } + + @Override + protected void onPostExecute(Boolean success) { + super.onPostExecute(success); + navDrawerAdapter.setItems(navDrawerItem); + initNavDrawer(); + selectItem(0); + } + } + } diff --git a/smssync/src/main/java/org/addhen/smssync/adapters/NavDrawerAdapter.java b/smssync/src/main/java/org/addhen/smssync/adapters/NavDrawerAdapter.java index da24a8e82..45e19531a 100644 --- a/smssync/src/main/java/org/addhen/smssync/adapters/NavDrawerAdapter.java +++ b/smssync/src/main/java/org/addhen/smssync/adapters/NavDrawerAdapter.java @@ -40,14 +40,12 @@ */ public class NavDrawerAdapter extends BaseListAdapter { - private SherlockFragmentActivity mActivity; /** - * @param activity + * @param context */ - public NavDrawerAdapter(SherlockFragmentActivity activity) { - super(activity); - this.mActivity = activity; + public NavDrawerAdapter(Context context) { + super(context); } @Override @@ -84,24 +82,6 @@ public View getView(int position, View convertView, ViewGroup parent) { */ @Override public void refresh() { - PendingMessagesNavDrawerItem pendingMessagesNavDrawerItem - = new PendingMessagesNavDrawerItem( - context.getString(R.string.pending_messages), - R.drawable.pending, mActivity); - pendingMessagesNavDrawerItem.setCounter(); - addItem(pendingMessagesNavDrawerItem); - - SentMessagesNavDrawerItem sentMessagesNavDrawerItem = new SentMessagesNavDrawerItem( - context.getString(R.string.sent_messages), - R.drawable.sent, mActivity); - sentMessagesNavDrawerItem.setCounter(); - addItem(sentMessagesNavDrawerItem); - - SyncUrlNavDrawerItem syncUrlNavDrawerItem = new SyncUrlNavDrawerItem(context.getString( - R.string.sync_url), - R.drawable.sync_url, mActivity); - syncUrlNavDrawerItem.setCounter(); - addItem(syncUrlNavDrawerItem); } private class Widgets { diff --git a/smssync/src/main/java/org/addhen/smssync/database/SyncUrlContentProvider.java b/smssync/src/main/java/org/addhen/smssync/database/SyncUrlContentProvider.java index 6cf53efe4..a5b151bda 100644 --- a/smssync/src/main/java/org/addhen/smssync/database/SyncUrlContentProvider.java +++ b/smssync/src/main/java/org/addhen/smssync/database/SyncUrlContentProvider.java @@ -21,6 +21,7 @@ package org.addhen.smssync.database; import org.addhen.smssync.models.SyncUrl; +import org.addhen.smssync.util.Logger; import org.addhen.smssync.util.Util; import android.content.ContentValues; @@ -48,11 +49,12 @@ public SyncUrlContentProvider(SQLiteDatabase db) { @Override public List fetchSyncUrl() { - mListSyncUrl = new ArrayList(); try { + cursor = super.query(TABLE, COLUMNS, null, null, ID); if (cursor != null) { - cursor = super.query(TABLE, COLUMNS, null, null, ID); + + mListSyncUrl = new ArrayList(); while (cursor.moveToNext()) { SyncUrl syncUrl = cursorToEntity(cursor); mListSyncUrl.add(syncUrl); diff --git a/smssync/src/main/java/org/addhen/smssync/fragments/PendingMessages.java b/smssync/src/main/java/org/addhen/smssync/fragments/PendingMessages.java index 89d0bdb77..249436c30 100644 --- a/smssync/src/main/java/org/addhen/smssync/fragments/PendingMessages.java +++ b/smssync/src/main/java/org/addhen/smssync/fragments/PendingMessages.java @@ -67,53 +67,6 @@ public class PendingMessages private static final String STATE_CHECKED = "org.addhen.smssync.fragments.STATE_CHECKED"; - /** - * Delete individual messages 0 - Successfully deleted. 1 - There is nothing to be deleted. - */ - final Runnable mDeleteMessagesById = new Runnable() { - public void run() { - log("mDeleteMessagesById()"); - getActivity().setProgressBarIndeterminateVisibility(true); - boolean result = false; - - int deleted = 0; - - if (adapter.getCount() == 0) { - deleted = 1; - } else { - log("deletebyId position: " + mSelectedItemsPositions.size()); - for (Integer position : mSelectedItemsPositions) { - model.deleteMessagesByUuid(adapter.getItem(position).getUuid()); - } - result = true; - } - - try { - if (deleted == 1) { - toastLong(R.string.no_messages_to_delete); - } else { - - if (result) { - toastLong(R.string.messages_deleted); - - } else { - toastLong(R.string.messages_deleted_failed); - } - } - - // destory the action mode dialog - multichoiceActionModeListener.activeMode.finish(); - multichoiceActionModeListener.getSelectedItemPositions().clear(); - getActivity().setProgressBarIndeterminateVisibility(false); - refreshListView(); - } catch (Exception e) { - return; - } - } - }; - - private final Handler mHandler; - private Intent syncPendingMessagesServiceIntent; private Message model; @@ -187,7 +140,6 @@ public PendingMessages() { R.layout.list_messages, R.menu.pending_messages_menu, android.R.id.list); log("PendingMessages()"); - mHandler = new Handler(); model = new Message(); } @@ -688,8 +640,10 @@ protected void onPostExecute(Boolean success) { } } adapter.setItems(model.getMessageList()); - multichoiceActionModeListener.activeMode.finish(); - multichoiceActionModeListener.getSelectedItemPositions().clear(); + if (multichoiceActionModeListener.activeMode != null) { + multichoiceActionModeListener.activeMode.finish(); + multichoiceActionModeListener.getSelectedItemPositions().clear(); + } listView.setAdapter(adapter); } } diff --git a/smssync/src/main/java/org/addhen/smssync/fragments/SyncUrlFragment.java b/smssync/src/main/java/org/addhen/smssync/fragments/SyncUrlFragment.java index aa63d424c..c6a7805a4 100644 --- a/smssync/src/main/java/org/addhen/smssync/fragments/SyncUrlFragment.java +++ b/smssync/src/main/java/org/addhen/smssync/fragments/SyncUrlFragment.java @@ -32,6 +32,7 @@ import org.addhen.smssync.services.CheckTaskService; import org.addhen.smssync.services.SyncPendingMessagesService; import org.addhen.smssync.tasks.ProgressTask; +import org.addhen.smssync.tasks.Task; import org.addhen.smssync.util.RunServicesUtil; import org.addhen.smssync.util.ServicesConstants; import org.addhen.smssync.util.Util; @@ -58,12 +59,6 @@ public class SyncUrlFragment extends BaseListFragment implements View.OnClickListener { - private Intent syncPendingMessagesServiceIntent; - - private Intent statusIntent; - - private final Handler mHandler; - private SyncUrl model; private int id = 0; @@ -79,7 +74,6 @@ public class SyncUrlFragment extends public SyncUrlFragment() { super(SyncUrlView.class, SyncUrlAdapter.class, R.layout.list_sync_url, R.menu.sync_url_menu, android.R.id.list); - mHandler = new Handler(); model = new SyncUrl(); } @@ -108,6 +102,7 @@ public void onActivityCreated(Bundle savedInstanceState) { @Override public void onResume() { super.onResume(); + loadSyncUrlInBackground(); } @Override @@ -184,7 +179,7 @@ public void onClick(DialogInterface dialog, int id) { new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // delete all messages - mHandler.post(mDeleteAllMessages); + new DeleteTask(getActivity()).execute((String) null); } }); AlertDialog alert = builder.create(); @@ -193,8 +188,7 @@ public void onClick(DialogInterface dialog, int id) { /** * Validates the Sync URL to be added - * - * @param addSyncUrl + * * @return boolean */ public boolean validateSyncUrlEntry(AddSyncUrl addSyncUrl) { @@ -229,7 +223,9 @@ public void onClick(DialogInterface dialog, int id) { new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // Delete by ID - mHandler.post(mDeleteSyncById); + DeleteTask deleteById = new DeleteTask(getActivity()); + deleteById.deletebyUuid = true; + deleteById.execute((String) null); } }); AlertDialog alert = builder.create(); @@ -238,9 +234,8 @@ public void onClick(DialogInterface dialog, int id) { /** * Show prompt message - * - * @param message The resource string which is the message to show to - * the user. + * + * @param message The resource string which is the message to show to the user. * @return void */ public void showMessage(int message) { @@ -308,19 +303,16 @@ public void onClick(View v) { if (validateSyncUrlEntry(addSyncUrl)) { // edit was selected if (edit) { + AddSyncUrlTask updateTask = new AddSyncUrlTask(getActivity(), + addSyncUrl); + updateTask.editSyncUrl = true; + updateTask.execute((String) null); - if (addSyncUrl.updateSyncUrl(id)) { - loadSyncUrlInBackground(); - } else { - toastLong(R.string.failed_to_update_sync_url); - } } else { // add a new entry - if (addSyncUrl.addSyncUrl()) { - loadSyncUrlInBackground(); - } else { - toastLong(R.string.failed_to_add_sync_url); - } + AddSyncUrlTask addTask = new AddSyncUrlTask(getActivity(), + addSyncUrl); + addTask.execute((String) null); } deploymentDialog.dismiss(); } @@ -332,113 +324,13 @@ public void onClick(View v) { // Display pending messages. public void loadSyncUrlInBackground() { - new LoadingTask(getActivity()).execute(); - } - - /** - * Delete all messages. 0 - Successfully deleted. 1 - There is nothing to be - * deleted. - */ - final Runnable mDeleteAllMessages = new Runnable() { - public void run() { - - boolean result = false; - - int deleted = 0; - - try { - if (adapter.getCount() == 0) { - deleted = 1; - } else { - result = model.deleteAllSyncUrl(); - } - - if (deleted == 1) { - toastLong(R.string.no_sync_url_to_delete); - } else { - if (result) { - - toastLong(R.string.sync_url_deleted); - showSyncUrl(); - } else { - toastLong(R.string.sync_url_deleted_failed); - } - } - - } catch (Exception e) { - return; - } - } - }; - - /** - * Delete individual messages 0 - Successfully deleted. 1 - There is nothing - * to be deleted. - */ - final Runnable mDeleteSyncById = new Runnable() { - public void run() { - - boolean result = false; - - int deleted = 0; - try { - if (adapter.getCount() == 0) { - deleted = 1; - } else { - result = model.deleteSyncUrlById(id); - } - - if (deleted == 1) { - toastLong(R.string.no_sync_url_to_delete); - } else { - if (result) { - - toastLong(R.string.sync_url_deleted); - showSyncUrl(); - } else { - toastLong(R.string.sync_url_deleted_failed); - } - - } - - } catch (Exception e) { - return; - } - } - }; - - /** - * Get sync url from the database. - * - * @return void - */ - public void showSyncUrl() { - - if (adapter != null) { - adapter.refresh(); - } + new LoadingTask(getActivity()).execute((String) null); } public void loadByStatus() { - new LoadingStatusTask(getActivity()).execute(); - } - - - /** - * Get messages from the db and push them to the configured callback URL - * - * @param messagesUuid - * @return int - */ - - public void syncMessages(String messagesUuid) { - statusIntent.putExtra("status", 3); - getActivity().sendBroadcast(statusIntent); - syncPendingMessagesServiceIntent = new Intent(getActivity(), - SyncPendingMessagesService.class); - syncPendingMessagesServiceIntent.putExtra( - ServicesConstants.MESSAGE_UUID, messagesUuid); - getActivity().startService(syncPendingMessagesServiceIntent); + LoadingTask loadingStatusTask = new LoadingTask(getActivity()); + loadingStatusTask.loadSyncUrlByStatus = true; + loadingStatusTask.execute((String) null); } /* @@ -508,9 +400,11 @@ public void onClick(View v) { Prefs.savePreferences(getActivity()); } - private class LoadingStatusTask extends ProgressTask { + private class LoadingTask extends ProgressTask { + + protected boolean loadSyncUrlByStatus = false; - protected LoadingStatusTask(Activity activity) { + public LoadingTask(Activity activity) { super(activity); } @@ -518,48 +412,123 @@ protected LoadingStatusTask(Activity activity) { protected void onPreExecute() { super.onPreExecute(); dialog.cancel(); + view.emptyView.setVisibility(android.view.View.GONE); } @Override - protected Boolean doInBackground(String... strings) { - // load all checked syncurl - syncUrl = model.loadByStatus(1); - return true; + protected Boolean doInBackground(String... args) { + if (loadSyncUrlByStatus) { + syncUrl = model.loadByStatus(1); + return true; + } else { + return model.load(); + } } @Override protected void onPostExecute(Boolean success) { super.onPostExecute(success); + if (success) { + view.listLoadingProgress.setVisibility(android.view.View.GONE); + view.emptyView.setVisibility(View.VISIBLE); + adapter.setItems(model.getSyncUrlList()); + listView.setAdapter(adapter); + } } } - private class LoadingTask extends ProgressTask { + protected class DeleteTask extends ProgressTask { - public LoadingTask(Activity activity) { - super(activity); + protected boolean deletebyUuid = false; + + protected int deleted = 0; + public DeleteTask(Activity activity) { + super(activity); } @Override protected void onPreExecute() { super.onPreExecute(); dialog.cancel(); - view.emptyView.setVisibility(android.view.View.GONE); + activity.setProgressBarIndeterminateVisibility(true); } @Override protected Boolean doInBackground(String... args) { - return model.load(); + if (adapter.getCount() == 0) { + deleted = 1; + } else { + if (deletebyUuid) { + model.deleteSyncUrlById(id); + } else { + model.deleteAllSyncUrl(); + } + deleted = 2; + } + model.load(); + return true; } @Override protected void onPostExecute(Boolean success) { super.onPostExecute(success); - if(success) { - view.listLoadingProgress.setVisibility(android.view.View.GONE); - view.emptyView.setVisibility(View.VISIBLE); + view.emptyView.setVisibility(View.VISIBLE); + if (success) { + if (deleted == 1) { + toastLong(R.string.no_sync_url_to_delete); + } else { + if (deleted == 2) { + toastLong(R.string.sync_url_deleted); + + } else { + toastLong(R.string.sync_url_deleted_failed); + } + + } + adapter.setItems(model.getSyncUrlList()); + listView.setAdapter(adapter); + } + } + } + + private class AddSyncUrlTask extends Task { + + protected boolean editSyncUrl = false; + + private AddSyncUrl addSyncUrl; + + private boolean status = false; + + protected AddSyncUrlTask(Activity activity, AddSyncUrl addSyncUrl) { + super(activity); + this.addSyncUrl = addSyncUrl; + } + + @Override + protected Boolean doInBackground(String... strings) { + if (editSyncUrl) { + + status = addSyncUrl.updateSyncUrl(id); + } else { + status = addSyncUrl.addSyncUrl(); + } + model.load(); + return status; + } + + @Override + protected void onPostExecute(Boolean success) { + super.onPostExecute(success); + if (success) { adapter.setItems(model.getSyncUrlList()); listView.setAdapter(adapter); + } else { + if (editSyncUrl) { + toastLong(R.string.failed_to_update_sync_url); + } else { + toastLong(R.string.failed_to_add_sync_url); + } } } } diff --git a/smssync/src/main/java/org/addhen/smssync/models/SyncUrl.java b/smssync/src/main/java/org/addhen/smssync/models/SyncUrl.java index 41e3051f8..1f9f54991 100644 --- a/smssync/src/main/java/org/addhen/smssync/models/SyncUrl.java +++ b/smssync/src/main/java/org/addhen/smssync/models/SyncUrl.java @@ -1,6 +1,7 @@ package org.addhen.smssync.models; import org.addhen.smssync.database.Database; +import org.addhen.smssync.util.Logger; import java.util.ArrayList; import java.util.List; diff --git a/smssync/src/main/java/org/addhen/smssync/navdrawer/SyncUrlNavDrawerItem.java b/smssync/src/main/java/org/addhen/smssync/navdrawer/SyncUrlNavDrawerItem.java index 4fced06d9..d798e8675 100644 --- a/smssync/src/main/java/org/addhen/smssync/navdrawer/SyncUrlNavDrawerItem.java +++ b/smssync/src/main/java/org/addhen/smssync/navdrawer/SyncUrlNavDrawerItem.java @@ -21,6 +21,7 @@ package org.addhen.smssync.navdrawer; import org.addhen.smssync.fragments.SyncUrlFragment; +import org.addhen.smssync.models.SyncUrl; import com.actionbarsherlock.app.SherlockFragmentActivity; @@ -48,7 +49,7 @@ protected void onSelectItem() { @Override public void setCounter() { - mCounter = new org.addhen.smssync.models.SyncUrl() .totalActiveSynUrl(); + mCounter = new SyncUrl().totalActiveSynUrl(); } } diff --git a/smssync/src/main/java/org/addhen/smssync/tasks/ProgressQueue.java b/smssync/src/main/java/org/addhen/smssync/tasks/ProgressQueue.java index 1bac63c35..a73c94090 100644 --- a/smssync/src/main/java/org/addhen/smssync/tasks/ProgressQueue.java +++ b/smssync/src/main/java/org/addhen/smssync/tasks/ProgressQueue.java @@ -59,5 +59,4 @@ public void execute() { queue.remove().execute((String)null); } } - } \ No newline at end of file diff --git a/smssync/src/main/java/org/addhen/smssync/views/AddSyncUrl.java b/smssync/src/main/java/org/addhen/smssync/views/AddSyncUrl.java index 38a033024..6a9a97454 100644 --- a/smssync/src/main/java/org/addhen/smssync/views/AddSyncUrl.java +++ b/smssync/src/main/java/org/addhen/smssync/views/AddSyncUrl.java @@ -24,6 +24,7 @@ import org.addhen.smssync.R; import org.addhen.smssync.models.SyncUrl; +import org.addhen.smssync.util.Logger; import android.text.TextUtils; import android.view.MotionEvent; @@ -80,8 +81,9 @@ public boolean addSyncUrl() { syncUrl.setSecret(secret.getText().toString()); syncUrl.setTitle(title.getText().toString()); syncUrl.setUrl(url.getText().toString()); - - return syncUrl.save(); + syncUrl.setStatus(0); + return syncUrl.save(); + } /** diff --git a/smssync/src/main/java/org/addhen/smssync/views/SentMessagesView.java b/smssync/src/main/java/org/addhen/smssync/views/SentMessagesView.java index 23b7dd9f7..799fa215d 100644 --- a/smssync/src/main/java/org/addhen/smssync/views/SentMessagesView.java +++ b/smssync/src/main/java/org/addhen/smssync/views/SentMessagesView.java @@ -37,6 +37,7 @@ public class SentMessagesView extends View { public SentMessagesView(Activity activity) { super(activity); + emptyView.setText(R.string.no_sent_messages); } } diff --git a/smssync/src/main/java/org/addhen/smssync/views/SyncUrlView.java b/smssync/src/main/java/org/addhen/smssync/views/SyncUrlView.java index dd6fc6af1..c141b9c0e 100644 --- a/smssync/src/main/java/org/addhen/smssync/views/SyncUrlView.java +++ b/smssync/src/main/java/org/addhen/smssync/views/SyncUrlView.java @@ -40,6 +40,8 @@ public class SyncUrlView extends View { public SyncUrlView(Activity activity) { super(activity); + emptyView.setText(R.string.no_sync_url); + } } diff --git a/smssync/src/main/res/layout/list_items.xml b/smssync/src/main/res/layout/list_items.xml index 18d1a1d9d..4b841bfac 100644 --- a/smssync/src/main/res/layout/list_items.xml +++ b/smssync/src/main/res/layout/list_items.xml @@ -7,6 +7,7 @@ diff --git a/smssync/src/main/res/layout/list_sync_url.xml b/smssync/src/main/res/layout/list_sync_url.xml index 6fdc6c7d0..7d9bbb2e1 100644 --- a/smssync/src/main/res/layout/list_sync_url.xml +++ b/smssync/src/main/res/layout/list_sync_url.xml @@ -10,20 +10,25 @@ have questions regarding the use of this file, please contact Ushahidi developers at team@ushahidi.com. --> - - + + android:id="@+id/start_checkbox" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:gravity="center_vertical|center_horizontal" + android:text="@string/chk_enable_sms_sync" android:layout_gravity="center"/> - - \ No newline at end of file + + + + + \ No newline at end of file