Made a nicer selection background for task rows

pull/14/head
Tim Su 14 years ago
parent 7924b4a5be
commit 027e943213

@ -122,9 +122,6 @@ public class Notifications extends BroadcastReceiver {
return false;
}
// schedule next notification
ReminderService.getInstance().scheduleAlarm(task);
// you're done - don't sound, do delete
if(task.isCompleted() || task.isDeleted())
return false;
@ -141,6 +138,9 @@ public class Notifications extends BroadcastReceiver {
task.setValue(Task.REMINDER_LAST, DateUtilities.now());
taskDao.saveExisting(task);
// schedule next notification
ReminderService.getInstance().scheduleAlarm(task);
Context context = ContextManager.getContext();
String title = context.getString(R.string.app_name);
String text = reminder + " " + taskTitle; //$NON-NLS-1$

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1,20 @@
<?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>

@ -0,0 +1,30 @@
<?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.
-->
<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" />
</selector>

@ -6,7 +6,9 @@
<color name="task_list_importance_1">#ffffffff</color>
<color name="task_list_importance_2">#ffcfcfcf</color>
<color name="task_list_importance_3">#ffb8b8b8</color>
<color name="task_list_importance_4">#ffa0a0a0</color>
<color name="task_list_importance_4">#ffa0a0a0</color>
<color name="task_list_selected">#33ffffff</color>
<color name="taskList_dueDateOverdue">#FFFB6666</color>
<color name="taskList_dueDate">#ffF0E89E</color>

@ -13,20 +13,19 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.text.TextUtils;
import android.text.Html.ImageGetter;
import android.text.TextUtils;
import android.text.util.Linkify;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.CheckBox;
@ -603,7 +602,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
viewHolder.taskRow.removeView(view);
}
if(taskId == expanded)
viewHolder.view.setBackgroundColor(Color.argb(20, 255, 255, 255));
viewHolder.view.setBackgroundResource(R.drawable.list_selector_highlighted);
else
viewHolder.view.setBackgroundResource(android.R.drawable.list_selector_background);
}

Loading…
Cancel
Save