diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java index a09f22925..065140dcf 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java @@ -7,6 +7,7 @@ import android.graphics.Bitmap; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; +import android.util.TypedValue; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; @@ -125,7 +126,7 @@ public class TagUpdatesActivity extends ListActivity { @Override public void clearImage() { picture = null; - pictureButton.setImageResource(R.drawable.camera_button); + resetPictureButton(); } }; pictureButton = (ImageButton) findViewById(R.id.picture); @@ -143,6 +144,12 @@ public class TagUpdatesActivity extends ListActivity { refreshActivity(false); // start a pull in the background } + private void resetPictureButton() { + TypedValue tv = new TypedValue(); + getTheme().resolveAttribute(R.attr.asCameraButtonImg, tv, false); + pictureButton.setImageResource(tv.data); + } + private void refreshUpdatesList() { if(!actFmPreferenceService.isLoggedIn() || tagData.getValue(Task.REMOTE_ID) <= 0) @@ -246,7 +253,8 @@ public class TagUpdatesActivity extends ListActivity { }.start(); addCommentField.setText(""); //$NON-NLS-1$ picture = null; - pictureButton.setImageResource(R.drawable.camera_button); + + resetPictureButton(); refreshUpdatesList(); StatisticsService.reportEvent(StatisticsConstants.ACTFM_TAG_COMMENT); diff --git a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java index 61b635c85..efc52d207 100644 --- a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java @@ -23,6 +23,7 @@ import android.text.TextWatcher; import android.text.format.DateUtils; import android.text.util.Linkify; import android.util.Log; +import android.util.TypedValue; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; @@ -89,6 +90,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene private Bitmap pendingCommentPicture = null; private final Fragment fragment; private final ImageCache imageCache; + private final int cameraButton; private final List listeners = new LinkedList(); @@ -103,6 +105,8 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene imageCache = ImageCache.getInstance(fragment.getActivity()); this.fragment = fragment; + cameraButton = getDefaultCameraButton(); + DependencyInjectionService.getInstance().inject(this); setOrientation(VERTICAL); @@ -112,6 +116,12 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene loadViewForTaskID(t); } + private int getDefaultCameraButton() { + TypedValue tv = new TypedValue(); + fragment.getActivity().getTheme().resolveAttribute(R.attr.asCameraButtonImg, tv, false); + return tv.data; + } + public void loadViewForTaskID(long t){ task = PluginServices.getTaskService().fetchById(t, Task.NOTES, Task.ID, Task.REMOTE_ID, Task.TITLE); @@ -203,7 +213,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene @Override public void clearImage() { pendingCommentPicture = null; - pictureButton.setImageResource(R.drawable.camera_button); + pictureButton.setImageResource(cameraButton); } }; pictureButton = (ImageButton) commentsBar.findViewById(R.id.picture); @@ -458,7 +468,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene commentField.setText(""); //$NON-NLS-1$ pendingCommentPicture = usePicture ? null : pendingCommentPicture; - pictureButton.setImageResource(R.drawable.camera_button); + pictureButton.setImageResource(cameraButton); StatisticsService.reportEvent(StatisticsConstants.ACTFM_TASK_COMMENT); setUpListAdapter(); diff --git a/astrid/res/drawable/camera_button.xml b/astrid/res/drawable/camera_button.xml deleted file mode 100644 index 22686841d..000000000 --- a/astrid/res/drawable/camera_button.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/astrid/res/layout-land/actfm_login_activity.xml b/astrid/res/layout-land/actfm_login_activity.xml index 7ad5f8870..afab78c17 100644 --- a/astrid/res/layout-land/actfm_login_activity.xml +++ b/astrid/res/layout-land/actfm_login_activity.xml @@ -57,15 +57,9 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="50" + android:gravity="center_vertical" android:paddingTop="5dip" > - -