|
|
@ -10,8 +10,11 @@ import android.content.Intent;
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.graphics.Color;
|
|
|
|
import android.graphics.Color;
|
|
|
|
import android.os.IBinder;
|
|
|
|
import android.os.IBinder;
|
|
|
|
|
|
|
|
import android.util.DisplayMetrics;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
import android.view.Display;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
import android.view.WindowManager;
|
|
|
|
import android.widget.RemoteViews;
|
|
|
|
import android.widget.RemoteViews;
|
|
|
|
|
|
|
|
|
|
|
|
import com.timsu.astrid.R;
|
|
|
|
import com.timsu.astrid.R;
|
|
|
@ -197,6 +200,8 @@ public class TasksWidget extends AppWidgetProvider {
|
|
|
|
cursor.close();
|
|
|
|
cursor.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateForScreenSize(views);
|
|
|
|
|
|
|
|
|
|
|
|
Intent listIntent = new Intent(context, TaskListActivity.class);
|
|
|
|
Intent listIntent = new Intent(context, TaskListActivity.class);
|
|
|
|
listIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
|
|
|
listIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
|
|
|
if(filter != null) {
|
|
|
|
if(filter != null) {
|
|
|
@ -221,6 +226,19 @@ public class TasksWidget extends AppWidgetProvider {
|
|
|
|
return views;
|
|
|
|
return views;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateForScreenSize(RemoteViews views) {
|
|
|
|
|
|
|
|
Display display = ((WindowManager) this.getSystemService(
|
|
|
|
|
|
|
|
Context.WINDOW_SERVICE)).getDefaultDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DisplayMetrics metrics = new DisplayMetrics();
|
|
|
|
|
|
|
|
display.getMetrics(metrics);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(metrics.density <= 0.75) {
|
|
|
|
|
|
|
|
views.setViewVisibility(SEPARATOR_IDS[3], View.INVISIBLE);
|
|
|
|
|
|
|
|
views.setViewVisibility(TEXT_IDS[4], View.INVISIBLE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Filter getFilter(int widgetId) {
|
|
|
|
private Filter getFilter(int widgetId) {
|
|
|
|
// base our filter off the inbox filter, replace stuff if we have it
|
|
|
|
// base our filter off the inbox filter, replace stuff if we have it
|
|
|
|
Filter filter = CoreFilterExposer.buildInboxFilter(getResources());
|
|
|
|
Filter filter = CoreFilterExposer.buildInboxFilter(getResources());
|
|
|
|