Linkify notes in task edit page

pull/14/head
Sam Bosley 14 years ago
parent eb22f645cb
commit 34130ccf78

@ -9,7 +9,8 @@
<LinearLayout
android:id="@+id/notes_body"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:minHeight="50dip"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageView
style="@style/EditRowImage"
@ -26,7 +27,6 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:maxLines="2"
android:paddingLeft="10dip"
style="@style/TextAppearance.EditRowDisplay" />
<include layout="@layout/task_edit_arrow"/>

@ -1,6 +1,9 @@
package com.todoroo.astrid.ui;
import android.app.Activity;
import android.graphics.Color;
import android.text.TextUtils;
import android.text.util.Linkify;
import android.widget.EditText;
import android.widget.TextView;
@ -21,12 +24,21 @@ public class EditNotesControlSet extends PopupControlSet {
@Override
protected void refreshDisplayView() {
notesPreview.setText(editText.getText());
linkifyDisplayView();
}
private void linkifyDisplayView() {
if(!TextUtils.isEmpty(notesPreview.getText())) {
notesPreview.setLinkTextColor(Color.rgb(100, 160, 255));
Linkify.addLinks(notesPreview, Linkify.ALL);
}
}
@Override
public void readFromTask(Task task) {
editText.setTextKeepState(task.getValue(Task.NOTES));
notesPreview.setText(task.getValue(Task.NOTES));
linkifyDisplayView();
}
@Override

Loading…
Cancel
Save