From 44f8c82d9a8db84b6b2904f58e6873b35d9c9211 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Tue, 31 Jan 2012 23:00:49 -0800 Subject: [PATCH] Make the edit tab text color the right color. Get rid of empty activities. You know, polish stuff --- .../astrid/notes/EditNoteActivity.java | 22 ++++++++++++------ .../custom_tab_indicator_dark_selected.9.png | Bin 174 -> 174 bytes astrid/res/layout/task_edit_activity.xml | 2 +- astrid/res/values/styles.xml | 3 +-- .../library/res/layout/vpi__tab.xml | 1 + 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java index c610e3dc5..61b635c85 100644 --- a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java @@ -162,9 +162,12 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene commentField.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { - commentButton.setVisibility((s.length() > 0 || pendingCommentPicture != null) ? View.VISIBLE : View.GONE); - timerView.setVisibility((s.length() > 0 || pendingCommentPicture != null) ? View.GONE : View.VISIBLE); + commentButton.setVisibility((s.length() > 0 || pendingCommentPicture != null) ? View.VISIBLE + : View.GONE); + timerView.setVisibility((s.length() > 0 || pendingCommentPicture != null) ? View.GONE + : View.VISIBLE); } + @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // @@ -221,11 +224,10 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene notes.setPadding(5, 10, 5, 10); Linkify.addLinks(notes, Linkify.ALL); } + //TODO add loading text back in // loadingText = (TextView) findViewById(R.id.loading); loadingText = new TextView(getContext()); - - } private void setUpListAdapter() { @@ -252,7 +254,9 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene Update update = new Update(); for(updates.moveToFirst(); !updates.isAfterLast(); updates.moveToNext()) { update.readFromCursor(updates); - items.add(NoteOrUpdate.fromUpdate(update)); + NoteOrUpdate noa = NoteOrUpdate.fromUpdate(update); + if(noa != null) + items.add(noa); } } finally { updates.close(); @@ -509,6 +513,10 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene description += " " + message; else description = message; + + if(TextUtils.isEmpty(description)) + return null; + String commentPicture = u.getValue(Update.PICTURE); return new NoteOrUpdate(user.optString("picture"), @@ -565,8 +573,8 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene } }; - return (ActFmCameraModule.activityResult((Activity)getContext(), requestCode, resultCode, data, callback)); - //Handled + return (ActFmCameraModule.activityResult((Activity)getContext(), + requestCode, resultCode, data, callback)); } } diff --git a/astrid/res/drawable/custom_tab_indicator_dark_selected.9.png b/astrid/res/drawable/custom_tab_indicator_dark_selected.9.png index 4a5ff4d151a0cbd3a6f8a3136cbea43bcd72069e..1046299fa990a780e171d626649c37837df4a8ea 100644 GIT binary patch delta 83 zcmV-Z0IdJ60j>d%VoWs_IXp?E0000kNkld%VoV|*MPqfA0000kNkl + android:visibility="gone"> - ?attr/asEditTabBackground - #FFFF00FF