Fixed a bug with saving and assigning, one fewer ! in priority views

pull/14/head
Sam Bosley 14 years ago
parent 92ffddb78c
commit 2f7fd5c2b3

@ -397,8 +397,10 @@ public class EditPeopleControlSet implements TaskEditControlSet {
userJson = ((AssignedToUser) assignedSpinner.getSelectedItem()).user;
}
if (userJson != null && userJson.optString("email").indexOf('@') == -1) {
throw new ParseSharedException(assignedView,
if (userJson != null) {
String email = userJson.optString("email");
if (!TextUtils.isEmpty(email) && email.indexOf('@') == -1)
throw new ParseSharedException(assignedView,
activity.getString(R.string.actfm_EPA_invalid_email, userJson.optString("email")));
}

@ -25,6 +25,7 @@ import com.todoroo.astrid.producteev.ProducteevUtilities;
public class ImportanceControlSet implements TaskEditControlSet {
private final List<CompoundButton> buttons = new LinkedList<CompoundButton>();
private final int[] colors;
private final int grayColor;
public ImportanceControlSet(Activity activity, int containerId) {
LinearLayout layout = (LinearLayout)activity.findViewById(containerId);
@ -32,8 +33,11 @@ public class ImportanceControlSet implements TaskEditControlSet {
int min = Task.IMPORTANCE_MOST;
int max = Task.IMPORTANCE_LEAST;
grayColor = colors[max];
if(ProducteevUtilities.INSTANCE.isLoggedIn() || OpencrxCoreUtils.INSTANCE.isLoggedIn())
max = 5;
else
colors[max] = activity.getResources().getColor(android.R.color.white);
for(int i = min; i <= max; i++) {
final ToggleButton button = new ToggleButton(activity);
@ -44,7 +48,9 @@ public class ImportanceControlSet implements TaskEditControlSet {
if(ProducteevUtilities.INSTANCE.isLoggedIn() || OpencrxCoreUtils.INSTANCE.isLoggedIn())
label.append(5 - i).append("\n\u2605"); //$NON-NLS-1$
else {
for(int j = Task.IMPORTANCE_LEAST; j >= i; j--)
if (i == max)
label.append('\u25CB');
for(int j = Task.IMPORTANCE_LEAST - 1; j >= i; j--)
label.append('!');
}
@ -69,10 +75,13 @@ public class ImportanceControlSet implements TaskEditControlSet {
if(b.getTag() == i) {
b.setTextSize(24);
b.setChecked(true);
if (i.intValue() == Task.IMPORTANCE_LEAST)
b.setTextColor(grayColor);
b.setBackgroundResource(R.drawable.btn_selected);
} else {
b.setTextSize(16);
b.setChecked(false);
b.setTextColor(colors[(Integer)b.getTag()]);
b.setBackgroundResource(android.R.drawable.btn_default);
}
}

Loading…
Cancel
Save