Cleaned up some code and fixed a couple crashes

pull/14/head
Sam Bosley 13 years ago
parent 207bea702e
commit 9b1c69b17d

@ -76,7 +76,7 @@ public class RepeatControlSet extends PopupControlSet {
private final List<RepeatChangedListener> listeners = new LinkedList<RepeatChangedListener>();
public interface RepeatChangedListener {
public void RepeatChanged(boolean repeat);
public void repeatChanged(boolean repeat);
}
@Autowired
@ -342,7 +342,7 @@ public class RepeatControlSet extends PopupControlSet {
okListener.onClick(d, which);
for (RepeatChangedListener l : listeners) {
l.RepeatChanged(doRepeat);
l.repeatChanged(doRepeat);
}
}
};
@ -356,7 +356,7 @@ public class RepeatControlSet extends PopupControlSet {
DialogUtilities.dismissDialog(activity, d);
for (RepeatChangedListener l : listeners) {
l.RepeatChanged(doRepeat);
l.repeatChanged(doRepeat);
}
}
};

@ -3,7 +3,6 @@ package com.todoroo.astrid.ui;
import android.app.Activity;
import android.text.TextUtils;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.astrid.adapter.TaskAdapter;
import com.todoroo.astrid.data.Task;
@ -28,7 +27,7 @@ public class EditTitleControlSet extends EditTextControlSet implements Importanc
@Override
public void RepeatChanged(boolean repeat) {
public void repeatChanged(boolean repeat) {
isRepeating = repeat;
updateCompleteBox();
@ -42,21 +41,16 @@ public class EditTitleControlSet extends EditTextControlSet implements Importanc
}
public void updateCompleteBox() {
if(importanceValue < TaskAdapter.IMPORTANCE_RESOURCES.length)
{
if (isRepeating)
{
completeBox.setButtonDrawable(TaskAdapter.IMPORTANCE_REPEAT_RESOURCES[importanceValue]);
private void updateCompleteBox() {
int valueToUse = importanceValue;
if (valueToUse >= TaskAdapter.IMPORTANCE_RESOURCES.length)
valueToUse = TaskAdapter.IMPORTANCE_RESOURCES.length - 1;
if(valueToUse < TaskAdapter.IMPORTANCE_RESOURCES.length) {
if (isRepeating) {
completeBox.setButtonDrawable(TaskAdapter.IMPORTANCE_REPEAT_RESOURCES[valueToUse]);
} else {
completeBox.setButtonDrawable(TaskAdapter.IMPORTANCE_RESOURCES[valueToUse]);
}
else
{
completeBox.setButtonDrawable(TaskAdapter.IMPORTANCE_RESOURCES[importanceValue]);
}
}
else
{
completeBox.setBackgroundResource(R.drawable.btn_check);
}
}

@ -92,7 +92,7 @@ public class ImportanceControlSet extends TaskEditControlSet {
}
if (usedWidth > width * 2 /3 ) {
getView().findViewById(R.id.display_row_edit).setVisibility(View.GONE);
getView().findViewById(R.id.display_row_title).setVisibility(View.GONE);
}
}

Loading…
Cancel
Save