trying out new icon things in details

pull/14/head
Tim Su 14 years ago
parent 0ae7d4ddd2
commit 76b85c3efe

@ -62,7 +62,7 @@ public class NoteDetailExposer extends BroadcastReceiver implements DetailExpose
if(notes.length() == 0)
return null;
return notes;
return "<img src='silk_note'/> " + notes; //$NON-NLS-1$
}
@Override

@ -7,7 +7,6 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.adapter.TaskAdapter;
import com.todoroo.astrid.api.AstridApiConstants;
@ -76,8 +75,7 @@ public class ProducteevDetailExposer extends BroadcastReceiver implements Detail
!= Preferences.getLong(ProducteevUtilities.PREF_DEFAULT_DASHBOARD, 0L) &&
ownerDashboard != null) {
String dashboardName = ownerDashboard.getValue(ProducteevDashboard.NAME);
builder.append(context.getString(R.string.producteev_TLA_dashboard,
dashboardName)).append(TaskAdapter.DETAIL_SEPARATOR);
builder.append("<img src='silk_script'/> ").append(dashboardName).append(TaskAdapter.DETAIL_SEPARATOR); //$NON-NLS-1$
}
// display responsible user if not current one
@ -88,8 +86,7 @@ public class ProducteevDetailExposer extends BroadcastReceiver implements Detail
if(index > -1) {
String user = users.substring(users.indexOf(',', index) + 1,
users.indexOf(';', index + 1));
builder.append(context.getString(R.string.producteev_TLA_responsible,
user)).append(TaskAdapter.DETAIL_SEPARATOR);
builder.append("<img src='silk_user_gray'/> ").append(user).append(TaskAdapter.DETAIL_SEPARATOR); //$NON-NLS-1$
}
}
} else {

@ -114,7 +114,7 @@ public class RepeatDetailExposer extends BroadcastReceiver implements DetailExpo
else
detail = context.getString(R.string.repeat_detail_duedate, interval);
return detail;
return "<img src='silk_date'/> " + detail; //$NON-NLS-1$
}
return null;
}

@ -66,9 +66,8 @@ public class MilkDetailExposer extends BroadcastReceiver implements DetailExpose
if(listName == null)
return null;
if(listId > 0) {
builder.append(context.getString(R.string.rmilk_TLA_list,
listName)).append(TaskAdapter.DETAIL_SEPARATOR);
if(listId > 0 && !"Inbox".equals(listName)) { //$NON-NLS-1$
builder.append("<img src='silk_script'/> ").append(listName).append(TaskAdapter.DETAIL_SEPARATOR); //$NON-NLS-1$
}
int repeat = metadata.getValue(MilkTask.REPEATING);

@ -7,7 +7,6 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.timsu.astrid.R;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.DetailExposer;
@ -49,7 +48,7 @@ public class TagDetailExposer extends BroadcastReceiver implements DetailExposer
if(tagList.length() == 0)
return null;
return context.getString(R.string.tag_TLA_detail, tagList);
return "<img src='silk_tag_pink'/> " + tagList; //$NON-NLS-1$
}
@Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

@ -37,9 +37,9 @@
<string name="repeat_detail_byday">$I on $D</string>
<!-- task detail for repeat from due date (%s -> interval) -->
<string name="repeat_detail_duedate">Repeats every %s</string>
<string name="repeat_detail_duedate">Every %s</string>
<!-- task detail for repeat from completion date (%s -> interval) -->
<string name="repeat_detail_completion">Repeats %s after completion</string>
<string name="repeat_detail_completion">%s after completion</string>
</resources>

@ -12,11 +12,6 @@
<!-- Tags hint -->
<string name="TEA_tag_hint">Tag Name</string>
<!-- ===================================================== Task Details == -->
<!-- tag text that displays in task list. %s => tag name -->
<string name="tag_TLA_detail">Tags: %s</string>
<!-- ========================================================== Filters == -->
<!-- filter header for tags -->

@ -13,7 +13,9 @@ import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.text.Html.ImageGetter;
import android.text.util.Linkify;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@ -52,6 +54,7 @@ import com.todoroo.astrid.repeats.RepeatDetailExposer;
import com.todoroo.astrid.rmilk.MilkDetailExposer;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.tags.TagDetailExposer;
import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.utility.Preferences;
/**
@ -376,6 +379,18 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
*/
public class DetailManager extends AddOnManager<String> {
private final ImageGetter imageGetter = new ImageGetter() {
public Drawable getDrawable(String source) {
Resources r = activity.getResources();
int drawable = r.getIdentifier("drawable/" + source, null, Constants.PACKAGE); //$NON-NLS-1$
if(drawable == 0)
return null;
Drawable d = r.getDrawable(drawable);
d.setBounds(0,0,d.getIntrinsicWidth(),d.getIntrinsicHeight());
return d;
}
};
private final boolean extended;
public DetailManager(boolean extended) {
this.extended = extended;
@ -441,7 +456,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
}
String string = detailText.toString();
if(string.contains("<"))
view.setText(Html.fromHtml(string.trim().replace("\n", "<br>")));
view.setText(Html.fromHtml(string.trim().replace("\n", "<br>"), imageGetter, null));
else
view.setText(string.trim());
Linkify.addLinks(view, Linkify.ALL);

@ -206,7 +206,7 @@ public class AddOnService {
list[2] = new AddOn(true, true, "Remember the Milk", null,
"Synchronize with Remember The Milk service.",
Constants.PACKAGE, "http://www.rmilk.com",
((BitmapDrawable)r.getDrawable(R.drawable.ic_menu_rmilk)).getBitmap());
((BitmapDrawable)r.getDrawable(R.drawable.ic_menu_refresh)).getBitmap());
list[3] = new AddOn(true, true, "Producteev", null,
"Synchronize with Producteev service. Also changes Astrid's importance levels to stars.",

Loading…
Cancel
Save