diff --git a/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkFilterExposer.java index 734a5d50e..c0ce129b0 100644 --- a/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkFilterExposer.java @@ -11,12 +11,14 @@ import android.content.Intent; import com.timsu.astrid.R; import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.QueryTemplate; +import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.FilterCategory; import com.todoroo.astrid.api.FilterListHeader; import com.todoroo.astrid.api.FilterListItem; import com.todoroo.astrid.dao.MetadataDao.MetadataCriteria; +import com.todoroo.astrid.dao.TaskDao.TaskCriteria; import com.todoroo.astrid.model.Metadata; import com.todoroo.astrid.rmilk.Utilities.ListContainer; import com.todoroo.astrid.rmilk.data.MilkDataService; @@ -41,6 +43,8 @@ public class MilkFilterExposer extends BroadcastReceiver { Filter filter = new Filter(listTitle, title, new QueryTemplate().join( MilkDataService.METADATA_JOIN).where(Criterion.and( MetadataCriteria.withKey(MilkTask.METADATA_KEY), + TaskCriteria.isActive(), + TaskCriteria.isVisible(DateUtilities.now()), MilkTask.LIST_ID.eq(list.id))), values); diff --git a/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkPreferences.java b/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkPreferences.java index 2a1f5eb3c..a9590116e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/rmilk/MilkPreferences.java @@ -6,9 +6,11 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.res.Resources; import android.graphics.Color; +import android.os.Bundle; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.view.View; +import android.view.ViewGroup.OnHierarchyChangeListener; import com.timsu.astrid.R; import com.todoroo.andlib.service.Autowired; @@ -30,18 +32,30 @@ public class MilkPreferences extends TodorooPreferences { @Autowired DialogUtilities dialogUtilities; + int statusColor = Color.BLACK; + @Override public int getPreferenceResource() { return R.xml.preferences_rmilk; } @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - if(hasFocus) { - AndroidUtilities.setCurrentlyActive(this); - initializePreference(getPreferenceScreen()); - } + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getListView().setOnHierarchyChangeListener(new OnHierarchyChangeListener() { + + @Override + public void onChildViewRemoved(View parent, View child) { + // + } + + @Override + public void onChildViewAdded(View parent, View child) { + View view = findViewById(R.id.status); + if(view != null) + view.setBackgroundColor(statusColor); + } + }); } /** @@ -72,7 +86,6 @@ public class MilkPreferences extends TodorooPreferences { boolean loggedIn = Utilities.isLoggedIn(); String status; String subtitle = ""; //$NON-NLS-1$ - int statusColor; // ! logged in - display message, click -> sync if(!loggedIn) { diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index d6c46a59a..c806340c9 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -266,6 +266,7 @@ public class TaskAdapter extends CursorAdapter { } // task details - send out a request for it (only if not fling) + viewHolder.details.setText(""); //$NON-NLS-1$ if(!isFling) { retrieveDetails(viewHolder); } @@ -298,8 +299,6 @@ public class TaskAdapter extends CursorAdapter { return; } - viewHolder.details.setText(""); //$NON-NLS-1$ - // request details Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_REQUEST_DETAILS); broadcastIntent.putExtra(AstridApiConstants.EXTRAS_TASK_ID, taskId);