New dark style for Astrid task list UI designed by Scott Rim & Astrid team

- new header and footer styling
- abbreviated date format, moved date and details to same line
- new icons and reduced padding for quick action bar
- notched task indicators
- smaller details font
- new icons for details row
- new check box icons
- added header to filter activity
- removed unused resources
pull/14/head
Tim Su 13 years ago
parent 925193c146
commit 27816c42bc

@ -83,6 +83,15 @@
<item quantity="other">%d people</item>
</plurals>
<!-- today -->
<string name="today">Today</string>
<!-- tomorrow -->
<string name="tomorrow">Tomorrow</string>
<!-- today -->
<string name="yesterday">Yesterday</string>
<!-- ================================================== Generic Dialogs == -->
<!-- confirmation dialog title -->

@ -14,6 +14,8 @@ import android.content.Context;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import com.todoroo.astrid.api.R;
public class DateUtilities {
@ -130,4 +132,22 @@ public class DateUtilities {
return getDateString(context, date) + " " + getTimeString(context, date);
}
/**
* @return yesterday, today, tomorrow, or null
*/
public static String getRelativeDay(Context context, long date) {
Date today = new Date();
if(Math.abs(today.getTime() - date) > DateUtilities.ONE_DAY)
return null;
int todayDate = today.getDate();
int otherDate = unixtimeToDate(date).getDate();
if(todayDate == otherDate)
return context.getString(R.string.today);
if(today.getTime() > date)
return context.getString(R.string.yesterday);
return context.getString(R.string.tomorrow);
}
}

