Merge remote-tracking branch 'origin/120217_as_minor_bug_fixes' into 4.0

pull/14/head
Tim Su 13 years ago
commit 1c6c8c0156

@ -172,6 +172,7 @@ public class TagSettingsActivity extends FragmentActivity {
if(actFmPreferenceService.isLoggedIn()) {
picture.setVisibility(View.VISIBLE);
picture.setDefaultImageResource(TagService.getDefaultImageIDForTag(tagData.getValue(TagData.NAME)));
findViewById(R.id.picture_label).setVisibility(View.VISIBLE);
findViewById(R.id.listSettingsMore).setVisibility(View.VISIBLE);
}

@ -467,8 +467,10 @@ public class TagViewFragment extends TaskListFragment {
// handle my own menus
switch (item.getItemId()) {
case MENU_REFRESH_ID:
if (actFmPreferenceService.isLoggedIn()) {
refreshData(true);
return true;
}
}
return super.onOptionsItemSelected(item);

@ -51,7 +51,7 @@ public class TagCustomFilterCriteriaExposer extends BroadcastReceiver {
MetadataDao.MetadataCriteria.withKey(TagService.KEY),
TagService.TAG.eq("?"))).toString(),
values, tagNames, tagNames,
((BitmapDrawable)r.getDrawable(R.drawable.gl_list)).getBitmap(),
((BitmapDrawable)r.getDrawable(TagService.getDefaultImageIDForTag(0))).getBitmap(),
context.getString(R.string.CFC_tag_name));
ret[j++] = criterion;
}
@ -67,7 +67,7 @@ public class TagCustomFilterCriteriaExposer extends BroadcastReceiver {
MetadataDao.MetadataCriteria.withKey(TagService.KEY),
TagService.TAG.like("%?%"))).toString(),
null, context.getString(R.string.CFC_tag_contains_name), "",
((BitmapDrawable)r.getDrawable(R.drawable.gl_list)).getBitmap(),
((BitmapDrawable)r.getDrawable(TagService.getDefaultImageIDForTag(0))).getBitmap(),
context.getString(R.string.CFC_tag_contains_name));
ret[j++] = criterion;
}

