New check button, comments in task edit header

pull/14/head
Sam Bosley 13 years ago
parent 7f9f9f7634
commit c45360c415

@ -18,18 +18,18 @@
<!-- Enabled states -->
<item android:state_checked="true" android:state_pressed="true"
<!-- <item android:state_checked="true" android:state_pressed="true"
android:state_enabled="true"
android:drawable="@drawable/btn_check_pressed" />
<item android:state_checked="false" android:state_pressed="true"
android:state_enabled="true"
android:drawable="@drawable/btn_check_pressed" />
android:drawable="@drawable/btn_check_pressed" /> -->
<item android:state_checked="false"
android:state_enabled="true"
android:drawable="@drawable/btn_check_off" />
android:drawable="@drawable/icn_check_off" />
<item android:state_checked="true"
android:state_enabled="true"
android:drawable="@drawable/btn_check_on" />
android:drawable="@drawable/icn_check_on" />
</selector>

@ -15,6 +15,7 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="100"
android:background="@drawable/edit_title_background">
<ImageView
android:id="@+id/importance"

@ -7,6 +7,66 @@
android:layout_height="fill_parent"
style="@style/Content">
<!-- Header -->
<LinearLayout
android:id="@+id/edit_header"
android:layout_width="fill_parent"
android:layout_height="43dip"
android:layout_weight="1"
android:orientation="horizontal"
android:layout_alignParentTop="true">
<LinearLayout
style="@style/Header"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal">
<!-- Header Logo -->
<ImageView android:id="@+id/headerLogo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100"
android:gravity="center"
android:paddingRight="43dip"
android:src="@drawable/header_logo_new"
android:scaleType="center"
android:visibility="gone"/>
<!-- List Label -->
<TextView android:id="@+id/taskLabel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100"
android:singleLine="true"
android:ellipsize="end"
android:gravity="center"
style="@style/TextAppearance.TLA_Header"/>
</LinearLayout>
<LinearLayout android:id="@+id/activityContainer"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:visibility="gone">
<View
android:layout_width="0.5dip"
android:layout_height="fill_parent"
android:background="#ff222222"/>
<ImageView android:id="@+id/activity"
android:layout_height="fill_parent"
android:layout_width="43dip"
android:background="?attr/asHeaderButtonBackground"
android:padding="7dip"
android:src="@drawable/icn_cmmt_off"
android:scaleType="fitCenter" />
</LinearLayout>
</LinearLayout>
<!-- buttons -->
<LinearLayout android:id="@+id/edit_footer"
android:orientation="horizontal"
@ -40,6 +100,7 @@
<ScrollView
android:id="@+id/edit_scroll"
android:layout_below="@id/edit_header"
android:layout_above="@id/edit_footer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"

@ -242,7 +242,7 @@
<string name="TEA_view_title">Astrid: Editing \'%s\'</string>
<!-- Title when creating a new task -->
<string name="TEA_view_titleNew">Astrid: New Task</string>
<string name="TEA_view_titleNew">New Task</string>
<!-- First Tab - basic task details -->
<string name="TEA_tab_basic">Basic</string>

@ -32,7 +32,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.text.TextUtils;
@ -43,6 +42,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
@ -61,11 +61,14 @@ import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.EditPeopleControlSet;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gcal.GCalControlSet;
import com.todoroo.astrid.helper.TaskEditControlSet;
import com.todoroo.astrid.notes.EditNoteActivity;
import com.todoroo.astrid.notes.NotesPlugin;
import com.todoroo.astrid.opencrx.OpencrxControlSet;
import com.todoroo.astrid.opencrx.OpencrxCoreUtils;
import com.todoroo.astrid.producteev.ProducteevControlSet;
@ -164,6 +167,9 @@ public final class TaskEditActivity extends Activity {
@Autowired
private AddOnService addOnService;
@Autowired
private ActFmPreferenceService actFmPreferenceService;
// --- UI components
private ImageButton voiceAddNoteButton;
@ -209,6 +215,7 @@ public final class TaskEditActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeService.applyTheme(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
new StartupService().onStartupApplication(this);
@ -235,10 +242,8 @@ public final class TaskEditActivity extends Activity {
/** Initialize UI components */
private void setUpUIComponents() {
setContentView(R.layout.task_edit_activity_new);
scrollView = (ScrollView) findViewById(R.id.edit_scroll);
LinearLayout basicControls = (LinearLayout) findViewById(R.id.basic_controls);
LinearLayout whenDialogView = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.task_edit_when_controls, null);
LinearLayout whenControls = (LinearLayout) whenDialogView.findViewById(R.id.when_controls);
@ -414,6 +419,15 @@ public final class TaskEditActivity extends Activity {
findViewById(R.id.when_header).setOnClickListener(mExpandWhenListener);
findViewById(R.id.more_header).setOnClickListener(mExpandMoreListener);
findViewById(R.id.activity).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent launchIntent = new Intent(TaskEditActivity.this, EditNoteActivity.class);
launchIntent.putExtra(EditNoteActivity.EXTRA_TASK_ID, model.getId());
startActivity(launchIntent);
}
});
} catch (Exception e) {
// error loading the proper activity
}
@ -557,19 +571,25 @@ public final class TaskEditActivity extends Activity {
return;
}
if (!isNewTask) {
if (actFmPreferenceService.isLoggedIn() || NotesPlugin.hasNotes(model)) {
findViewById(R.id.activityContainer).setVisibility(View.VISIBLE);
}
}
// clear notification
Notifications.cancelNotifications(model.getId());
}
/** Populate UI component values from the model */
private void populateFields() {
Resources r = getResources();
loadItem(getIntent());
TextView titleText = (TextView) findViewById(R.id.taskLabel);
if(isNewTask)
setTitle(R.string.TEA_view_titleNew);
titleText.setText(R.string.TEA_view_titleNew);
else
setTitle(r.getString(R.string.TEA_view_title, model.getValue(Task.TITLE)));
titleText.setText(model.getValue(Task.TITLE));
synchronized(controls) {
for(TaskEditControlSet controlSet : controls)

Loading…
Cancel
Save