Reformat code

pull/699/head
Alex Baker 8 years ago
parent bb44afbb7d
commit b356f4cbe3

@ -55,15 +55,15 @@ public class SubtasksMovingTest extends SubtasksTestCase {
updater.moveTo(null, filter, target.getUuid(), beforeId); updater.moveTo(null, filter, target.getUuid(), beforeId);
} }
/* Starting State (see SubtasksTestCase): /* Starting State (see SubtasksTestCase):
* *
* A * A
* B * B
* C * C
* D * D
* E * E
* F * F
*/ */
@Ignore @Ignore
@Test @Test

@ -23,14 +23,14 @@ import org.tasks.preferences.Preferences;
public class SubtasksTestCase extends InjectingTestCase { public class SubtasksTestCase extends InjectingTestCase {
/* Starting State: /* Starting State:
* *
* A * A
* B * B
* C * C
* D * D
* E * E
* F * F
*/ */
public static final String DEFAULT_SERIALIZED_TREE = "[-1, [1, 2, [3, 4]], 5, 6]" public static final String DEFAULT_SERIALIZED_TREE = "[-1, [1, 2, [3, 4]], 5, 6]"
.replaceAll("\\s", ""); .replaceAll("\\s", "");
protected SubtasksFilterUpdater updater; protected SubtasksFilterUpdater updater;

@ -38,15 +38,15 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
private Task A, B, C, D, E, F; private Task A, B, C, D, E, F;
private GoogleTaskList list; private GoogleTaskList list;
/* Starting State: /* Starting State:
* *
* A * A
* B * B
* C * C
* D * D
* E * E
* F * F
*/ */
@Test @Test
public void testMoveDownFromListBottom() { public void testMoveDownFromListBottom() {
@ -84,12 +84,12 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(C, B); whenTriggerMove(C, B);
/* /*
* A * A
* C * C
* D * D
* B * B
*/ */
thenExpectMetadataOrderAndIndent(A, 0, 0); thenExpectMetadataOrderAndIndent(A, 0, 0);
thenExpectMetadataOrderAndIndent(B, 3, 1); thenExpectMetadataOrderAndIndent(B, 3, 1);
@ -103,13 +103,13 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(B, E); whenTriggerMove(B, E);
/* /*
* A * A
* C * C
* D * D
* B * B
* E * E
*/ */
thenExpectMetadataOrderAndIndent(A, 0, 0); thenExpectMetadataOrderAndIndent(A, 0, 0);
thenExpectMetadataOrderAndIndent(B, 3, 0); thenExpectMetadataOrderAndIndent(B, 3, 0);
@ -123,14 +123,14 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(B, A); whenTriggerMove(B, A);
/* /*
* B * B
* A * A
* C * C
* D * D
* E * E
* F * F
*/ */
thenExpectMetadataOrderAndIndent(A, 1, 0); thenExpectMetadataOrderAndIndent(A, 1, 0);
thenExpectMetadataOrderAndIndent(B, 0, 0); thenExpectMetadataOrderAndIndent(B, 0, 0);
@ -143,14 +143,14 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(C, F); whenTriggerMove(C, F);
/* /*
* A * A
* B * B
* E * E
* C * C
* D * D
* F * F
*/ */
thenExpectMetadataOrderAndIndent(A, 0, 0); thenExpectMetadataOrderAndIndent(A, 0, 0);
thenExpectMetadataOrderAndIndent(B, 1, 1); thenExpectMetadataOrderAndIndent(B, 1, 1);
@ -165,13 +165,13 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(D, F); whenTriggerMove(D, F);
/* /*
* A * A
* B * B
* C * C
* E * E
* D * D
*/ */
thenExpectMetadataOrderAndIndent(A, 0, 0); thenExpectMetadataOrderAndIndent(A, 0, 0);
thenExpectMetadataOrderAndIndent(B, 1, 1); thenExpectMetadataOrderAndIndent(B, 1, 1);
@ -186,12 +186,12 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(C, A); whenTriggerMove(C, A);
/* /*
* C * C
* D * D
* A * A
* B * B
*/ */
thenExpectMetadataOrderAndIndent(A, 2, 0); thenExpectMetadataOrderAndIndent(A, 2, 0);
thenExpectMetadataOrderAndIndent(B, 3, 1); thenExpectMetadataOrderAndIndent(B, 3, 1);
@ -205,13 +205,13 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(F, D); whenTriggerMove(F, D);
/* /*
* A * A
* B * B
* C * C
* F * F
* D * D
*/ */
thenExpectMetadataOrderAndIndent(A, 0, 0); thenExpectMetadataOrderAndIndent(A, 0, 0);
thenExpectMetadataOrderAndIndent(B, 1, 1); thenExpectMetadataOrderAndIndent(B, 1, 1);
@ -227,13 +227,13 @@ public class GtasksTaskMovingTest extends InjectingTestCase {
whenTriggerMove(B, F); whenTriggerMove(B, F);
/* /*
* A * A
* C * C
* D * D
* E * E
* B * B
*/ */
thenExpectMetadataOrderAndIndent(A, 0, 0); thenExpectMetadataOrderAndIndent(A, 0, 0);
thenExpectMetadataOrderAndIndent(B, 4, 0); thenExpectMetadataOrderAndIndent(B, 4, 0);

@ -70,9 +70,9 @@ public class DateUtilities {
return currentTimeMillis(); return currentTimeMillis();
} }
/* ====================================================================== /* ======================================================================
* =========================================================== formatters * =========================================================== formatters
* ====================================================================== */ * ====================================================================== */
/** /**
* Returns unixtime one month from now * Returns unixtime one month from now

@ -18,7 +18,7 @@ import org.tasks.injection.InjectingAppCompatActivity;
/** /**
* @author joshuagross * @author joshuagross
* *
* Create a new task based on incoming links from the "share" menu * Create a new task based on incoming links from the "share" menu
*/ */
public final class ShareLinkActivity extends InjectingAppCompatActivity { public final class ShareLinkActivity extends InjectingAppCompatActivity {

@ -212,11 +212,11 @@ public final class TaskEditFragment extends InjectingFragment implements
} }
} }
/* /*
* ====================================================================== * ======================================================================
* =============================================== model reading / saving * =============================================== model reading / saving
* ====================================================================== * ======================================================================
*/ */
private EditTitleControlSet getEditTitleControlSet() { private EditTitleControlSet getEditTitleControlSet() {
return getFragment(EditTitleControlSet.TAG); return getFragment(EditTitleControlSet.TAG);
@ -252,11 +252,11 @@ public final class TaskEditFragment extends InjectingFragment implements
return false; return false;
} }
/* /*
* ====================================================================== * ======================================================================
* ======================================================= event handlers * ======================================================= event handlers
* ====================================================================== * ======================================================================
*/ */
public void discardButtonClick() { public void discardButtonClick() {
if (hasChanges( if (hasChanges(
@ -293,11 +293,11 @@ public final class TaskEditFragment extends InjectingFragment implements
getEditTitleControlSet().setPriority(priority); getEditTitleControlSet().setPriority(priority);
} }
/* /*
* ====================================================================== * ======================================================================
* ========================================== UI component helper classes * ========================================== UI component helper classes
* ====================================================================== * ======================================================================
*/ */
public void onRepeatChanged(boolean repeat) { public void onRepeatChanged(boolean repeat) {
getEditTitleControlSet().repeatChanged(repeat); getEditTitleControlSet().repeatChanged(repeat);

@ -394,11 +394,11 @@ public class TaskListFragment extends InjectingFragment implements
setSyncOngoing(gtasksPreferenceService.isOngoing()); setSyncOngoing(gtasksPreferenceService.isOngoing());
} }
/* /*
* ====================================================================== * ======================================================================
* =================================================== managing list view * =================================================== managing list view
* ====================================================================== * ======================================================================
*/ */
public void loadTaskListContent() { public void loadTaskListContent() {
loadTaskListContent(true); loadTaskListContent(true);
@ -447,11 +447,11 @@ public class TaskListFragment extends InjectingFragment implements
public void onTaskCreated(String uuid) { public void onTaskCreated(String uuid) {
} }
/* /*
* ====================================================================== * ======================================================================
* ============================================================== actions * ============================================================== actions
* ====================================================================== * ======================================================================
*/ */
public void onTaskDelete(List<Task> tasks) { public void onTaskDelete(List<Task> tasks) {
for (Task task : tasks) { for (Task task : tasks) {

@ -217,9 +217,9 @@ public class FilterAdapter extends ArrayAdapter<FilterListItem> {
addSubMenu(activity.getResources().getString(titleResource), filters, hideIfEmpty); addSubMenu(activity.getResources().getString(titleResource), filters, hideIfEmpty);
} }
/* ====================================================================== /* ======================================================================
* ============================================================= receiver * ============================================================= receiver
* ====================================================================== */ * ====================================================================== */
private void addSubMenu(String title, List<Filter> filters, boolean hideIfEmpty) { private void addSubMenu(String title, List<Filter> filters, boolean hideIfEmpty) {
if (hideIfEmpty && filters.isEmpty()) { if (hideIfEmpty && filters.isEmpty()) {
@ -371,9 +371,9 @@ public class FilterAdapter extends ArrayAdapter<FilterListItem> {
viewHolder.name.setText(filter.listingTitle); viewHolder.name.setText(filter.listingTitle);
} }
/* ====================================================================== /* ======================================================================
* ================================================================ views * ================================================================ views
* ====================================================================== */ * ====================================================================== */
public static class ViewHolder { public static class ViewHolder {

@ -160,10 +160,10 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
@Override @Override
public void onClick(View v) { public void onClick(View v) {
/* /*
* The text view may still have focus so clear it's focus which will * The text view may still have focus so clear it's focus which will
* trigger the on focus changed and any typed values to be pulled. * trigger the on focus changed and any typed values to be pulled.
*/ */
mText.clearFocus(); mText.clearFocus();
// now perform the increment/decrement // now perform the increment/decrement
@ -203,11 +203,11 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
private void updateView() { private void updateView() {
/* /*
* If we don't have displayed values then use the current number else * If we don't have displayed values then use the current number else
* find the correct value in the displayed values for the current * find the correct value in the displayed values for the current
* number. * number.
*/ */
mText.setText(formatNumber(mCurrent)); mText.setText(formatNumber(mCurrent));
} }
@ -227,9 +227,9 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
@Override @Override
public void onFocusChange(View v, boolean hasFocus) { public void onFocusChange(View v, boolean hasFocus) {
/* /*
* When focus is lost check that the text field has valid values. * When focus is lost check that the text field has valid values.
*/ */
if (!hasFocus && v instanceof TextView) { if (!hasFocus && v instanceof TextView) {
String str = String.valueOf(((TextView) v).getText()); String str = String.valueOf(((TextView) v).getText());
if ("".equals(str)) { if ("".equals(str)) {
@ -251,10 +251,10 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
/* /*
* The text view may still have focus so clear it's focus which will * The text view may still have focus so clear it's focus which will
* trigger the on focus changed and any typed values to be pulled. * trigger the on focus changed and any typed values to be pulled.
*/ */
mText.clearFocus(); mText.clearFocus();
if (R.id.increment == v.getId()) { if (R.id.increment == v.getId()) {
@ -351,11 +351,11 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
int val = getSelectedPos(result); int val = getSelectedPos(result);
/* /*
* Ensure the user can't type in a value greater than the max * Ensure the user can't type in a value greater than the max
* allowed. We have to allow less than min as the user might want to * allowed. We have to allow less than min as the user might want to
* delete some numbers and then type a new number. * delete some numbers and then type a new number.
*/ */
if (val > mEnd) { if (val > mEnd) {
return ""; return "";
} else { } else {

@ -14,11 +14,11 @@ public final class FireReceiver extends BroadcastReceiver {
public final void onReceive(final Context context, final Intent intent) { public final void onReceive(final Context context, final Intent intent) {
Timber.d("Received %s", intent); //$NON-NLS-1$ Timber.d("Received %s", intent); //$NON-NLS-1$
/* /*
* Note: It is OK if a host sends an ordered broadcast for plug-in * Note: It is OK if a host sends an ordered broadcast for plug-in
* settings. Such a behavior would allow the host to optionally block until the * settings. Such a behavior would allow the host to optionally block until the
* plug-in setting finishes. * plug-in setting finishes.
*/ */
if (!com.twofortyfouram.locale.api.Intent.ACTION_FIRE_SETTING.equals(intent.getAction())) { if (!com.twofortyfouram.locale.api.Intent.ACTION_FIRE_SETTING.equals(intent.getAction())) {
Timber.e("Intent action is not %s", Timber.e("Intent action is not %s",
@ -26,14 +26,14 @@ public final class FireReceiver extends BroadcastReceiver {
return; return;
} }
/* /*
* Ignore implicit intents, because they are not valid. It would be * Ignore implicit intents, because they are not valid. It would be
* meaningless if ALL plug-in setting BroadcastReceivers installed were * meaningless if ALL plug-in setting BroadcastReceivers installed were
* asked to handle queries not intended for them. Ideally this * asked to handle queries not intended for them. Ideally this
* implementation here would also explicitly assert the class name as * implementation here would also explicitly assert the class name as
* well, but then the unit tests would have trouble. In the end, * well, but then the unit tests would have trouble. In the end,
* asserting the package is probably good enough. * asserting the package is probably good enough.
*/ */
if (!context.getPackageName().equals(intent.getPackage()) if (!context.getPackageName().equals(intent.getPackage())
&& !new ComponentName(context, this.getClass().getName()).equals(intent && !new ComponentName(context, this.getClass().getName()).equals(intent
.getComponent())) { .getComponent())) {

@ -51,11 +51,6 @@ public class GeofenceService {
return changed; return changed;
} }
public interface SynchronizeGeofenceCallback {
void beforeDelete(Location location);
}
private boolean synchronizeMetadata(long taskId, List<Location> locations, private boolean synchronizeMetadata(long taskId, List<Location> locations,
final SynchronizeGeofenceCallback callback) { final SynchronizeGeofenceCallback callback) {
boolean dirty = false; boolean dirty = false;
@ -99,4 +94,9 @@ public class GeofenceService {
private List<Location> getGeofencesForTask(long taskId) { private List<Location> getGeofencesForTask(long taskId) {
return locationDao.getActiveGeofences(taskId); return locationDao.getActiveGeofences(taskId);
} }
public interface SynchronizeGeofenceCallback {
void beforeDelete(Location location);
}
} }

Loading…
Cancel
Save