@ -31,6 +31,11 @@ public class TaskAction implements Parcelable {
*/
public Bitmap icon = null;
/**
* Quick action drawable resource
*/
public int drawable = 0;
/**
* Create an EditOperation object
*
@ -62,6 +67,7 @@ public class TaskAction implements Parcelable {
dest.writeString(text);
dest.writeParcelable(intent, 0);
dest.writeParcelable(icon, 0);
dest.writeInt(drawable);
}
/**
@ -72,9 +78,11 @@ public class TaskAction implements Parcelable {
* {@inheritDoc}
*/
public TaskAction createFromParcel(Parcel source) {
return new TaskAction(source.readString(),
TaskAction action = new TaskAction(source.readString(),
(PendingIntent)source.readParcelable(PendingIntent.class.getClassLoader()),
(Bitmap)source.readParcelable(Bitmap.class.getClassLoader()));
action.drawable = source.readInt();
return action;
}
/**

@ -99,7 +99,7 @@ public class Update extends RemoteModel {
static {
defaultValues.put(REMOTE_ID.name, 0);
defaultValues.put(TASK.name, 0);
defaultValues.put(TAGS.name, 0);
defaultValues.put(TAGS.name, "");
defaultValues.put(USER_ID.name, 0);
defaultValues.put(USER.name, "");
defaultValues.put(ACTION.name, "");

@ -7,9 +7,6 @@ import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
@ -37,12 +34,12 @@ public class EditPeopleExposer extends BroadcastReceiver {
if(AstridApiConstants.BROADCAST_REQUEST_ACTIONS.equals(intent.getAction())) {
final String label = context.getString(R.string.EPE_action);
final Drawable drawable = context.getResources().getDrawable(R.drawable.tango_users);
final int drawable = R.drawable.ic_qbar_share;
Intent newIntent = new Intent(ACTION);
newIntent.putExtra(AstridApiConstants.EXTRAS_TASK_ID, taskId);
Bitmap icon = ((BitmapDrawable)drawable).getBitmap();
TaskAction action = new TaskAction(label,
PendingIntent.getBroadcast(context, (int)taskId, newIntent, 0), icon);
PendingIntent.getBroadcast(context, (int)taskId, newIntent, 0), null);
action.drawable = drawable;
// transmit
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_ACTIONS);

@ -7,9 +7,6 @@ import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import com.timsu.astrid.R;
@ -45,27 +42,27 @@ public class EditNoteExposer extends BroadcastReceiver {
if(AstridApiConstants.BROADCAST_REQUEST_ACTIONS.equals(intent.getAction())) {
String label;
Drawable drawable;
int drawable;
if(!actFmPreferenceService.isLoggedIn()) {
Task task = PluginServices.getTaskService().fetchById(taskId, Task.NOTES);
if(task == null || TextUtils.isEmpty(task.getValue(Task.NOTES)))
return;
label = context.getString(R.string.ENE_label);
drawable = context.getResources().getDrawable(R.drawable.tango_notes);
drawable = R.drawable.ic_qbar_comments;
} else {
label = context.getString(R.string.ENE_label_comments);
drawable = context.getResources().getDrawable(R.drawable.tango_chat);
drawable = R.drawable.ic_qbar_comments;
}
Intent newIntent = new Intent(ACTION);
newIntent.putExtra(AstridApiConstants.EXTRAS_TASK_ID, taskId);
Bitmap icon = ((BitmapDrawable)drawable).getBitmap();
TaskAction action = new TaskAction(label,
PendingIntent.getBroadcast(context, (int)taskId, newIntent, 0), icon);
PendingIntent.getBroadcast(context, (int)taskId, newIntent, 0), null);
action.drawable = drawable;
// transmit
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_ACTIONS);
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_ADDON, ActFmPreferenceService.IDENTIFIER);
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_ADDON, NotesPlugin.IDENTIFIER);
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_RESPONSE, action);
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_TASK_ID, taskId);
context.sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);

@ -0,0 +1,45 @@
/**
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.notes;
import android.text.TextUtils;
import android.widget.RemoteViews;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.api.TaskDecoration;
import com.todoroo.astrid.api.TaskDecorationExposer;
import com.todoroo.astrid.data.Task;
/**
* Exposes {@link TaskDecoration} for timers
*
* @author Tim Su <tim@todoroo.com>
*
*/
public class NotesDecorationExposer implements TaskDecorationExposer {
@Override
public TaskDecoration expose(Task task) {
if(Preferences.getBoolean(R.string.p_showNotes, false))
return null;
if(task == null || TextUtils.isEmpty(task.getValue(Task.NOTES)))
return null;
TaskDecoration decoration;
RemoteViews remoteViews = new RemoteViews(ContextManager.getContext().getPackageName(),
R.layout.note_decoration);
decoration = new TaskDecoration(remoteViews, TaskDecoration.POSITION_RIGHT, 0);
return decoration;
}
@Override
public String getAddon() {
return NotesPlugin.IDENTIFIER;
}
}

@ -7,9 +7,6 @@ import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
@ -44,19 +41,19 @@ public class TimerActionExposer extends BroadcastReceiver {
// was part of a broadcast for actions
if(AstridApiConstants.BROADCAST_REQUEST_ACTIONS.equals(intent.getAction())) {
final String label;
final Drawable drawable;
final int drawable;
if(task.getValue(Task.TIMER_START) == 0) {
label = context.getString(R.string.TAE_startTimer);
drawable = context.getResources().getDrawable(R.drawable.tango_clock_start);
drawable = R.drawable.ic_qbar_timer_start;
} else {
label = context.getString(R.string.TAE_stopTimer);
drawable = context.getResources().getDrawable(R.drawable.tango_clock_stop);
drawable = R.drawable.ic_qbar_timer_stop;
}
Bitmap icon = ((BitmapDrawable)drawable).getBitmap();
Intent newIntent = new Intent(TIMER_ACTION);
newIntent.putExtra(AstridApiConstants.EXTRAS_TASK_ID, taskId);
TaskAction action = new TaskAction(label,
PendingIntent.getBroadcast(context, (int)taskId, newIntent, 0), icon);
PendingIntent.getBroadcast(context, (int)taskId, newIntent, 0), null);
action.drawable = drawable;
// transmit
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_ACTIONS);

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="100" />
</set>

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="50" />
</set>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

@ -20,10 +20,10 @@
<item android:state_checked="true" android:state_pressed="true"
android:state_enabled="true"
android:drawable="@drawable/btn_check_on_pressed" />
android:drawable="@drawable/btn_check_pressed" />
<item android:state_checked="false" android:state_pressed="true"
android:state_enabled="true"
android:drawable="@drawable/btn_check_off_pressed" />
android:drawable="@drawable/btn_check_pressed" />
<item android:state_checked="false"
android:state_enabled="true"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:state_enabled="true"
android:state_focused="false" android:drawable="@drawable/tango_previous_normal" />
android:state_focused="false" android:drawable="@drawable/footer_button_normal" />
<item android:state_pressed="true" android:state_enabled="true"
android:drawable="@drawable/tango_previous_pressed" />
android:drawable="@drawable/footer_button_pressed" />
<item android:state_pressed="false" android:state_enabled="true"
android:state_focused="true" android:drawable="@drawable/tango_previous_pressed" />
android:state_focused="true" android:drawable="@drawable/footer_button_selected" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/drawable/editbox_background.xml
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@drawable/footer_edittext_focus" />
<item android:drawable="@drawable/footer_edittext_normal" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

@ -4,9 +4,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -16,15 +16,11 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false"
android:drawable="@color/task_list_selected" />
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="true"
android:drawable="@drawable/list_selector_background_focus" />
<item android:state_pressed="false" android:state_enabled="true"
android:state_focused="false" android:drawable="@drawable/header_tags_normal" />
<item android:state_pressed="true" android:state_enabled="true"
android:drawable="@drawable/header_tags_pressed" />
<item android:state_pressed="false" android:state_enabled="true"
android:state_focused="true" android:drawable="@drawable/header_tags_pressed" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/list_selector_background_pressed" />
<item android:drawable="@drawable/list_selector_background_longpress" />
</transition>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save