diff --git a/astrid/res/layout/control_set_notes_display.xml b/astrid/res/layout/control_set_notes_display.xml index 178782bf1..5dd2dea93 100644 --- a/astrid/res/layout/control_set_notes_display.xml +++ b/astrid/res/layout/control_set_notes_display.xml @@ -21,7 +21,7 @@ android:layout_marginRight="15dip" android:text="@string/TEA_note_label" style="@style/TextAppearance.GEN_EditLabel" /> - 2) { + notesBody.setGravity(Gravity.TOP); + notesBody.setPadding(0, (int) (metrics.density * 8), 0, (int) (metrics.density * 8)); + } else { + notesBody.setGravity(Gravity.CENTER_VERTICAL); + notesBody.setPadding(0, 0, 0, 0); + } + } + } diff --git a/astrid/src/com/todoroo/astrid/ui/TextViewWithMeasureListener.java b/astrid/src/com/todoroo/astrid/ui/TextViewWithMeasureListener.java new file mode 100644 index 000000000..adde0c4e0 --- /dev/null +++ b/astrid/src/com/todoroo/astrid/ui/TextViewWithMeasureListener.java @@ -0,0 +1,35 @@ +package com.todoroo.astrid.ui; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.TextView; + +public class TextViewWithMeasureListener extends TextView { + + public interface OnTextMeasureListener { + public void onTextSizeChanged(); + } + + private OnTextMeasureListener listener; + + + public TextViewWithMeasureListener(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + if (listener != null) { + listener.onTextSizeChanged(); + } + } + + public OnTextMeasureListener getOnTextSizeChangedListener() { + return listener; + } + + public void setOnTextSizeChangedListener(OnTextMeasureListener listener) { + this.listener = listener; + } +}