Fixed some layout issues and polish

pull/14/head
Sam Bosley 13 years ago
parent b2b28b6bd3
commit 15ead00e63

@ -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);

@ -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<UpdatesChangedListener> listeners = new LinkedList<UpdatesChangedListener>();
@ -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();

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:state_enabled="true"
android:state_focused="false" android:drawable="@drawable/camera_button_gray" />
<item android:state_pressed="true" android:state_enabled="true"
android:drawable="@drawable/camera_button_red" />
<item android:state_pressed="false" android:state_enabled="true"
android:state_focused="true" android:drawable="@drawable/camera_button_red" />
</selector>

@ -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" >
<TextView
android:id="@+id/spacer"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_weight="0.5" />
<Button
android:id="@+id/gg_login"
android:layout_width="match_parent"
@ -106,21 +100,15 @@
android:layout_gravity="center_horizontal" />
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="0.5"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/notice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:gravity="center"
android:text="@string/actfm_ALA_notice"
android:textColor="#cccccc"
android:textSize="12sp" />
android:id="@+id/tos"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:layout_above="@id/gg_login"
android:gravity="center"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:textSize="12.5sp"
android:textColor="#ffffff" />
</LinearLayout>
</LinearLayout>

@ -65,7 +65,7 @@
android:paddingLeft="7dip"
android:paddingRight="7dip"
android:scaleType="centerInside"
android:src="@drawable/camera_button" />
android:src="?attr/asCameraButtonImg" />
<!-- Quick Add Task -->

@ -122,9 +122,11 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:minHeight="47dip"
android:minHeight="50dip"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="3dip" >
android:padding="3dip"
android:paddingBottom="5dip">
<!-- Voice Add Button -->
@ -140,16 +142,17 @@
android:paddingLeft="7dip"
android:paddingRight="7dip"
android:scaleType="centerInside"
android:src="@drawable/camera_button" />
android:src="?attr/asCameraButtonImg" />
<!-- Quick Add Task -->
<EditText
android:id="@+id/commentField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="39dip"
android:layout_marginLeft="1dip"
android:layout_marginRight="1dip"
android:layout_marginBottom="2dip"
android:layout_weight="100"
android:autoText="true"
android:background="@drawable/footer_comment_edittext"

@ -22,10 +22,11 @@
android:id="@+id/taskListFooter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="47dip"
android:minHeight="50dip"
android:layout_weight="1"
android:padding="3dip"
android:layout_marginBottom="5dip"
android:paddingBottom="5dip"
android:gravity="center_vertical"
android:orientation="horizontal"
style="@style/Content">
@ -50,6 +51,7 @@
android:layout_height="39dip"
android:layout_marginRight="8dip"
android:layout_marginLeft="5dip"
android:layout_marginBottom="2dip"
android:layout_weight="100"
android:paddingLeft="5dip"
android:background="@drawable/edit_title_background"

Loading…
Cancel
Save