mirror of https://github.com/tasks/tasks
Added fragment-version of TaskEditActivity, callbacks not ready yet.
parent
e9913eac56
commit
1d60b42138
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.FilterListActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/filterlist_fragment"
|
||||
android:layout_weight="33">
|
||||
<!-- Preview: layout=@layout/filter_list_activity -->
|
||||
</fragment>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskListActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/tasklist_fragment"
|
||||
android:layout_weight="33">
|
||||
<!-- Preview: layout=@layout/task_list_activity -->
|
||||
</fragment>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskEditActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/taskedit_fragment"
|
||||
android:layout_weight="33">
|
||||
<!-- Preview: layout=@layout/task_edit_activity -->
|
||||
</fragment>
|
||||
</LinearLayout>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.FilterListActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/filterlist_fragment">
|
||||
</fragment>
|
@ -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>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskEditActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/taskedit_fragment">
|
||||
</fragment>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskListActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/tasklist_fragment">
|
||||
</fragment>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.FilterListActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/filterlist_fragment">
|
||||
</fragment>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskEditActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/taskedit_fragment">
|
||||
</fragment>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskListActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/tasklist_fragment">
|
||||
</fragment>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.todoroo.astrid.activity.TaskEditActivity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/taskedit_fragment">
|
||||
</fragment>
|
@ -1,460 +0,0 @@
|
||||
package com.todoroo.astrid.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.PendingIntent.CanceledException;
|
||||
import android.app.SearchManager;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.OnEditorActionListener;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.andlib.service.Autowired;
|
||||
import com.todoroo.andlib.service.DependencyInjectionService;
|
||||
import com.todoroo.andlib.service.ExceptionService;
|
||||
import com.todoroo.andlib.sql.Functions;
|
||||
import com.todoroo.andlib.sql.QueryTemplate;
|
||||
import com.todoroo.andlib.utility.AndroidUtilities;
|
||||
import com.todoroo.astrid.adapter.FilterAdapter;
|
||||
import com.todoroo.astrid.api.Filter;
|
||||
import com.todoroo.astrid.api.FilterCategory;
|
||||
import com.todoroo.astrid.api.FilterListItem;
|
||||
import com.todoroo.astrid.api.FilterWithCustomIntent;
|
||||
import com.todoroo.astrid.api.IntentFilter;
|
||||
import com.todoroo.astrid.core.SearchFilter;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
import com.todoroo.astrid.service.StartupService;
|
||||
import com.todoroo.astrid.service.StatisticsService;
|
||||
import com.todoroo.astrid.service.ThemeService;
|
||||
|
||||
public class FilterListFragment extends ExpandableListFragment {
|
||||
|
||||
// --- menu codes
|
||||
|
||||
private static final int MENU_SEARCH_ID = R.string.FLA_menu_search;
|
||||
private static final int MENU_HELP_ID = R.string.FLA_menu_help;
|
||||
|
||||
private static final int CONTEXT_MENU_SHORTCUT = R.string.FLA_context_shortcut;
|
||||
private static final int CONTEXT_MENU_INTENT = Menu.FIRST + 3;
|
||||
|
||||
private static final int REQUEST_CUSTOM_INTENT = 1;
|
||||
|
||||
// --- instance variables
|
||||
|
||||
@Autowired
|
||||
protected ExceptionService exceptionService;
|
||||
|
||||
FilterAdapter adapter = null;
|
||||
private boolean mDualPane;
|
||||
|
||||
/* ======================================================================
|
||||
* ======================================================= initialization
|
||||
* ====================================================================== */
|
||||
|
||||
public FilterListFragment() {
|
||||
DependencyInjectionService.getInstance().inject(this);
|
||||
}
|
||||
|
||||
/** Called when loading up the activity */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Tell the framework to try to keep this fragment around
|
||||
// during a configuration change.
|
||||
setRetainInstance(true);
|
||||
|
||||
new StartupService().onStartupApplication(getActivity());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.todoroo.astrid.fragment.ExpandableListFragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
|
||||
*/
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
ViewGroup parent = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.filter_list_activity, container, false);
|
||||
ThemeService.applyTheme(parent);
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
getActivity().setDefaultKeyMode(Activity.DEFAULT_KEYS_SEARCH_LOCAL);
|
||||
// We have a menu item to show in action bar.
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
onContentChanged();
|
||||
|
||||
onNewIntent(getActivity().getIntent());
|
||||
|
||||
Fragment tasklistFrame = getFragmentManager().findFragmentById(R.id.tasklist_fragment);
|
||||
mDualPane = (tasklistFrame != null) && tasklistFrame.isInLayout();
|
||||
|
||||
if (mDualPane) {
|
||||
// In dual-pane mode, the list view highlights the selected item.
|
||||
getExpandableListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
}
|
||||
|
||||
// dithering
|
||||
getActivity().getWindow().setFormat(PixelFormat.RGBA_8888);
|
||||
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when receiving a new intent. Intents this class handles:
|
||||
* <ul>
|
||||
* <li>ACTION_SEARCH - displays a search bar
|
||||
* <li>ACTION_ADD_LIST - adds new lists to the merge adapter
|
||||
* </ul>
|
||||
*/
|
||||
public void onNewIntent(Intent intent) {
|
||||
final String intentAction = intent.getAction();
|
||||
if (Intent.ACTION_SEARCH.equals(intentAction)) {
|
||||
String query = intent.getStringExtra(SearchManager.QUERY).trim();
|
||||
Filter filter = new Filter(null, getString(R.string.FLA_search_filter, query),
|
||||
new QueryTemplate().where(Functions.upper(Task.TITLE).like("%" + //$NON-NLS-1$
|
||||
query.toUpperCase() + "%")), //$NON-NLS-1$
|
||||
null);
|
||||
intent = new Intent(getActivity(), TaskListActivity.class);
|
||||
intent.putExtra(TaskListFragment.TOKEN_FILTER, filter);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
setUpList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create options menu (displayed when user presses menu key)
|
||||
*
|
||||
* @return true if menu should be displayed
|
||||
*/
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
MenuItem item;
|
||||
|
||||
item = menu.add(Menu.NONE, MENU_SEARCH_ID, Menu.NONE,
|
||||
R.string.FLA_menu_search);
|
||||
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||
item.setIcon(android.R.drawable.ic_menu_search);
|
||||
|
||||
item = menu.add(Menu.NONE, MENU_HELP_ID, 1,
|
||||
R.string.FLA_menu_help);
|
||||
item.setIcon(android.R.drawable.ic_menu_help);
|
||||
}
|
||||
|
||||
/* ======================================================================
|
||||
* ============================================================ lifecycle
|
||||
* ====================================================================== */
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
StatisticsService.sessionStart(getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
StatisticsService.sessionStop(getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if(adapter != null)
|
||||
adapter.registerRecevier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if(adapter != null)
|
||||
adapter.unregisterRecevier();
|
||||
}
|
||||
|
||||
/* ======================================================================
|
||||
* ===================================================== populating lists
|
||||
* ====================================================================== */
|
||||
|
||||
/** Sets up the coach list adapter */
|
||||
protected void setUpList() {
|
||||
adapter = new FilterAdapter(getActivity(), getExpandableListView(),
|
||||
R.layout.filter_adapter_row, false);
|
||||
setListAdapter(adapter);
|
||||
|
||||
registerForContextMenu(getExpandableListView());
|
||||
}
|
||||
|
||||
/* ======================================================================
|
||||
* ============================================================== actions
|
||||
* ====================================================================== */
|
||||
|
||||
/**
|
||||
* Handles items being clicked. Return true if item is handled.
|
||||
*/
|
||||
protected boolean onItemClicked(FilterListItem item) {
|
||||
if(item instanceof Filter) {
|
||||
|
||||
Filter filter = (Filter)item;
|
||||
Intent intent = new Intent(getActivity(), TaskListActivity.class);
|
||||
intent.putExtra(TaskListFragment.TOKEN_FILTER, filter);
|
||||
if(filter instanceof FilterWithCustomIntent) {
|
||||
FilterWithCustomIntent customFilter = ((FilterWithCustomIntent)filter);
|
||||
intent.setComponent(customFilter.customTaskList);
|
||||
if(customFilter.customExtras != null)
|
||||
intent.getExtras().putAll(customFilter.customExtras);
|
||||
}
|
||||
// choose whether we have to start a new activity (usually for portrait mode),
|
||||
// or just update the tasklist-fragment (usually in landscape)
|
||||
TaskListFragment tasklist = (TaskListFragment) getFragmentManager()
|
||||
.findFragmentById(R.id.tasklist_fragment);
|
||||
if (tasklist == null || !tasklist.isInLayout() ||
|
||||
(intent.getComponent() != null && !("com.todoroo.astrid.activity.TaskListActivity".equals(intent.getComponent().getClassName())))) {
|
||||
startActivity(intent);
|
||||
if (getResources().getConfiguration().orientation
|
||||
== Configuration.ORIENTATION_LANDSCAPE)
|
||||
AndroidUtilities.callApiMethod(5, getActivity(), "overridePendingTransition", //$NON-NLS-1$
|
||||
new Class<?>[] { Integer.TYPE, Integer.TYPE }, 0, 0);
|
||||
else
|
||||
AndroidUtilities.callApiMethod(5, getActivity(), "overridePendingTransition", //$NON-NLS-1$
|
||||
new Class<?>[] { Integer.TYPE, Integer.TYPE },
|
||||
R.anim.slide_left_in, R.anim.slide_left_out);
|
||||
} else {
|
||||
tasklist.onNewIntent(intent);
|
||||
}
|
||||
return true;
|
||||
} else if(item instanceof SearchFilter) {
|
||||
getActivity().onSearchRequested();
|
||||
} else if(item instanceof IntentFilter) {
|
||||
try {
|
||||
((IntentFilter)item).intent.send();
|
||||
} catch (CanceledException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onChildClick(ExpandableListView parent, View v,
|
||||
int groupPosition, int childPosition, long id) {
|
||||
FilterListItem item = (FilterListItem) adapter.getChild(groupPosition,
|
||||
childPosition);
|
||||
return onItemClicked(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupExpand(int groupPosition) {
|
||||
FilterListItem item = (FilterListItem) adapter.getGroup(groupPosition);
|
||||
onItemClicked(item);
|
||||
if(item instanceof FilterCategory)
|
||||
adapter.saveExpansionSetting((FilterCategory) item, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupCollapse(int groupPosition) {
|
||||
FilterListItem item = (FilterListItem) adapter.getGroup(groupPosition);
|
||||
onItemClicked(item);
|
||||
if(item instanceof FilterCategory)
|
||||
adapter.saveExpansionSetting((FilterCategory) item, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v,
|
||||
ContextMenuInfo menuInfo) {
|
||||
ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuInfo;
|
||||
|
||||
int type = ExpandableListView.getPackedPositionType(info.packedPosition);
|
||||
FilterListItem item;
|
||||
if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
|
||||
int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);
|
||||
int childPos = ExpandableListView.getPackedPositionChild(info.packedPosition);
|
||||
item = (FilterListItem) adapter.getChild(groupPos, childPos);
|
||||
} else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
|
||||
int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);
|
||||
item = (FilterListItem) adapter.getGroup(groupPos);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
MenuItem menuItem;
|
||||
|
||||
if(item instanceof Filter) {
|
||||
Filter filter = (Filter) item;
|
||||
menuItem = menu.add(0, CONTEXT_MENU_SHORTCUT, 0, R.string.FLA_context_shortcut);
|
||||
menuItem.setIntent(ShortcutActivity.createIntent(filter));
|
||||
}
|
||||
|
||||
for(int i = 0; i < item.contextMenuLabels.length; i++) {
|
||||
if(item.contextMenuIntents.length <= i)
|
||||
break;
|
||||
menuItem = menu.add(0, CONTEXT_MENU_INTENT, 0, item.contextMenuLabels[i]);
|
||||
menuItem.setIntent(item.contextMenuIntents[i]);
|
||||
}
|
||||
|
||||
if(menu.size() > 0)
|
||||
menu.setHeaderTitle(item.listingTitle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a shortcut on the user's home screen
|
||||
*
|
||||
* @param shortcutIntent
|
||||
* @param label
|
||||
*/
|
||||
private void createShortcut(Filter filter, Intent shortcutIntent, String label) {
|
||||
if(label.length() == 0)
|
||||
return;
|
||||
|
||||
Bitmap emblem = filter.listingIcon;
|
||||
if(emblem == null)
|
||||
emblem = ((BitmapDrawable) getResources().getDrawable(
|
||||
R.drawable.filter_tags1)).getBitmap();
|
||||
|
||||
// create icon by superimposing astrid w/ icon
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
Bitmap bitmap = ((BitmapDrawable) getResources().getDrawable(
|
||||
R.drawable.icon_blank)).getBitmap();
|
||||
bitmap = bitmap.copy(bitmap.getConfig(), true);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
int dimension = 22;
|
||||
canvas.drawBitmap(emblem, new Rect(0, 0, emblem.getWidth(), emblem.getHeight()),
|
||||
new Rect(bitmap.getWidth() - dimension, bitmap.getHeight() - dimension,
|
||||
bitmap.getWidth(), bitmap.getHeight()), null);
|
||||
|
||||
Intent createShortcutIntent = new Intent();
|
||||
createShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
|
||||
createShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label);
|
||||
createShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON, bitmap);
|
||||
createShortcutIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); //$NON-NLS-1$
|
||||
|
||||
getActivity().sendBroadcast(createShortcutIntent);
|
||||
Toast.makeText(getActivity(),
|
||||
getString(R.string.FLA_toast_onCreateShortcut, label), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||
// handle my own menus
|
||||
switch (item.getItemId()) {
|
||||
case MENU_SEARCH_ID: {
|
||||
getActivity().onSearchRequested();
|
||||
return true;
|
||||
}
|
||||
case MENU_HELP_ID: {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW,
|
||||
Uri.parse("http://weloveastrid.com/help-user-guide-astrid-v3/filters/")); //$NON-NLS-1$
|
||||
startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
case CONTEXT_MENU_SHORTCUT: {
|
||||
ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo)item.getMenuInfo();
|
||||
|
||||
final Intent shortcutIntent = item.getIntent();
|
||||
FilterListItem filter = ((FilterAdapter.ViewHolder)info.targetView.getTag()).item;
|
||||
if(filter instanceof Filter)
|
||||
showCreateShortcutDialog(shortcutIntent, (Filter)filter);
|
||||
|
||||
return true;
|
||||
}
|
||||
case CONTEXT_MENU_INTENT: {
|
||||
Intent intent = item.getIntent();
|
||||
startActivityForResult(intent, REQUEST_CUSTOM_INTENT);
|
||||
return true;
|
||||
}
|
||||
default: {
|
||||
TaskListFragment tasklist = (TaskListFragment) getFragmentManager()
|
||||
.findFragmentById(R.id.tasklist_fragment);
|
||||
if (tasklist != null && tasklist.isInLayout())
|
||||
return tasklist.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showCreateShortcutDialog(final Intent shortcutIntent,
|
||||
final Filter filter) {
|
||||
FrameLayout frameLayout = new FrameLayout(getActivity());
|
||||
frameLayout.setPadding(10, 0, 10, 0);
|
||||
final EditText editText = new EditText(getActivity());
|
||||
if(filter.listingTitle == null)
|
||||
filter.listingTitle = ""; //$NON-NLS-1$
|
||||
editText.setText(filter.listingTitle.
|
||||
replaceAll("\\(\\d+\\)$", "").trim()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
frameLayout.addView(editText, new FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.FILL_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT));
|
||||
|
||||
final Runnable createShortcut = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String label = editText.getText().toString();
|
||||
createShortcut(filter, shortcutIntent, label);
|
||||
}
|
||||
};
|
||||
editText.setOnEditorActionListener(new OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if(actionId == EditorInfo.IME_NULL) {
|
||||
createShortcut.run();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.FLA_shortcut_dialog_title)
|
||||
.setMessage(R.string.FLA_shortcut_dialog)
|
||||
.setView(frameLayout)
|
||||
.setIcon(android.R.drawable.ic_dialog_info)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
createShortcut.run();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if(resultCode != Activity.RESULT_CANCELED)
|
||||
adapter.clear();
|
||||
// will get lists automatically
|
||||
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.todoroo.astrid.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.astrid.service.ThemeService;
|
||||
|
||||
public class TaskEditWrapperActivity extends AstridWrapperActivity {
|
||||
/**
|
||||
* @see android.app.Activity#onCreate(Bundle)
|
||||
*/
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
ThemeService.applyTheme(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.task_edit_wrapper_activity);
|
||||
|
||||
Fragment frag = (Fragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.taskedit_fragment);
|
||||
if (frag != null)
|
||||
{
|
||||
mMultipleFragments = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
TaskEditActivity frag = (TaskEditActivity) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.taskedit_fragment);
|
||||
if (frag != null && frag.isInLayout())
|
||||
return frag.onKeyDown(keyCode, event);
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue