Bugfixes to waiting on me query, visual improvements

pull/14/head
Sam Bosley 12 years ago
parent 64f99309f0
commit 9cb346ea61

@ -68,7 +68,8 @@ public final class CoreFilterExposer extends BroadcastReceiver implements Astrid
filters.add(getTodayFilter(r)); filters.add(getTodayFilter(r));
if (Preferences.getBoolean(R.string.p_show_waiting_on_me_filter, true) && if (Preferences.getBoolean(R.string.p_show_waiting_on_me_filter, true) &&
PluginServices.getWaitingOnMeDao().count(Query.select(WaitingOnMe.ID).where(Criterion.and(WaitingOnMe.DELETED_AT.eq(0), WaitingOnMe.READ_AT.eq(0), WaitingOnMe.ACKNOWLEDGED.neq(1)))) > 0) PluginServices.getWaitingOnMeDao().count(Query.select(WaitingOnMe.ID).where(Criterion.and(WaitingOnMe.DELETED_AT.eq(0),
Criterion.or(WaitingOnMe.ACKNOWLEDGED.isNull(), WaitingOnMe.ACKNOWLEDGED.neq(1))))) > 0)
filters.add(getWaitingOnMeFilter(r)); filters.add(getWaitingOnMeFilter(r));
// transmit filter list // transmit filter list
@ -113,8 +114,9 @@ public final class CoreFilterExposer extends BroadcastReceiver implements Astrid
public static Filter getWaitingOnMeFilter(Resources r) { public static Filter getWaitingOnMeFilter(Resources r) {
FilterWithCustomIntent waitingOnMe = new FilterWithCustomIntent(r.getString(R.string.BFE_waiting_on_me), r.getString(R.string.BFE_waiting_on_me), FilterWithCustomIntent waitingOnMe = new FilterWithCustomIntent(r.getString(R.string.BFE_waiting_on_me), r.getString(R.string.BFE_waiting_on_me),
new QueryTemplate().join(Join.inner(WaitingOnMe.TABLE, Task.UUID.eq(WaitingOnMe.TASK_UUID))).where( new QueryTemplate().join(Join.inner(WaitingOnMe.TABLE, Task.UUID.eq(WaitingOnMe.TASK_UUID))).where(
Criterion.and(TaskCriteria.activeVisibleMine(), Criterion.and(WaitingOnMe.DELETED_AT.eq(0),
WaitingOnMe.DELETED_AT.eq(0), Criterion.or(WaitingOnMe.ACKNOWLEDGED.isNull(), WaitingOnMe.ACKNOWLEDGED.eq(0)))).groupBy(Task.UUID), null); Criterion.or(WaitingOnMe.ACKNOWLEDGED.isNull(), WaitingOnMe.ACKNOWLEDGED.neq(1))))
.groupBy(Task.UUID), null);
waitingOnMe.customTaskList = new ComponentName(ContextManager.getContext(), WaitingOnMeFragment.class); waitingOnMe.customTaskList = new ComponentName(ContextManager.getContext(), WaitingOnMeFragment.class);
int themeFlags = ThemeService.getFilterThemeFlags(); int themeFlags = ThemeService.getFilterThemeFlags();
waitingOnMe.listingIcon = ((BitmapDrawable) r.getDrawable( waitingOnMe.listingIcon = ((BitmapDrawable) r.getDrawable(

@ -12,38 +12,6 @@
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" > android:orientation="vertical" >
<LinearLayout
android:id="@+id/waiting_on_me"
android:layout_width="fill_parent"
android:layout_height="43dip"
android:padding="5dip"
android:gravity="center_vertical"
android:visibility="gone"
android:background="?attr/asMembersHeaderBackground">
<TextView
android:id="@+id/wom_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:id="@+id/wom_dismiss"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="5dip"
android:textColor="@android:color/white"
android:background="#707070"
android:text="@string/wom_dismiss"/>
<TextView
android:id="@+id/wom_acknowledge"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textColor="@android:color/white"
android:background="?attr/asThemeTextColor"
android:text="@string/wom_acknowledge"/>
</LinearLayout>
<com.todoroo.astrid.ui.NestableScrollView <com.todoroo.astrid.ui.NestableScrollView
android:id="@+id/edit_scroll" android:id="@+id/edit_scroll"
style="@style/Content_EditScroll" style="@style/Content_EditScroll"
@ -58,6 +26,60 @@
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:padding="10dip" > android:padding="10dip" >
<RelativeLayout
android:id="@+id/waiting_on_me"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:padding="10dip"
android:visibility="visible"
style="@style/EditRow">
<ImageView
android:id="@+id/wom_icon"
android:layout_marginRight="10dip"
android:layout_width="20dip"
android:layout_height="20dip"
android:scaleType="fitCenter"/>
<TextView
android:id="@+id/wom_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:layout_toRightOf="@id/wom_icon"/>
<TextView
android:id="@+id/wom_acknowledge"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_below="@id/wom_message"
android:layout_marginRight="10dip"
android:layout_alignLeft="@id/wom_message"
android:paddingLeft="3dip"
android:paddingRight="3dip"
android:paddingTop="1dip"
android:paddingBottom="1dip"
android:textColor="@android:color/white"
android:background="?attr/asThemeTextColor"
android:text="@string/wom_acknowledge"/>
<TextView
android:id="@+id/wom_dismiss"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="5dip"
android:layout_toRightOf="@id/wom_acknowledge"
android:layout_below="@id/wom_message"
android:paddingLeft="3dip"
android:paddingRight="3dip"
android:paddingTop="1dip"
android:paddingBottom="1dip"
android:textColor="@android:color/white"
android:background="#707070"
android:text="@string/wom_dismiss"/>
</RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/title_controls" android:id="@+id/title_controls"
style="@style/EditRow" style="@style/EditRow"

@ -43,6 +43,7 @@ import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
@ -820,6 +821,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
TextView womText = (TextView) waitingOnMe.findViewById(R.id.wom_message); TextView womText = (TextView) waitingOnMe.findViewById(R.id.wom_message);
womText.setText(getWomText(wom)); womText.setText(getWomText(wom));
ImageView womIcon = (ImageView) waitingOnMe.findViewById(R.id.wom_icon);
womIcon.setImageResource(ThemeService.getTaskEditDrawable(R.drawable.tea_icn_edit, R.drawable.tea_icn_edit_lightblue));
} }
} }
} }

@ -729,7 +729,7 @@ public class TaskListFragment extends SherlockListFragment implements OnScrollLi
try { try {
root.removeView(feedbackPrompt); root.removeView(feedbackPrompt);
FeedbackPromptDialogs.showFeedbackDialog((AstridActivity) getActivity(), true); FeedbackPromptDialogs.showFeedbackDialog((AstridActivity) getActivity(), true);
// Preferences.setLong(PREF_LAST_FEEDBACK_TIME, DateUtilities.now()); Preferences.setLong(PREF_LAST_FEEDBACK_TIME, DateUtilities.now());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -742,7 +742,7 @@ public class TaskListFragment extends SherlockListFragment implements OnScrollLi
try { try {
root.removeView(feedbackPrompt); root.removeView(feedbackPrompt);
FeedbackPromptDialogs.showFeedbackDialog((AstridActivity) getActivity(), false); FeedbackPromptDialogs.showFeedbackDialog((AstridActivity) getActivity(), false);
// Preferences.setLong(PREF_LAST_FEEDBACK_TIME, DateUtilities.now()); Preferences.setLong(PREF_LAST_FEEDBACK_TIME, DateUtilities.now());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

Loading…
Cancel
Save