Changes for Issue "No icon and title 'You commented' for notes"

Closes #12
Closes #14
pull/25/head
jomnext 11 years ago committed by Alex Baker
parent 168d02b375
commit 145d9e4da8

@ -421,6 +421,11 @@ public class UpdateAdapter extends CursorAdapter {
}
public static Spanned getUpdateComment(final AstridActivity context, UserActivity activity, User user, String linkColor, String fromView) {
String message = activity.getValue(UserActivity.MESSAGE);
if (!Preferences.getBoolean(R.string.p_show_caption_comments, false)) {
return Html.fromHtml(message);
}
String userDisplay;
if (activity.getValue(UserActivity.USER_UUID).equals(Task.USER_ID_SELF)) {
userDisplay = context.getString(R.string.update_string_user_self);
@ -434,7 +439,6 @@ public class UpdateAdapter extends CursorAdapter {
}
String targetName = activity.getValue(UserActivity.TARGET_NAME);
String action = activity.getValue(UserActivity.ACTION);
String message = activity.getValue(UserActivity.MESSAGE);
int commentResource = 0;
if (UserActivity.ACTION_TASK_COMMENT.equals(action)) {

@ -434,10 +434,16 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
}
public View getUpdateNotes(NoteOrUpdate note, ViewGroup parent) {
View convertView = ((Activity)getContext()).getLayoutInflater().inflate(
R.layout.update_adapter_row, parent, false);
View convertView;
if (Preferences.getBoolean(R.string.p_show_caption_comments, false)) {
convertView = ((Activity)getContext()).getLayoutInflater().inflate(
R.layout.update_adapter_row, parent, false);
}
else {
convertView = ((Activity)getContext()).getLayoutInflater().inflate(
R.layout.update_adapter_row_no_caption, parent, false);
}
bindView(convertView, note);
return convertView;
@ -446,10 +452,10 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
/** Helper method to set the contents and visibility of each field */
public synchronized void bindView(View view, NoteOrUpdate item) {
// picture
final AsyncImageView pictureView = (AsyncImageView)view.findViewById(R.id.picture); {
if (Preferences.getBoolean(R.string.p_show_caption_comments, false)) {
final AsyncImageView pictureView = (AsyncImageView)view.findViewById(R.id.picture);
pictureView.setDefaultImageDrawable(ResourceDrawableCache.getImageDrawableFromId(resources, R.drawable.icn_default_person_image));
pictureView.setUrl(item.picture);
}
// name

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:astrid="http://schemas.android.com/apk/res/org.tasks"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="55dip"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/list_selector_background"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:paddingLeft="6dip"
android:paddingRight="6dip">
<!-- title -->
<TextView android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:paddingLeft="5dip"
android:paddingRight="3dip"
style="@style/TextAppearance.TAd_ItemTitle"
android:textSize="16sp"/>
<!-- activity date -->
<TextView android:id="@+id/date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_alignLeft="@id/title"
android:layout_marginLeft="5dip"
android:paddingTop="1dip"
style="@style/TextAppearance.TAd_ItemDueDate"
android:textStyle="normal"
android:gravity="left"
android:ellipsize="end"
android:textSize="12sp"
android:singleLine="true"/>
<!-- picture -->
<com.todoroo.astrid.helper.AsyncImageView android:id="@+id/comment_picture"
android:layout_width="100dip"
android:layout_height="100dip"
android:layout_below="@id/date"
android:paddingTop="5dip"
astrid:defaultSrc="@drawable/icn_default_person_image"
android:scaleType="fitStart"
android:layout_marginLeft="50dip"
android:visibility="gone" />
</RelativeLayout>
<!-- picture -->
<com.todoroo.astrid.helper.AsyncImageView
android:id="@+id/comment_picture"
android:layout_width="50dip"
android:layout_height="50dip"
android:layout_alignParentBottom="true"
android:layout_marginLeft="5dip"
android:layout_marginBottom="4dip"
android:visibility="gone"
astrid:defaultSrc="@android:drawable/ic_menu_gallery"
android:scaleType="fitCenter"/>
</LinearLayout>

@ -72,7 +72,10 @@
<!-- show comments in task edit -->
<string name="p_show_task_edit_comments">p_show_task_edit_comments</string>
<!-- show caption of comments in task edit -->
<string name="p_show_caption_comments">p_show_caption_comments</string>
<!-- show save and cancel buttons in task edit -->
<string name="p_save_and_cancel">p_save_and_cancel</string>

Loading…
Cancel
Save