diff --git a/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java b/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java index 515840fa..f75e1819 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java @@ -19,6 +19,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; +import android.widget.ImageView; import android.widget.TextView; import com.etesync.syncadapter.App; @@ -29,7 +30,6 @@ import com.etesync.syncadapter.model.JournalEntity; import com.etesync.syncadapter.model.JournalModel; import java.util.List; -import java.util.Locale; import io.requery.Persistable; import io.requery.sql.EntityDataStore; @@ -126,13 +126,26 @@ public class ListEntriesFragment extends ListFragment implements AdapterView.OnI } String content = getLine(fullContent, prefix); content = (content != null) ? content : entryEntity.getUid().substring(0, 20); - tv.setText(String.format(Locale.getDefault(), "%s: %s", entryEntity.getContent().getAction().toString(), content)); + tv.setText(content); tv = (TextView) v.findViewById(R.id.description); content = getLine(fullContent, "UID:"); content = "UID: " + ((content != null) ? content : "Not found"); tv.setText(content); + ImageView action = (ImageView) v.findViewById(R.id.action); + switch (entryEntity.getContent().getAction()) { + case ADD: + action.setImageResource(R.drawable.action_add); + break; + case CHANGE: + action.setImageResource(R.drawable.action_change); + break; + case DELETE: + action.setImageResource(R.drawable.action_delete); + break; + } + return v; } } diff --git a/app/src/main/res/drawable/action_add.xml b/app/src/main/res/drawable/action_add.xml new file mode 100644 index 00000000..89d2df2e --- /dev/null +++ b/app/src/main/res/drawable/action_add.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/app/src/main/res/drawable/action_change.xml b/app/src/main/res/drawable/action_change.xml new file mode 100644 index 00000000..1b65f3df --- /dev/null +++ b/app/src/main/res/drawable/action_change.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/action_delete.xml b/app/src/main/res/drawable/action_delete.xml new file mode 100644 index 00000000..a789c3fb --- /dev/null +++ b/app/src/main/res/drawable/action_delete.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/journal_viewer_list_item.xml b/app/src/main/res/layout/journal_viewer_list_item.xml index ffc456d7..d8dbffc5 100644 --- a/app/src/main/res/layout/journal_viewer_list_item.xml +++ b/app/src/main/res/layout/journal_viewer_list_item.xml @@ -7,6 +7,11 @@ android:padding="8dp" android:gravity="center_vertical"> + +