Improved text colors in new edit screen design

pull/14/head
Sam Bosley 12 years ago
parent 6575f9a238
commit 0850fb3e11

@ -132,7 +132,6 @@ public class EditPeopleControlSet extends PopupControlSet {
this.resources = activity.getResources(); this.resources = activity.getResources();
this.loginRequestCode = loginRequestCode; this.loginRequestCode = loginRequestCode;
this.fragment = fragment; this.fragment = fragment;
displayText.setText(activity.getString(R.string.TEA_control_who));
assignedCustom = (EditText) getView().findViewById(R.id.assigned_custom); assignedCustom = (EditText) getView().findViewById(R.id.assigned_custom);
assignedList = (ListView) getView().findViewById(R.id.assigned_list); assignedList = (ListView) getView().findViewById(R.id.assigned_list);

@ -66,7 +66,6 @@ public class FilesControlSet extends PopupControlSet {
super(activity, viewLayout, displayViewLayout, title); super(activity, viewLayout, displayViewLayout, title);
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
displayText.setText(activity.getString(R.string.TEA_control_files));
fileDisplayList = (LinearLayout) getDisplayView().findViewById(R.id.files_list); fileDisplayList = (LinearLayout) getDisplayView().findViewById(R.id.files_list);
inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
} }

@ -11,6 +11,7 @@ import java.util.LinkedHashSet;
import android.app.Activity; import android.app.Activity;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -63,7 +64,6 @@ public final class TagsControlSet extends PopupControlSet {
super(activity, viewLayout, displayViewLayout, title); super(activity, viewLayout, displayViewLayout, title);
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
tagsDisplay = (TextView) getDisplayView().findViewById(R.id.display_row_edit); tagsDisplay = (TextView) getDisplayView().findViewById(R.id.display_row_edit);
this.displayText.setText(activity.getString(R.string.TEA_tags_label));
} }
private Tag[] getTagArray() { private Tag[] getTagArray() {
@ -97,8 +97,6 @@ public final class TagsControlSet extends PopupControlSet {
builder.append(tag); builder.append(tag);
} }
if (builder.length() == 0)
builder.append(activity.getString(R.string.tag_FEx_untagged));
return builder.toString(); return builder.toString();
} }
@ -306,7 +304,14 @@ public final class TagsControlSet extends PopupControlSet {
@Override @Override
protected void refreshDisplayView() { protected void refreshDisplayView() {
tagsDisplay.setText(buildTagString()); String tagString = buildTagString();
if (!TextUtils.isEmpty(tagString)) {
tagsDisplay.setText(tagString);
tagsDisplay.setTextColor(themeColor);
} else {
tagsDisplay.setText(R.string.tag_FEx_untagged);
tagsDisplay.setTextColor(unsetColor);
}
} }
public boolean hasLists() { public boolean hasLists() {

@ -29,7 +29,6 @@ public class TimerControlSet extends PopupControlSet implements TimerActionListe
public TimerControlSet(final Activity activity, int viewLayout, int displayViewLayout, int title) { public TimerControlSet(final Activity activity, int viewLayout, int displayViewLayout, int title) {
super(activity, viewLayout, displayViewLayout, title); super(activity, viewLayout, displayViewLayout, title);
this.displayText.setText(activity.getString(R.string.TEA_timer_controls));
estimated = new TimeDurationTaskEditControlSet(activity, getView(), Task.ESTIMATED_SECONDS, estimated = new TimeDurationTaskEditControlSet(activity, getView(), Task.ESTIMATED_SECONDS,
R.id.estimatedDuration, 0, R.string.DLG_hour_minutes R.id.estimatedDuration, 0, R.string.DLG_hour_minutes
); );

@ -18,20 +18,17 @@
android:paddingLeft="10dip" android:paddingLeft="10dip"
android:paddingRight="10dip" android:paddingRight="10dip"
android:gravity="center_vertical"> android:gravity="center_vertical">
<View android:id="@+id/display_row_icon"
<TextView
android:id="@+id/display_row_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dip" android:layout_marginRight="10dip"
style="@style/TextAppearance.GEN_EditLabel" /> android:layout_width="24dip"
android:layout_height="24dip"
android:background="#ff0000"/>
<TextView <TextView
android:id="@+id/display_row_edit" android:id="@+id/display_row_edit"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="right" android:gravity="left"
android:paddingLeft="10dip"
style="@style/TextAppearance.EditRowDisplay" /> style="@style/TextAppearance.EditRowDisplay" />
</LinearLayout> </LinearLayout>
<View <View

@ -23,19 +23,12 @@
android:layout_width="24dip" android:layout_width="24dip"
android:layout_height="24dip" android:layout_height="24dip"
android:background="#ff0000"/> android:background="#ff0000"/>
<TextView
android:id="@+id/display_row_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dip"
style="@style/TextAppearance.GEN_EditLabel" />
<TextView <TextView
android:id="@+id/display_row_edit" android:id="@+id/display_row_edit"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="right" android:gravity="left"
android:paddingLeft="10dip"
style="@style/TextAppearance.EditRowDisplay" /> style="@style/TextAppearance.EditRowDisplay" />
</LinearLayout> </LinearLayout>
<View <View

@ -29,12 +29,20 @@ public abstract class TaskEditControlSet {
private View view; private View view;
protected Task model; protected Task model;
protected boolean initialized = false; protected boolean initialized = false;
protected final int themeColor;
protected final int unsetColor;
public TaskEditControlSet(Activity activity, int viewLayout) { public TaskEditControlSet(Activity activity, int viewLayout) {
this.activity = activity; this.activity = activity;
this.viewLayout = viewLayout; this.viewLayout = viewLayout;
if (viewLayout == -1) if (viewLayout == -1)
initialized = true; initialized = true;
TypedValue tv = new TypedValue();
activity.getTheme().resolveAttribute(R.attr.asThemeTextColor, tv, false);
themeColor = activity.getResources().getColor(tv.data);
unsetColor = activity.getResources().getColor(R.color.task_edit_deadline_gray);
} }
public View getView() { public View getView() {

@ -33,7 +33,6 @@ public class DeadlineControlSet extends PopupControlSet {
RepeatControlSet repeatControlSet, View...extraViews) { RepeatControlSet repeatControlSet, View...extraViews) {
super(activity, viewLayout, displayViewLayout, 0); super(activity, viewLayout, displayViewLayout, 0);
this.extraViews = extraViews; this.extraViews = extraViews;
this.displayText.setText(activity.getString(R.string.TEA_when_header_label));
this.repeatControlSet = repeatControlSet; this.repeatControlSet = repeatControlSet;
} }

@ -37,8 +37,10 @@ public class EditNotesControlSet extends PopupControlSet {
if (TextUtils.isEmpty(textToUse)) { if (TextUtils.isEmpty(textToUse)) {
notesPreview.setText(R.string.TEA_notes_empty); notesPreview.setText(R.string.TEA_notes_empty);
notesPreview.setTextColor(unsetColor);
} else { } else {
notesPreview.setText(textToUse); notesPreview.setText(textToUse);
notesPreview.setTextColor(themeColor);
} }
linkifyDisplayView(); linkifyDisplayView();

@ -45,7 +45,6 @@ public class HideUntilControlSet extends PopupControlSet implements OnItemSelect
public HideUntilControlSet(Activity activity, int viewLayout, int displayViewLayout, int title) { public HideUntilControlSet(Activity activity, int viewLayout, int displayViewLayout, int title) {
super(activity, viewLayout, displayViewLayout, title); super(activity, viewLayout, displayViewLayout, title);
this.title = title; this.title = title;
this.displayText.setText(activity.getString(R.string.TEA_hideUntil_label));
} }
private ArrayAdapter<HideUntilValue> adapter; private ArrayAdapter<HideUntilValue> adapter;

@ -15,7 +15,6 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.LayoutParams;
import android.view.Window; import android.view.Window;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.AndroidUtilities;
@ -28,7 +27,6 @@ public abstract class PopupControlSet extends TaskEditControlSet {
protected final View displayView; protected final View displayView;
protected Dialog dialog; protected Dialog dialog;
protected final TextView displayText;
private final String titleString; private final String titleString;
public interface PopupDialogClickListener { public interface PopupDialogClickListener {
@ -51,17 +49,10 @@ public abstract class PopupControlSet extends TaskEditControlSet {
public PopupControlSet(Activity activity, int viewLayout, int displayViewLayout, final int title) { public PopupControlSet(Activity activity, int viewLayout, int displayViewLayout, final int title) {
super(activity, viewLayout); super(activity, viewLayout);
if (displayViewLayout != -1){ if (displayViewLayout != -1)
this.displayView = LayoutInflater.from(activity).inflate(displayViewLayout, null); this.displayView = LayoutInflater.from(activity).inflate(displayViewLayout, null);
displayText = (TextView) displayView.findViewById(R.id.display_row_title); else
if (displayText != null) {
displayText.setMaxLines(2);
}
}
else {
this.displayView = null; this.displayView = null;
this.displayText = null;
}
titleString = (title > 0) ? activity.getString(title) : ""; //$NON-NLS-1$ titleString = (title > 0) ? activity.getString(title) : ""; //$NON-NLS-1$

@ -42,7 +42,6 @@ public class ReminderControlSet extends PopupControlSet {
public ReminderControlSet(Activity activity, int viewLayout, int displayViewLayout) { public ReminderControlSet(Activity activity, int viewLayout, int displayViewLayout) {
super(activity, viewLayout, displayViewLayout, R.string.TEA_reminders_group_label); super(activity, viewLayout, displayViewLayout, R.string.TEA_reminders_group_label);
extraViews = new ArrayList<View>(); extraViews = new ArrayList<View>();
displayText.setText(activity.getString(R.string.TEA_reminders_group_label));
} }
public void addViewToBody(View v) { public void addViewToBody(View v) {

Loading…
Cancel
Save