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.loginRequestCode = loginRequestCode;
this.fragment = fragment;
displayText.setText(activity.getString(R.string.TEA_control_who));
assignedCustom = (EditText) getView().findViewById(R.id.assigned_custom);
assignedList = (ListView) getView().findViewById(R.id.assigned_list);

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

@ -11,6 +11,7 @@ import java.util.LinkedHashSet;
import android.app.Activity;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@ -63,7 +64,6 @@ public final class TagsControlSet extends PopupControlSet {
super(activity, viewLayout, displayViewLayout, title);
DependencyInjectionService.getInstance().inject(this);
tagsDisplay = (TextView) getDisplayView().findViewById(R.id.display_row_edit);
this.displayText.setText(activity.getString(R.string.TEA_tags_label));
}
private Tag[] getTagArray() {
@ -97,8 +97,6 @@ public final class TagsControlSet extends PopupControlSet {
builder.append(tag);
}
if (builder.length() == 0)
builder.append(activity.getString(R.string.tag_FEx_untagged));
return builder.toString();
}
@ -306,7 +304,14 @@ public final class TagsControlSet extends PopupControlSet {
@Override
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() {

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

@ -18,23 +18,20 @@
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:gravity="center_vertical">
<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" />
<View android:id="@+id/display_row_icon"
android:layout_marginRight="10dip"
android:layout_width="24dip"
android:layout_height="24dip"
android:background="#ff0000"/>
<TextView
android:id="@+id/display_row_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:paddingLeft="10dip"
android:gravity="left"
style="@style/TextAppearance.EditRowDisplay" />
</LinearLayout>
<View
<View
android:id="@+id/TEA_Separator"
android:layout_width="fill_parent"
android:layout_height="1px"

@ -23,19 +23,12 @@
android:layout_width="24dip"
android:layout_height="24dip"
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
android:id="@+id/display_row_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:paddingLeft="10dip"
android:gravity="left"
style="@style/TextAppearance.EditRowDisplay" />
</LinearLayout>
<View

@ -29,12 +29,20 @@ public abstract class TaskEditControlSet {
private View view;
protected Task model;
protected boolean initialized = false;
protected final int themeColor;
protected final int unsetColor;
public TaskEditControlSet(Activity activity, int viewLayout) {
this.activity = activity;
this.viewLayout = viewLayout;
if (viewLayout == -1)
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() {

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

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

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

@ -15,7 +15,6 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.AndroidUtilities;
@ -28,7 +27,6 @@ public abstract class PopupControlSet extends TaskEditControlSet {
protected final View displayView;
protected Dialog dialog;
protected final TextView displayText;
private final String titleString;
public interface PopupDialogClickListener {
@ -51,17 +49,10 @@ public abstract class PopupControlSet extends TaskEditControlSet {
public PopupControlSet(Activity activity, int viewLayout, int displayViewLayout, final int title) {
super(activity, viewLayout);
if (displayViewLayout != -1){
if (displayViewLayout != -1)
this.displayView = LayoutInflater.from(activity).inflate(displayViewLayout, null);
displayText = (TextView) displayView.findViewById(R.id.display_row_title);
if (displayText != null) {
displayText.setMaxLines(2);
}
}
else {
else
this.displayView = null;
this.displayText = null;
}
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) {
super(activity, viewLayout, displayViewLayout, R.string.TEA_reminders_group_label);
extraViews = new ArrayList<View>();
displayText.setText(activity.getString(R.string.TEA_reminders_group_label));
}
public void addViewToBody(View v) {

Loading…
Cancel
Save