For small screens, don't let save and cancel buttons hover over in task edit, have them on each tab

pull/14/head
Sam Bosley 13 years ago
parent 2183d5c04a
commit d039f9cb2c

@ -91,6 +91,7 @@ public class RepeatTaskCompleteListener extends BroadcastReceiver {
clone.setValue(Task.ELAPSED_SECONDS, 0);
clone.setValue(Task.REMINDER_SNOOZE, 0L);
clone.setValue(Task.REMINDER_LAST, 0L);
clone.setValue(Task.CALENDAR_URI, ""); //$NON-NLS-1$
GCalHelper.createTaskEventIfEnabled(clone);
PluginServices.getTaskService().save(clone);
@ -99,7 +100,6 @@ public class RepeatTaskCompleteListener extends BroadcastReceiver {
task.setValue(Task.RECURRENCE, ""); //$NON-NLS-1$
task.setValue(Task.DETAILS_DATE, 0L);
GCalHelper.deleteTaskEvent(task);
PluginServices.getTaskService().save(task);
// send a broadcast

@ -0,0 +1,523 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:astrid="http://schemas.android.com/apk/res/com.timsu.astrid"
android:id="@+id/taskEditParent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
style="@style/Content">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:background="@color/task_edit_selected" />
<!-- ======================================================= tab: basic == -->
<ScrollView
android:id="@+id/tab_basic"
android:layout_above="@id/edit_footer"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:padding="4dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- title -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_title_label"
style="@style/TextAppearance.GEN_EditLabel" />
<com.todoroo.astrid.ui.ErrorCatchingEditText
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/TEA_title_hint"
android:autoText="true"
android:text=""
android:capitalize="sentences"
android:freezesText="true"/>
<!-- importance -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_importance_label"
style="@style/TextAppearance.GEN_EditLabel" />
<LinearLayout
android:id="@+id/importance_container"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</LinearLayout>
<!-- urgency -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_urgency_label"
style="@style/TextAppearance.GEN_EditLabel" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/urgency_date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="@drawable/gl_date" />
<Button
android:id="@+id/urgency_time"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="@drawable/gl_time" />
</LinearLayout>
<!-- add-ons -->
<LinearLayout
android:id="@+id/addons_urgency"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!-- tags -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_tags_label"
style="@style/TextAppearance.GEN_EditLabel" />
<LinearLayout
android:id="@+id/tags_container"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/tags_dropdown"
android:paddingBottom="5dip"
android:entries="@array/TEA_loading"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<!-- notes -->
<TextView
android:id="@+id/notes_label"
android:paddingTop="5dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_note_label"
style="@style/TextAppearance.GEN_EditLabel" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<!-- Voice Add Note Button -->
<ImageButton
android:id="@+id/voiceAddNoteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/tango_microphone"
android:scaleType="fitCenter"
android:visibility="gone" />
<EditText
android:id="@+id/notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="100"
android:scrollbars="vertical"
android:gravity="top"
android:hint="@string/TEA_notes_hint"
android:autoText="true"
android:capitalize="sentences"
android:singleLine="false"
android:freezesText="true" />
</LinearLayout>
<!-- buttons -->
<LinearLayout android:id="@+id/edit_footer"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:layout_marginTop="7dip"
android:layout_alignParentBottom="true"
android:padding="5dip"
android:background="@drawable/footer_background"
android:baselineAligned="false">
<Button
android:id="@+id/save"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="5dip"
android:background="@drawable/footer_greenbtn"
android:text="@string/DLG_save"
android:textStyle="bold"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
<Button
android:id="@+id/discard"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dip"
android:background="@drawable/footer_redbtn"
android:text="@android:string/cancel"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<!-- ===================================================== tab: sharing == -->
<ScrollView
android:id="@+id/tab_share"
android:layout_above="@id/edit_footer"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:padding="4dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dip"
style="@style/TextAppearance.GEN_EditLabel"
android:text="@string/actfm_EPA_assign_label" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Spinner
android:id="@+id/assigned_spinner"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:hint="@string/actfm_person_hint" />
<com.todoroo.astrid.ui.ContactsAutoComplete
android:id="@+id/assigned_custom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:visibility="gone"
android:hint="@string/actfm_person_hint" />
<ImageButton
android:id="@+id/assigned_clear"
style="?android:attr/buttonStyleInset"
android:src="@android:drawable/ic_delete"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginTop="2dip"
android:layout_marginRight="2dip"
android:layout_marginBottom="2dip"
android:visibility="gone"
android:gravity="center_vertical" />
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="5dip"
android:paddingBottom="5dip"
style="@style/TextAppearance.GEN_EditLabel"
android:text="@string/actfm_EPA_share_with" />
<com.todoroo.astrid.ui.PeopleContainer
android:id="@+id/share_container"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/share_additional"
android:orientation="vertical"
android:padding="5dip"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@android:drawable/divider_horizontal_dark" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:text="@string/actfm_EPA_message_text" />
<EditText
android:id="@+id/message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:text="@string/actfm_EPA_message_body"
android:autoText="true"
android:capitalize="sentences"
android:singleLine="false" />
<TextView
android:id="@+id/tag_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dip"
android:visibility="gone"
android:text="@string/actfm_EPA_tag_label" />
<EditText
android:id="@+id/tag_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:hint="@string/actfm_EPA_tag_hint" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@android:drawable/divider_horizontal_dark" />
</LinearLayout>
<LinearLayout
android:id="@+id/collaborators"
android:orientation="vertical"
android:padding="5dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<CheckBox
style="@style/TextAppearance.GEN_EditLabel"
android:id="@+id/checkbox_facebook"
android:text="@string/actfm_EPA_facebook"
android:paddingLeft="45dip"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<CheckBox
style="@style/TextAppearance.GEN_EditLabel"
android:id="@+id/checkbox_twitter"
android:text="@string/actfm_EPA_twitter"
android:paddingLeft="45dip"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_margin="15dip"
android:background="@android:drawable/divider_horizontal_dark" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="15dip"
android:text="@string/actfm_EPA_intro"
android:gravity="center"
android:textColor="#ee9900" />
<LinearLayout android:id="@+id/edit_footer2"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:layout_marginTop="7dip"
android:layout_alignParentBottom="true"
android:padding="5dip"
android:background="@drawable/footer_background"
android:baselineAligned="false">
<Button
android:id="@+id/save2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="5dip"
android:background="@drawable/footer_greenbtn"
android:text="@string/DLG_save"
android:textStyle="bold"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
<Button
android:id="@+id/discard2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dip"
android:background="@drawable/footer_redbtn"
android:text="@android:string/cancel"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<!-- ====================================================== tab: alarms == -->
<ScrollView
android:id="@+id/tab_alarms"
android:layout_above="@id/edit_footer"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:padding="4dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- reminders -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_reminder_label"
style="@style/TextAppearance.GEN_EditLabel" />
<CheckBox
style="@style/TextAppearance.GEN_EditLabel"
android:id="@+id/reminder_due"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:button="@drawable/btn_check_small"
android:text="@string/TEA_reminder_due" />
<CheckBox
style="@style/TextAppearance.GEN_EditLabel"
android:id="@+id/reminder_overdue"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:button="@drawable/btn_check_small"
android:text="@string/TEA_reminder_overdue" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox
style="@style/TextAppearance.GEN_EditLabel"
android:id="@+id/reminder_random"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:button="@drawable/btn_check_small"
android:text="@string/TEA_reminder_random" />
<Spinner
android:id="@+id/reminder_random_interval"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- reminder mode -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_reminder_alarm_label"
style="@style/TextAppearance.GEN_EditLabel" />
<Spinner
android:id="@+id/reminder_alarm"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<!-- add-ons -->
<LinearLayout
android:id="@+id/addons_alarms"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout android:id="@+id/edit_footer3"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:layout_marginTop="7dip"
android:layout_alignParentBottom="true"
android:padding="5dip"
android:background="@drawable/footer_background"
android:baselineAligned="false">
<Button
android:id="@+id/save3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="5dip"
android:background="@drawable/footer_greenbtn"
android:text="@string/DLG_save"
android:textStyle="bold"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
<Button
android:id="@+id/discard3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dip"
android:background="@drawable/footer_redbtn"
android:text="@android:string/cancel"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<!-- ======================================================= tab: more == -->
<ScrollView
android:id="@+id/tab_more"
android:layout_above="@id/edit_footer"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:padding="4dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- hide until -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/TEA_hideUntil_label"
style="@style/TextAppearance.GEN_EditLabel" />
<Spinner
android:id="@+id/hideUntil"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<!-- add-ons -->
<LinearLayout
android:id="@+id/addons_more"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/addons_empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100"
android:gravity="center"
android:visibility="gone"
android:orientation="vertical">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="20dip"
android:src="@drawable/icon_pp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/TEA_addons_text"
android:padding="10dip"
android:gravity="center"
style="@style/TextAppearance.TLA_NoItems" />
<Button
android:id="@+id/addons_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
android:text="@string/TEA_addons_button" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:id="@+id/edit_footer4"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="48dip"
android:layout_marginTop="7dip"
android:layout_alignParentBottom="true"
android:padding="5dip"
android:background="@drawable/footer_background"
android:baselineAligned="false">
<Button
android:id="@+id/save4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="5dip"
android:background="@drawable/footer_greenbtn"
android:text="@string/DLG_save"
android:textStyle="bold"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
<Button
android:id="@+id/discard4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dip"
android:background="@drawable/footer_redbtn"
android:text="@android:string/cancel"
style="@style/TextAppearance.TEA_action"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>

@ -73,10 +73,17 @@ public class AddOnActivity extends TabActivity {
ArrayList<AddOn> available = new ArrayList<AddOn>();
for(AddOn addOn : list) {
if(addOnService.isInstalled(addOn))
installed.add(addOn);
else
available.add(addOn);
if (AddOnService.POWER_PACK_PACKAGE.equals(addOn.getPackageName())) {
if (addOnService.hasPowerPack())
installed.add(addOn);
else
available.add(addOn);
} else {
if(addOnService.isInstalled(addOn))
installed.add(addOn);
else
available.add(addOn);
}
}
if(installed.size() == 0 || getIntent().getBooleanExtra(TOKEN_START_WITH_AVAILABLE, false))
getTabHost().setCurrentTab(1);

@ -309,8 +309,35 @@ public final class TaskEditActivity extends TabActivity {
Button saveButtonGeneral = (Button) findViewById(R.id.save);
saveButtonGeneral.setOnClickListener(mSaveListener);
Button saveButton2 = (Button) findViewById(R.id.save2);
Button saveButton3 = (Button) findViewById(R.id.save3);
Button saveButton4 = (Button) findViewById(R.id.save4);
if (saveButton2 != null) {
saveButton2.setOnClickListener(mSaveListener);
}
if (saveButton3 != null) {
saveButton3.setOnClickListener(mSaveListener);
}
if (saveButton4 != null) {
saveButton4.setOnClickListener(mSaveListener);
}
Button discardButtonGeneral = (Button) findViewById(R.id.discard);
discardButtonGeneral.setOnClickListener(mDiscardListener);
Button discardButton2 = (Button) findViewById(R.id.discard2);
Button discardButton3 = (Button) findViewById(R.id.discard3);
Button discardButton4 = (Button) findViewById(R.id.discard4);
if (discardButton2 != null) {
discardButton2.setOnClickListener(mDiscardListener);
}
if (discardButton3 != null) {
discardButton3.setOnClickListener(mDiscardListener);
}
if (discardButton4 != null) {
discardButton4.setOnClickListener(mDiscardListener);
}
} catch (Exception e) {
// error loading the proper activity
}

@ -16,9 +16,14 @@ import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Join;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.provider.Astrid2TaskProvider;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.utility.AstridPreferences;
/**
* Data Access layer for {@link Metadata}-related operations.
@ -68,6 +73,12 @@ public class MetadataDao extends DatabaseDao<Metadata> {
item.setValue(Metadata.CREATION_DATE, DateUtilities.now());
boolean state = super.persist(item);
if(Preferences.getBoolean(AstridPreferences.P_FIRST_LIST, false)) {
if (state && item.getValue(Metadata.KEY).equals(TagService.KEY)) {
StatisticsService.reportEvent(StatisticsConstants.USER_FIRST_LIST);
Preferences.setBoolean(AstridPreferences.P_FIRST_LIST, false);
}
}
Astrid2TaskProvider.notifyDatabaseModification();
return state;
}

@ -215,6 +215,7 @@ public class StartupService {
for(int i = 0; i < INTRO_TASKS.length; i += 3)
addIntroTask(r, INTRO_TASKS[i], INTRO_TASKS[i + 1], INTRO_TASKS[i + 2]);
Preferences.setBoolean(AstridPreferences.P_FIRST_ACTION, true);
Preferences.setBoolean(AstridPreferences.P_FIRST_LIST, true);
}
}).start();
} catch (Exception e) {

@ -8,6 +8,7 @@ public class StatisticsConstants {
public static final String ACTFM_NEW_USER = "actfm-new-user";
public static final String TASK_COMPLETED_V2 = "task-completed-v2";
public static final String USER_FIRST_TASK = "user-first-task";
public static final String USER_FIRST_LIST = "user-first-list";
public static final String LOST_TASKS_RESTORED = "lost-tasks-restored";
public static final String CREATE_TASK = "create-task";
public static final String EDIT_TASK = "edit-task";

@ -17,6 +17,8 @@ public class AstridPreferences {
public static final String P_FIRST_ACTION = "fa"; //$NON-NLS-1$
public static final String P_FIRST_LIST = "fl"; //$NON-NLS-1$
public static final String P_UPGRADE_FROM = "uf"; //$NON-NLS-1$
/** Set preference defaults, if unset. called at startup */

Loading…
Cancel
Save