@ -9,6 +9,7 @@ import java.util.LinkedHashSet;
import android.text.TextUtils;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property.CountProperty;
import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
@ -61,6 +62,13 @@ public final class TagService {
private static TagService instance = null;
private static int[] default_tag_images = new int[] {
R.drawable.default_list_0,
R.drawable.default_list_1,
R.drawable.default_list_2,
R.drawable.default_list_3
};
public static synchronized TagService getInstance() {
if(instance == null)
instance = new TagService();
@ -368,4 +376,14 @@ public final class TagService {
Flags.set(Flags.REFRESH);
}
public static int getDefaultImageIDForTag(long remoteID) {
if (remoteID <= 0) {
int random = (int)(Math.random()*4);
return default_tag_images[random];
}
return default_tag_images[((int)remoteID)%4];
}
public static int getDefaultImageIDForTag(String title) {
return getDefaultImageIDForTag(Math.abs(title.hashCode()));
}
}

@ -188,10 +188,10 @@ public class TaskRabbitActivity extends FragmentActivity {
public void showIntroDialog() {
if (!Preferences.getBoolean(TASK_RABBIT_DIALOG_INTRO_PREF, false)) {
if (TaskRabbitLocationManager.supportsCurrentLocation(currentLocation)) {
AlertDialog.Builder adb = new AlertDialog.Builder(TaskRabbitActivity.this);
adb.setTitle(R.string.tr_alert_intro_title);
adb.setMessage(getString(R.string.tr_alert_intro_location));
adb.setPositiveButton(getString(R.string.tr_alert_button_close), new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, final int id) {
@ -202,6 +202,7 @@ public class TaskRabbitActivity extends FragmentActivity {
}
else {
final AlertDialog adb = new AlertDialog.Builder(TaskRabbitActivity.this)
.setTitle(R.string.tr_alert_intro_title)
.setMessage(R.string.tr_alert_intro_no_location)
.setPositiveButton(getString(R.string.tr_alert_button_close),null)
.show();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -114,7 +114,7 @@
android:layout_width="80dip"
android:layout_height="80dip"
android:layout_alignParentLeft="true"
android:scaleType="fitCenter"
android:scaleType="centerInside"
android:paddingRight="10dip"
android:visibility="gone"
android:layout_below="@id/picture_label"
@ -142,7 +142,7 @@
android:id="@+id/divider"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_marginTop="10dip"
android:layout_marginTop="25dip"
android:layout_below="@id/tag_description"
style="@style/TEA_Separator" />

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains preference keys and preference list values.
These should not be translated
This file contains task rabbit keys and strings.
Currently does not need to be translated because it's only enabled in US
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
@ -415,6 +415,7 @@
<string name="tr_alert_internet_message_fail">Internet connection could not be found. Please check your connection and try again.</string>
<string name="tr_alert_intro_title">Welcome to TaskRabbit!</string>
<string name="tr_alert_intro_location">TaskRabbit is an inexpensive way to delegate tasks to trust-worthy people in your area.</string>
<string name="tr_alert_intro_no_location">TaskRabbit is an inexpensive way to delegate tasks to trust-worthy people but it isn\'t yet available in your location. You can use it to assign virtual tasks or tasks in <a href="http://www.taskrabbit.com/pickacity">supported locations</a></string>

@ -62,6 +62,15 @@
<!-- text for confirmation dialog after repeating a task -->
<string name="repeat_rescheduling_dialog_title">Rescheduling task \"%s\"</string>
<string name="repeat_rescheduling_dialog_bubble">I\'ve rescheduled this repeating task from %1$s to %2$s</string>
<string name="repeat_rescheduling_dialog_bubble">%1$s I\'ve rescheduled this repeating task from %2$s to %3$s</string>
<string-array name="repeat_encouragement">
<!-- Encouragement in rescheduling dialog bubble -->
<item>Good job!</item>
<item>Wow… I\'m so proud of you!</item>
<item>I love it when you\'re productive!</item>
<item>Doesn\'t it feel good to check something off?</item>
</string-array>
</resources>

@ -58,6 +58,7 @@ import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.core.CustomFilterActivity;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.tags.TagsPlugin;
import com.todoroo.astrid.welcome.HelpInfoPopover;
@ -398,7 +399,7 @@ public class FilterListFragment extends ListFragment {
Bitmap emblem = filter.listingIcon;
if(emblem == null)
emblem = ((BitmapDrawable) activity.getResources().getDrawable(
R.drawable.gl_list)).getBitmap();
TagService.getDefaultImageIDForTag(filter.listingTitle))).getBitmap();
// create icon by superimposing astrid w/ icon
DisplayMetrics metrics = new DisplayMetrics();

@ -50,6 +50,7 @@ import com.todoroo.astrid.api.FilterListHeader;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.api.FilterWithUpdate;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.tags.TagService;
public class FilterAdapter extends ArrayAdapter<Filter> {
@ -450,7 +451,7 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
viewHolder.name.getLayoutParams().height = (int) (58 * metrics.density);
if(filter instanceof FilterWithUpdate) {
viewHolder.urlImage.setVisibility(View.VISIBLE);
viewHolder.urlImage.setDefaultImageResource(R.drawable.gl_list);
viewHolder.urlImage.setDefaultImageResource(TagService.getDefaultImageIDForTag(viewHolder.name.getText().toString()));
viewHolder.urlImage.setUrl(((FilterWithUpdate)filter).imageUrl);
}

@ -128,7 +128,9 @@ public class DateChangedAlerts {
String oldDueDateString = getRelativeDateAndTimeString(activity, oldDueDate);
String newDueDateString = getRelativeDateAndTimeString(activity, newDueDate);
String speechBubbleText = activity.getString(R.string.repeat_rescheduling_dialog_bubble, oldDueDateString, newDueDateString);
String[] encouragements = activity.getResources().getStringArray(R.array.repeat_encouragement);
String encouragement = encouragements[(int) (Math.random()*encouragements.length)];
String speechBubbleText = activity.getString(R.string.repeat_rescheduling_dialog_bubble, encouragement, oldDueDateString, newDueDateString);
((TextView) d.findViewById(R.id.reminder_message)).setText(speechBubbleText);

Loading…
Cancel
Save