diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java
index d3a0c0cd8..35ba9c285 100644
--- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java
+++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmSyncActionExposer.java
@@ -3,7 +3,6 @@
*/
package com.todoroo.astrid.actfm;
-import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -38,11 +37,8 @@ public class ActFmSyncActionExposer extends BroadcastReceiver {
if(!actFmPreferenceService.isLoggedIn())
return;
- Intent syncIntent = new Intent(null, null,
- context, ActFmBackgroundService.class);
- PendingIntent pendingIntent = PendingIntent.getService(context, 0, syncIntent, PendingIntent.FLAG_UPDATE_CURRENT);
SyncAction syncAction = new SyncAction(context.getString(R.string.actfm_APr_header),
- pendingIntent);
+ null);
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_SYNC_ACTIONS);
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_ADDON, ActFmPreferenceService.IDENTIFIER);
diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java
index 1e96c5a68..de16bda57 100644
--- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java
+++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java
@@ -69,6 +69,7 @@ public class TagSettingsActivity extends FragmentActivity {
private EditText tagName;
private EditText tagDescription;
private CheckBox isSilent;
+ private Bitmap setBitmap;
boolean isNewTag = false;
@@ -202,21 +203,44 @@ public class TagSettingsActivity extends FragmentActivity {
else
Toast.makeText(this, R.string.tag_list_saved, Toast.LENGTH_LONG).show();
- tagDataService.save(tagData);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(tagName.getWindowToken(), 0);
if (isNewTag) {
- Intent intent = new Intent(this, TagViewWrapperActivity.class);
- intent.putExtra(TagViewActivity.EXTRA_TAG_NAME, newName);
- intent.putExtra(TagViewActivity.TOKEN_FILTER, TagFilterExposer.filterFromTagData(this, tagData));
- super.finish();
- startActivity(intent);
- AndroidUtilities.callOverridePendingTransition(this, R.anim.slide_left_in, R.anim.slide_left_out);
- return;
- }
+ Flags.set(Flags.ACTFM_SUPPRESS_SYNC);
+ tagDataService.save(tagData);
+ final String name = newName;
+ final Runnable loadTag = new Runnable() {
+ @Override
+ public void run() {
+ Intent intent = new Intent(TagSettingsActivity.this, TagViewActivity.class);
+ intent.putExtra(TagViewActivity.EXTRA_TAG_NAME, name);
+ intent.putExtra(TagViewActivity.TOKEN_FILTER,
+ TagFilterExposer.filterFromTagData(TagSettingsActivity.this, tagData));
+ finish();
+ startActivity(intent);
+ }
+ };
+
+ if(actFmPreferenceService.isLoggedIn()) {
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ actFmSyncService.pushTagDataOnSave(tagData, tagData.getMergedValues());
+ if(setBitmap != null && tagData.getValue(TagData.REMOTE_ID) > 0)
+ uploadTagPicture(setBitmap);
+ runOnUiThread(loadTag);
+ }
+ }).start();
+ } else {
+ loadTag.run();
+ }
+ return;
+ } else {
+ tagDataService.save(tagData);
+ }
refreshSettingsPage();
finish();
@@ -318,7 +342,9 @@ public class TagSettingsActivity extends FragmentActivity {
@Override
public void handleCameraResult(Bitmap bitmap) {
picture.setImageBitmap(bitmap);
- uploadTagPicture(bitmap);
+ setBitmap = bitmap;
+ if(tagData.getValue(TagData.REMOTE_ID) > 0)
+ uploadTagPicture(bitmap);
}
};
if (ActFmCameraModule.activityResult(this, requestCode, resultCode, data, callback)) {
diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java
index 78dc16837..b9d22f6eb 100644
--- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java
+++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java
@@ -8,8 +8,10 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONException;
+import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
+import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.service.ExceptionService;
import com.todoroo.andlib.sql.Criterion;
@@ -29,7 +31,7 @@ import com.todoroo.astrid.tags.TagService;
* Exposes sync action
*
*/
-public class ActFmSyncV2Provider implements SyncV2Provider {
+public class ActFmSyncV2Provider extends SyncV2Provider {
@Autowired ActFmPreferenceService actFmPreferenceService;
@@ -47,6 +49,11 @@ public class ActFmSyncV2Provider implements SyncV2Provider {
DependencyInjectionService.getInstance().inject(this);
}
+ @Override
+ public String getName() {
+ return ContextManager.getString(R.string.actfm_APr_header);
+ }
+
@Override
public boolean isActive() {
return actFmPreferenceService.isLoggedIn();
diff --git a/astrid/res/values-pl/strings.xml b/astrid/res/values-pl/strings.xml
index 57ce79ddd..41e5bcd57 100644
--- a/astrid/res/values-pl/strings.xml
+++ b/astrid/res/values-pl/strings.xml
@@ -5,10 +5,10 @@
- Udostęp
+ Udostępnij
- Contact or Email
+ Kontakt lub e-mail
Kontakt lub lista udostępionych
@@ -17,7 +17,7 @@
Zapisano na serwerze
- Save Failed: %s
+ Błąd zapisu: %s
Niestety, ale ta operacja nie jest jeszcze obsługiwana przez udostepnione tagi.
@@ -26,10 +26,10 @@
Zrób zdjęcie
- Wynierz z galerii
+ Wybierz z galerii
- Clear Picture
+ Usuń obrazek
Odśwież listy
@@ -56,7 +56,7 @@
%s\'s tasks. Tap for all.
- Private: tap to share this list
+ Prywatna: puknij by udostępnić
Odśwież
@@ -91,13 +91,13 @@
Zapisz i udostępnij
- Who
+ Kto
Ja
- Anyone
+ Ktokolwiek
Inny...
@@ -106,7 +106,7 @@
Dodaj współpracowników:
- Share with Friends
+ Udostępnij znajomym
Lista: %s
@@ -118,7 +118,7 @@
Widomość zaproszenia:
- Pomoc mi to zrobić!
+ Pomóż mi to zrobić!
Utwórz tag udostępnienia?
@@ -153,13 +153,13 @@
Astrid.com umożliwia dostęp do zadań online, udostępniania i przekazywania innym.
- Login with Facebook
+ Zaloguj przez Facebook
- Login with Google
+ Zaloguj przez Google
- Don\'t use Google or Facebook?
+ Nie używasz Google ani Facebooka?
Zarejestruj się tutaj
@@ -186,28 +186,28 @@
Utwórz nowe konto
- Zalogój sie do Astrid.com
+ Zaloguj sie do Astrid.com
Proszę połączyć się z Google:
- Astrid nie wysyła wiadomości email bez zezwolenia.
+ Astrid nie wysyła wiadomości e-mail bez zezwolenia.
Astrid.com (Beta!)
- Use HTTPS
- HTTPS enabled (slower)
- HTTPS disabled (faster)
+ Użycie HTTPS
+ HTTPS włączone (wolniej)
+ HTTPS wyłączone (szybciej)
Synchronizuj
- Nowe komentarze otrzymano / kliknij po więcej informacji
+ Otrzymano nowe komentarze / kliknij po więcej informacji
@@ -244,9 +244,9 @@
Stan
- Latest backup:\n%s
+ Ostatnia kopia zapasowa:\n%s
- Ostatnie niepowodzenie kopii zapasowej
+ Błąd zapisu ostatniej kopii
(dotknij, aby zobaczyć błąd)
@@ -375,11 +375,11 @@
Ładowanie...
- Dismiss
+ Porzuć
OK
- Cancel
+ Anuluj
@@ -394,7 +394,7 @@
- Accept EULA to get started!
+ Zaakceptuj EULA by rozpocząć!
@@ -406,7 +406,7 @@
Komentarze
- Nic do pokazania
+ Brak komentarzy
Odśwież komentarze
@@ -429,7 +429,7 @@
Ustawienia
- Support
+ Wsparcie
Przeszukaj tą listę
@@ -438,7 +438,7 @@
Własny filtr
- Add a task
+ Dodaj zadanie
Tap to assign %s a task
@@ -447,15 +447,15 @@
Powiadomienia są wyciszone. Nie będziesz w stanie usłyszeć Astrid!
- Astrid reminders are disabled! You will not receive any reminders
+ Powiadomienia są wyłączone! Nie otrzymasz żadnych powiadomień
- - Active
+ - Aktywne
- Dzisiaj
- - Soon
- - Late
+ - Wkrótce
+ - Spóźnione
- Gotowe
- - Hidden
+ - Ukryte
@@ -485,7 +485,7 @@
Usuń zadanie
- Przywrócone zadanie
+ Przywróć zadanie
Usuń zadanie na trwałe
@@ -564,7 +564,7 @@
Utworzono skrót: %s
- New Filter
+ Nowy filtr
@@ -578,7 +578,7 @@
Podstawowe
- Udostęp
+ Udostępnij
Alarmy
@@ -590,7 +590,7 @@
Tytuł
- When
+ Kiedy
Podsumowanie zadania
@@ -608,7 +608,7 @@
Brak
- Show Task
+ Pokaż zadanie
- Ładowanie...
@@ -658,28 +658,28 @@
- Przyszły miesiąc
- No time
+ Bez godziny
- Zawsze
- - At due date
- - Dzień przez wymaganiem
- - Tydzień przed wymaganiem
+ - W terminie
+ - Dzień przed terminem
+ - Tydzień przed terminem
- Konkretny dzień/godzina
- Task Title
- Who
- When
- More Section
+ Tytuł zadania
+ Kto
+ Kiedy
+ Sekcja "Więcej"
Skala ważności
Listy
Notatki
- Reminders
- Timer Controls
- Share With Friends
+ Przypomnienia
+ Kontrola czasu
+ Udostępnij
@@ -695,7 +695,7 @@
- @string/TEA_control_share
- Show in my list
+ Pokaż na mojej liście
Szukasz więcej funkcji?
@@ -707,9 +707,9 @@
Więcej
- When is this due?
+ Na kiedy ma być zrobione?
- Date/Time
+ Data/Godzina
@@ -739,7 +739,7 @@
Astrid: Właściwości
- deactivated
+ nieaktywne
Wygląd
@@ -752,9 +752,9 @@
Pokaż notatki w zadaniu
- Beast Mode
- Customize the layout of the Task Edit Page
- Reset to defaults
+ Tryb "Beast"
+ Dostosuj układ strony edycji zadania
+ Powrót domyślne
Notatki będą wyświetlane na pasku szybkiego działania
@@ -762,7 +762,7 @@
Notatki będą zawsze wyświetlane
- Color Theme
+ Kolorystyka
Aktualnie: %s
@@ -777,10 +777,10 @@
- - Day
- - Night
- - Transparent (White Text)
- - Transparent (Black Text)
+ - Dzień
+ - Noc
+ - Przezroczysty (biały tekst)
+ - Przezroczysty (czarny tekst)
@@ -796,15 +796,15 @@
Oczyszczone %d zadań!
Uwaga! Oczyszczone zadania nie mogą być odzyskane bez pliku kopii zapasowej!
- Delete Calendar Events for Completed Tasks
- Do you really want to delete all your events for completed tasks?
+ Usuń wydarzenia kalendarza dla zakończonych zadań
+ Na pewno chcesz usunąć wszystkie wydarzenia dla zakończonych zadań?
- Deleted %d calendar events!
+ Usunięto %d wydarzeń kalendarza!
- Delete All Calendar Events for Tasks
- Do you really want to delete all your events for tasks?
+ Usuń wszystkie zdarzenia kalendarza dla zadań
+ Na pewno chcesz usunąć wszystkie wydarzenia dla zadań?
- Deleted %d calendar events!
+ Usunięto %d wydarzeń kalendarza!
@@ -846,7 +846,7 @@
O Astrid
-Bieżąca wersja: %s\n\n Astrid is open-source and proudly maintained by Todoroo, Inc.
+Bieżąca wersja: %s\n\n Astrid ma otwarte źródła i jest zarządzana z dumą przez Todoroo, Inc.
Pomoc
@@ -893,14 +893,14 @@
Aktualnie: %s
- Default Add To Calendar
+ Domyślnie dodawaj do kalendarza
- New tasks will not create an event in the Google Calendar
+ Nowe zadania nie utworzą wydarzeń w Kalendarzu Google
- New tasks will be in the calendar: \"%s\"
+ Nowe zadania będą w kalendarzu: \"%s\"
- Default Ring/Vibrate type
+ Domyślny dzwonek/wibracja
Aktualnie: %s
@@ -924,17 +924,17 @@
- Nie ukrywaj
- - Zadanie jest wymagane
- - Dzień przez wymaganiem
- - Tydzień przed wymaganiem
+ - Do terminu zadania
+ - Do dnia przed terminem
+ - Do tygodnia przed terminem
- - Brak przypomnień dla terminu nieprzekraczalnego
- - W dniu terminu nieprzekraczalnego
+ - Brak przypomnień
+ - W dniu terminu
- Gdy zaległe
- - W nieprzekraczalnym terminie lub gdy zaległe
+ - W terminie lub gdy zaległe
@@ -963,7 +963,7 @@
Własny filtr...
- Filters
+ Filtry
Usuń filtr
@@ -1062,19 +1062,19 @@
Integracja z kalendarzem:
- Add to Calendar
+ Dodaj do kalendarza
- Otwórz zdarzenie kalendarza
+ Otwórz wydarzenie kalendarza
- Błąd podczas otwierania zdarzenia!
+ Błąd podczas otwierania wydarzenia!
- Zdarzenie kalendarza również uaktualnione!
+ Wydarzenie kalendarza również uaktualnione!
- Don\'t add
+ Nie dodawaj
@@ -1102,7 +1102,7 @@
Zadania Google: %s
- Creating list...
+ Tworzenie listy...
Nowa nazwa listy:
@@ -1121,10 +1121,10 @@
Na liście GTasks...
- Clearing completed tasks...
+ Czyszczenie zakończonych zadań...
- Clear Completed
+ Wyczyść zakończone
@@ -1168,9 +1168,9 @@
Google Tasks (Beta!)
- Synch przy Zapisie
+ Synch. przy Zapisie
- Synch poszczególne zadania, ponieważ są one zapisane
+ Synch. poszczególne zadania, gdy są one zapisane
@@ -1178,16 +1178,16 @@
Astrid: Zadania Google
- Google\'s Task API is in beta and has encountered an error. The service may be down, please try again later.
+ API Zadań Google jest w fazie beta i napotkano błąd. Serwis może być niedostępny, spróbuj ponownie później.
- Account %s not found--please log out and log back in from the Google Tasks settings.
+ Nie znaleziono konta %s --proszę wyloguj się i zaloguj ponownie w ustawieniach Google Zadań.
- Unable to authenticate with Google Tasks. Please check your account password or try again later.
+ Uwierzytelnienie w Google Zadania nieudane. Proszę, sprawdź poprawność swego hasła lub spróbuj ponownie później.
- Error in your phone\'s account manager. Please log out and log back in from the Google Tasks settings.
+ Błąd w menadżerze kont Twojego telefonu. Proszę, wyloguj się i zaloguj ponownie w ustawieniach Google Zadań.
@@ -1223,7 +1223,7 @@
- Ustaw synch z Astrid.com
+ Ustaw synch. z Astrid.com
@@ -1237,39 +1237,39 @@
- Add a task here
+ Dodaj zadanie tutaj
- Tap task to edit and share
+ Puknij zadanie by je edytować i udostępnić
- Tap to edit or share this list
+ Puknij ustawienia listy by udostępnić całą listę
- Collaborators can help you build your list or finish tasks
+ Współpracownicy mogą Ci pomóc stworzyć listę lub wykonać zadania
Witaj w Astrid!
- By using Astrid you agree to the
+ Używając Astrid zgadzasz się na
- \"Terms of Service\"
+ \"Warunki korzystania z usług\"
- Login with Username/Password
+ Zaloguj za pomocą loginu/hasła
- Login Later
+ Zaloguj później
- Why not sign in?
+ Czemu by się nie zalogować?
- I\'ll do it!
+ Zrobię to!
- No thanks
+ Nie, dzięki
- Sign in to get the most out of Astrid!
- For free, you get online backup, full synchronization with Astrid.com, the
- ability to add tasks via email, and you can even share task lists with friends!
+ Zaloguj się by wyciągnąć z Astrid jeszcze więcej!
+ Za darmo otrzymasz kopię zapasową online, pełną synchronizację z Astrid.com,
+ możliwość dodawania zadań przez e-mail i będziesz mógł dzielić się swoimi listami zadań ze znajomymi!
@@ -1389,7 +1389,7 @@
- Zalogój do OpenCRX
+ Zaloguj do OpenCRX
Zaloguj się na konto OpenCRX
@@ -1617,7 +1617,7 @@
- Reminders
+ Przypomnienia
Przypomnij mi:
@@ -1673,11 +1673,11 @@
Ustawienia przypomnienia
- Reminders Enabled?
+ Przypomnienia włączone?
- Astrid reminders are enabled (this is normal)
+ Przypomnienia Astrid są włączone (to normalne)
- Astrid reminders will never appear on your phone
+ Przypomnienia Astrid nigdy nie pojawią się na Twoim telefonie
Początek czasu wyciszenia
@@ -1732,7 +1732,7 @@
Astrid nie będzie powiadamiał wibracjami podczas wysyłania powiadomienia
- Astrid Zachęta
+ Zachęta Astrid
Astrid pojawi się podczas przypomnienia
@@ -1961,9 +1961,9 @@
Odstęp powtarzania
- Never
+ Nigdy
- Don\'t repeat
+ Nie powtarzaj
@@ -2112,7 +2112,7 @@
Not in any List
- Not in an Astrid List
+ Poza listą Astrid
Lista: %s
diff --git a/astrid/res/values/keys.xml b/astrid/res/values/keys.xml
index c29987055..7ad0a63d2 100644
--- a/astrid/res/values/keys.xml
+++ b/astrid/res/values/keys.xml
@@ -328,6 +328,7 @@
showed_collaborators_help
showed_when_shortcut
showed_when_row
+ tutorial
diff --git a/astrid/res/values/strings-welcome.xml b/astrid/res/values/strings-welcome.xml
index 5fb8476d2..38c36c9eb 100644
--- a/astrid/res/values/strings-welcome.xml
+++ b/astrid/res/values/strings-welcome.xml
@@ -3,6 +3,8 @@
Accept EULA to get started!
+ Show Tutorial
+
Welcome to Astrid!
Make lists
Share lists
@@ -11,6 +13,8 @@
Discover
Connect now\nto get started!
+ That\'s it!
+
The perfect personal\nto-do list that works great\nwith friends
Perfect for any list:\nto read, to watch, to buy,\nto visit, to do!
Share lists\nwith friends, housemates,\nor your sweetheart!
@@ -19,4 +23,6 @@
Additional features,\nproductivity tips, and\nsuggestions from friends
Login
+ Tap Astrid to return.
+
\ No newline at end of file
diff --git a/astrid/res/xml/preferences.xml b/astrid/res/xml/preferences.xml
index 656fc2d26..03ff2e753 100644
--- a/astrid/res/xml/preferences.xml
+++ b/astrid/res/xml/preferences.xml
@@ -3,8 +3,9 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/EPr_title">
-
-
+
+
+
syncActions = new LinkedHashSet();
protected FilterAdapter adapter = null;
private boolean mDualFragments;
@@ -239,8 +206,6 @@ public class FilterListActivity extends ExpandableListFragment {
startActivity(intent);
} else {
setUpList();
- if (actFmPreferenceService.isLoggedIn())
- onRefreshRequested(false);
}
}
@@ -296,8 +261,6 @@ public class FilterListActivity extends ExpandableListFragment {
adapter.registerRecevier();
// also load sync actions
- getActivity().registerReceiver(syncActionReceiver, new android.content.IntentFilter(AstridApiConstants.BROADCAST_SEND_SYNC_ACTIONS));
- syncActions.clear();
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_REQUEST_SYNC_ACTIONS);
getActivity().sendOrderedBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
}
@@ -308,7 +271,6 @@ public class FilterListActivity extends ExpandableListFragment {
super.onPause();
if(adapter != null)
adapter.unregisterRecevier();
- getActivity().unregisterReceiver(syncActionReceiver);
}
/* ======================================================================
@@ -436,11 +398,6 @@ public class FilterListActivity extends ExpandableListFragment {
public boolean onOptionsItemSelected(final MenuItem item) {
// handle my own menus
switch (item.getItemId()) {
- case MENU_REFRESH_ID: {
- performSyncAction();
- //onRefreshRequested(true);
- return true;
- }
case MENU_SEARCH_ID: {
getActivity().onSearchRequested();
return true;
@@ -464,7 +421,6 @@ public class FilterListActivity extends ExpandableListFragment {
}
case CONTEXT_MENU_SHORTCUT: {
ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo)item.getMenuInfo();
-
final Intent shortcutIntent = item.getIntent();
FilterListItem filter = ((FilterAdapter.ViewHolder)info.targetView.getTag()).item;
if(filter instanceof Filter)
@@ -490,80 +446,6 @@ public class FilterListActivity extends ExpandableListFragment {
return false;
}
- /**
- * Refresh user tags
- */
- private void onRefreshRequested(final boolean manual) {
- if (!manual) {
- long lastFetchDate = Preferences.getLong(LAST_TAG_REFRESH_KEY, 0);
- if(DateUtilities.now() < lastFetchDate + 300000L) {
- return;
- }
- }
- final ProgressDialog progressDialog;
-
- final NotificationManager nm = new NotificationManager.AndroidNotificationManager(getActivity());
- final Notification notification = new Notification(android.R.drawable.stat_notify_sync, null, System.currentTimeMillis());
- final int notificationId = updateNotification(getActivity(), notification);
- notification.flags |= Notification.FLAG_ONGOING_EVENT;
-
- if (manual) {
- progressDialog = DialogUtilities.progressDialog(getActivity(), getString(R.string.DLG_please_wait));
- } else {
- progressDialog = null;
- nm.notify(notificationId, notification);
- }
-
- new Thread(new Runnable() {
- @SuppressWarnings("nls")
- @Override
- public void run() {
- try {
- Preferences.setLong(LAST_TAG_REFRESH_KEY, DateUtilities.now());
- actFmSyncService.fetchTags(0);
-
- Activity activity = getActivity();
- if (activity != null) {
- getActivity().runOnUiThread(new Runnable() {
- @Override
- public void run() {
- adapter.clear();
- adapter.getLists();
- }
- });
- }
-
- } catch (IOException e) {
- if (manual)
- exceptionService.displayAndReportError(getActivity(), "refresh-tags-io", e);
- else
- exceptionService.reportError("refresh-tags-io", e);
- } catch (JSONException e) {
- if (manual)
- exceptionService.displayAndReportError(getActivity(), "refresh-tags-json", e);
- else
- exceptionService.reportError("refresh-tags-io", e);
- } finally {
- if (manual)
- DialogUtilities.dismissDialog(getActivity(), progressDialog);
- else
- nm.cancel(notificationId);
- }
- }
- }).start();
- }
-
- private int updateNotification(Context context, Notification notification) {
- String notificationTitle = context.getString(R.string.actfm_notification_title);
- Intent intent = new Intent(context, ActFmPreferences.class);
- PendingIntent notificationIntent = PendingIntent.getActivity(context, 0,
- intent, 0);
- notification.setLatestEventInfo(context,
- notificationTitle, context.getString(R.string.SyP_progress),
- notificationIntent);
- return Constants.NOTIFICATION_SYNC;
- }
-
private void showCreateShortcutDialog(final Intent shortcutIntent,
final Filter filter) {
FrameLayout frameLayout = new FrameLayout(getActivity());
@@ -617,126 +499,4 @@ public class FilterListActivity extends ExpandableListFragment {
super.onActivityResult(requestCode, resultCode, data);
}
-
- /**
- * Receiver which receives sync provider intents
- *
- * @author Tim Su
- *
- */
- protected class SyncActionReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- if(intent == null || !AstridApiConstants.BROADCAST_SEND_SYNC_ACTIONS.equals(intent.getAction()))
- return;
-
- try {
- Bundle extras = intent.getExtras();
- SyncAction syncAction = extras.getParcelable(AstridApiConstants.EXTRAS_RESPONSE);
- syncActions.add(syncAction);
- } catch (Exception e) {
- exceptionService.reportError("receive-sync-action-" + //$NON-NLS-1$
- intent.getStringExtra(AstridApiConstants.EXTRAS_ADDON), e);
- }
- }
- }
-
- private void performSyncAction() {
- if (syncActions.size() == 0) {
- String desiredCategory = getString(R.string.SyP_label);
-
- // Get a list of all sync plugins and bring user to the prefs pane
- // for one of them
- Intent queryIntent = new Intent(AstridApiConstants.ACTION_SETTINGS);
- PackageManager pm = getActivity().getPackageManager();
- List resolveInfoList = pm.queryIntentActivities(
- queryIntent, PackageManager.GET_META_DATA);
- int length = resolveInfoList.size();
- ArrayList syncIntents = new ArrayList();
-
- // Loop through a list of all packages (including plugins, addons)
- // that have a settings action: filter to sync actions
- for (int i = 0; i < length; i++) {
- ResolveInfo resolveInfo = resolveInfoList.get(i);
- Intent intent = new Intent(AstridApiConstants.ACTION_SETTINGS);
- intent.setClassName(resolveInfo.activityInfo.packageName,
- resolveInfo.activityInfo.name);
-
- String category = MetadataHelper.resolveActivityCategoryName(resolveInfo, pm);
- if(MilkPreferences.class.getName().equals(resolveInfo.activityInfo.name) &&
- !MilkUtilities.INSTANCE.isLoggedIn())
- continue;
-
- if (category.equals(desiredCategory)) {
- syncIntents.add(new IntentWithLabel(intent,
- resolveInfo.activityInfo.loadLabel(pm).toString()));
- }
- }
-
- final Intent[] actions = syncIntents.toArray(new Intent[syncIntents.size()]);
- DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface click, int which) {
- startActivity(actions[which]);
- }
- };
-
- showSyncOptionMenu(actions, listener);
- }
- else if(syncActions.size() == 1) {
- SyncAction syncAction = syncActions.iterator().next();
- try {
- if (actFmPreferenceService.isLoggedIn())
- onRefreshRequested(true);
- else {
- syncAction.intent.send();
- Toast.makeText(getActivity(), R.string.SyP_progress_toast,
- Toast.LENGTH_LONG).show();
- }
- } catch (CanceledException e) {
- //
- }
- } else {
- // We have >1 sync actions, pop up a dialogue so the user can
- // select just one of them (only sync one at a time)
- final SyncAction[] actions = syncActions.toArray(new SyncAction[syncActions.size()]);
- DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface click, int which) {
- try {
- SyncAction action = actions[which];
- if (action.label.contains("Astrid"))
- onRefreshRequested(true);
- else {
- action.intent.send();
- Toast.makeText(getActivity(), R.string.SyP_progress_toast,
- Toast.LENGTH_LONG).show();
- }
- } catch (CanceledException e) {
- //
- }
- }
- };
- showSyncOptionMenu(actions, listener);
- }
- }
-
- /**
- * Show menu of sync options. This is shown when you're not logged into any services, or logged into
- * more than one.
- * @param
- * @param items
- * @param listener
- */
- private void showSyncOptionMenu(TYPE[] items, DialogInterface.OnClickListener listener) {
- ArrayAdapter syncAdapter = new ArrayAdapter(getActivity(),
- android.R.layout.simple_spinner_dropdown_item, items);
-
- // show a menu of available options
- new AlertDialog.Builder(getActivity())
- .setTitle(R.string.SyP_label)
- .setAdapter(syncAdapter, listener)
- .show().setOwnerActivity(getActivity());
- }
-
}
diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java
index 5bac9b778..ebd8b512a 100644
--- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java
+++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java
@@ -26,6 +26,7 @@ import android.content.SharedPreferences.Editor;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
+import android.graphics.PixelFormat;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
@@ -44,6 +45,7 @@ import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
@@ -106,6 +108,8 @@ import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.SyncV2Service;
+import com.todoroo.astrid.service.SyncV2Service.SyncResultCallback;
+import com.todoroo.astrid.service.SyncV2Service.SyncV2Provider;
import com.todoroo.astrid.service.TagDataService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.UpgradeService;
@@ -206,6 +210,8 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
private boolean isFilter;
private final TaskListContextMenuExtensionLoader contextMenuExtensionLoader = new TaskListContextMenuExtensionLoader();
+
+ private SyncResultCallback syncResultCallback;
private VoiceInputAssistant voiceInputAssistant;
// --- fragment handling variables
@@ -554,6 +560,18 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
SharedPreferences publicPrefs = AstridPreferences.getPublicPrefs(getActivity());
sortFlags = publicPrefs.getInt(SortHelper.PREF_SORT_FLAGS, 0);
sortSort = publicPrefs.getInt(SortHelper.PREF_SORT_SORT, 0);
+
+ // dithering
+ getActivity().getWindow().setFormat(PixelFormat.RGBA_8888);
+ getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
+
+ syncResultCallback = new ProgressBarSyncResultCallback(getActivity(),
+ R.id.progressBar, new Runnable() {
+ @Override
+ public void run() {
+ ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
+ }
+ });
}
// Subclasses can override these to customize extras in quickadd intent
@@ -1182,18 +1200,15 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
}
protected void performSyncServiceV2Sync(boolean manual) {
- syncService.synchronizeActiveTasks(manual, new ProgressBarSyncResultCallback(getActivity(),
- R.id.progressBar, new Runnable() {
- @Override
- public void run() {
- ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
- }
- }));
+ syncService.synchronizeActiveTasks(manual, syncResultCallback);
Preferences.setLong(PREF_LAST_AUTO_SYNC, DateUtilities.now());
}
protected void performSyncAction() {
- if (syncActions.size() == 0 && !syncService.isActive()) {
+ List activeV2Providers = syncService.activeProviders();
+ int activeSyncs = syncActions.size() + activeV2Providers.size();
+
+ if (activeSyncs == 0) {
String desiredCategory = getString(R.string.SyP_label);
// Get a list of all sync plugins and bring user to the prefs pane
@@ -1233,21 +1248,35 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
};
showSyncOptionMenu(actions, listener);
- }
- else {
- performSyncServiceV2Sync(true);
-
- if(syncActions.size() > 0) {
- for(SyncAction syncAction : syncActions) {
- try {
- syncAction.intent.send();
- } catch (CanceledException e) {
- //
+
+ } else {
+ // We have sync actions, pop up a dialogue so the user can
+ // select just one of them (only sync one at a time)
+ final Object[] actions = new Object[activeSyncs];
+
+ int i;
+ for(i = 0; i < activeV2Providers.size(); i++)
+ actions[i] = activeV2Providers.get(i);
+ for(SyncAction syncAction : syncActions)
+ actions[i++] = syncAction;
+
+ DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface click, int which) {
+ if(actions[which] instanceof SyncAction) {
+ try {
+ ((SyncAction)actions[which]).intent.send();
+ Toast.makeText(getActivity(), R.string.SyP_progress_toast,
+ Toast.LENGTH_LONG).show();
+ } catch (CanceledException e) {
+ //
+ }
+ } else {
+ ((SyncV2Provider)actions[which]).synchronizeActiveTasks(true, syncResultCallback);
}
}
- Toast.makeText(getActivity(), R.string.SyP_progress_toast,
- Toast.LENGTH_LONG).show();
- }
+ };
+ showSyncOptionMenu(actions, listener);
}
}
@@ -1259,6 +1288,11 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
* @param listener
*/
private void showSyncOptionMenu(TYPE[] items, DialogInterface.OnClickListener listener) {
+ if(items.length == 1) {
+ listener.onClick(null, 0);
+ return;
+ }
+
ArrayAdapter adapter = new ArrayAdapter(getActivity(),
android.R.layout.simple_spinner_dropdown_item, items);
diff --git a/astrid/src/com/todoroo/astrid/service/StartupService.java b/astrid/src/com/todoroo/astrid/service/StartupService.java
index 9b9dfa251..ef8127a63 100644
--- a/astrid/src/com/todoroo/astrid/service/StartupService.java
+++ b/astrid/src/com/todoroo/astrid/service/StartupService.java
@@ -16,7 +16,6 @@ import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
-import android.content.res.Resources;
import android.media.AudioManager;
import android.util.Log;
import android.widget.Toast;
@@ -37,7 +36,6 @@ import com.todoroo.astrid.backup.BackupConstants;
import com.todoroo.astrid.backup.BackupService;
import com.todoroo.astrid.backup.TasksXmlImporter;
import com.todoroo.astrid.dao.Database;
-import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.gtasks.sync.GtasksSyncOnSaveService;
import com.todoroo.astrid.opencrx.OpencrxCoreUtils;
@@ -139,9 +137,9 @@ public class StartupService {
int defaultTheme = abChooser.getChoiceForOption(ABOptions.AB_THEME_KEY);
if (defaultTheme == 0)
- Preferences.setString(R.string.p_theme, "white");
+ Preferences.setString(R.string.p_theme, "white"); //$NON-NLS-1$
else
- Preferences.setString(R.string.p_theme, "black");
+ Preferences.setString(R.string.p_theme, "black"); //$NON-NLS-1$
} else {
abChooser.setChoiceForOption(ABOptions.AB_THEME_KEY, 0);
Preferences.setLong(AstridPreferences.P_FIRST_LAUNCH, 0);
@@ -170,10 +168,6 @@ public class StartupService {
}
AstridPreferences.setCurrentVersion(version);
}
- //Startup tasks
-// if(latestSetVersion == 0) {
-// onFirstTime();
-// }
upgradeService.performSecondaryUpgrade(context);
@@ -224,49 +218,7 @@ public class StartupService {
hasStartedUp = true;
}
- /**
- * Create tasks for first time users
- */
- private void onFirstTime() {
- final Resources r = ContextManager.getResources();
- try {
- new Thread(new Runnable() {
- @Override
- public void run() {
- database.openForWriting();
-
- if(taskService.countTasks() > 0)
- return;
-
- for(int i = 0; i < INTRO_TASKS.length; i += 3)
- addIntroTask(r, INTRO_TASKS[i], INTRO_TASKS[i + 1], INTRO_TASKS[i + 2]);
- Preferences.setBoolean(AstridPreferences.P_FIRST_ACTION, true);
- Preferences.setBoolean(AstridPreferences.P_FIRST_LIST, true);
- }
- }).start();
- } catch (Exception e) {
- exceptionService.reportError("on-first-time", e); //$NON-NLS-1$
- }
- }
-
- private static final int[] INTRO_TASKS = new int[] {
- R.string.intro_task_2_summary,
- R.string.intro_task_2_note,
- Task.URGENCY_DAY_AFTER,
- R.string.intro_task_3_summary,
- R.string.intro_task_3_note,
- Task.URGENCY_NONE,
- };
- public static final int INTRO_TASK_SIZE = INTRO_TASKS.length / 3;
-
- private void addIntroTask(Resources r, int summary, int note, int dueSetting) {
- Task task = new Task();
- task.setValue(Task.TITLE, r.getString(summary));
- task.setValue(Task.NOTES, r.getString(note));
- long dueDate = Task.createDueDate(dueSetting, 0);
- task.setValue(Task.DUE_DATE, dueDate);
- taskService.save(task);
- }
+ public static final int INTRO_TASK_SIZE = 0;
/**
* If database exists, no tasks but metadata, and a backup file exists, restore it
diff --git a/astrid/src/com/todoroo/astrid/service/SyncV2Service.java b/astrid/src/com/todoroo/astrid/service/SyncV2Service.java
index b6545e8d0..b4796b067 100644
--- a/astrid/src/com/todoroo/astrid/service/SyncV2Service.java
+++ b/astrid/src/com/todoroo/astrid/service/SyncV2Service.java
@@ -1,5 +1,9 @@
package com.todoroo.astrid.service;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import com.todoroo.astrid.actfm.sync.ActFmSyncV2Provider;
/**
@@ -35,10 +39,36 @@ public class SyncV2Service {
public void finished();
}
- public interface SyncV2Provider {
- public boolean isActive();
- public void synchronizeActiveTasks(boolean manual, SyncResultCallback callback);
- public void synchronizeList(Object list, boolean manual, SyncResultCallback callback);
+ abstract public static class SyncV2Provider {
+ /**
+ * @return sync provider name (displayed in sync menu)
+ */
+ abstract public String getName();
+
+ /**
+ * @return true if this provider is logged in
+ */
+ abstract public boolean isActive();
+
+ /**
+ * Synchronize all of user's active tasks
+ * @param manual whether manually triggered
+ * @param callback callback object
+ */
+ abstract public void synchronizeActiveTasks(boolean manual, SyncResultCallback callback);
+
+ /**
+ * Synchronize a single list
+ * @param list object representing list (TaskListActivity-dependent)
+ * @param manual whether was manually triggered
+ * @param callback callback object
+ */
+ abstract public void synchronizeList(Object list, boolean manual, SyncResultCallback callback);
+
+ @Override
+ public String toString() {
+ return getName();
+ }
}
/*
@@ -51,16 +81,17 @@ public class SyncV2Service {
};
/**
- * Determine if synchronization is available
+ * Returns active sync providers
*
* @param callback
*/
- public boolean isActive() {
+ public List activeProviders() {
+ ArrayList actives = new ArrayList();
for(SyncV2Provider provider : providers) {
if(provider.isActive())
- return true;
+ actives.add(provider);
}
- return false;
+ return Collections.unmodifiableList(actives);
}
/**
diff --git a/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java b/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java
index d6af41751..1e3b0ccd7 100644
--- a/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java
+++ b/astrid/src/com/todoroo/astrid/service/UpdateMessageService.java
@@ -14,6 +14,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.text.TextUtils;
+import android.view.WindowManager.BadTokenException;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property.StringProperty;
@@ -92,8 +93,20 @@ public class UpdateMessageService {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
- DialogUtilities.htmlDialog(activity,
- html, R.string.UpS_updates_title);
+ try {
+ DialogUtilities.htmlDialog(activity,
+ html, R.string.UpS_updates_title);
+ } catch (BadTokenException bt) {
+ try {
+ Activity current = (Activity) ContextManager.getContext();
+ DialogUtilities.htmlDialog(current,
+ html, R.string.UpS_updates_title);
+ } catch (ClassCastException c) {
+ // Oh well, context wasn't an activity
+ } catch (BadTokenException bt2) {
+ // Oh well, activity isn't running
+ }
+ }
}
});
}
diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java
index c89e0bb8e..7695b263d 100644
--- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java
+++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java
@@ -175,17 +175,11 @@ public final class UpgradeService {
StringBuilder changeLog = new StringBuilder();
if (from >= V3_9_2 && from < V3_9_2_2) {
- newVersionString(changeLog, "3.9.2.2", new String[] {
- "Reduced APK size",
- "Fixed bugs with Google Task sync",
- });
- }
-
- if (from < V3_9_2) {
- newVersionString(changeLog, "3.9.2 (01/13/12)", new String[] {
- "Made selecting dates and times easier:",
- "New tutorial walkthrough for new users",
- "Stomped on a few bugs",
+ newVersionString(changeLog, "3.9.2.2 (1/19/12)", new String[] {
+ "Astrid now recognizes words like 'tomorrow', 'monday', '!!!' and '2 pm' to set date and importance",
+ "New tutorial walkthrough for new users. Access it from the settings menu!",
+ "Reduced APK size",
+ "Minor UI tweaks, bug fixes",
"Feedback welcomed!"
});
}
@@ -193,7 +187,7 @@ public final class UpgradeService {
if (from >= V3_9_1 && from < V3_9_1_1) {
newVersionString(changeLog, "3.9.1.1 (01/06/12)", new String[] {
"Fixed a few bugs:",
- " Crash when selecting certain lists",
+ " Crash when selecting certain lists",
" Some lists not displayed",
" Wrong text color when assigning tasks in Night theme"
});
diff --git a/astrid/src/com/todoroo/astrid/utility/TitleParser.java b/astrid/src/com/todoroo/astrid/utility/TitleParser.java
index 33a1f918a..556f5916a 100644
--- a/astrid/src/com/todoroo/astrid/utility/TitleParser.java
+++ b/astrid/src/com/todoroo/astrid/utility/TitleParser.java
@@ -29,19 +29,28 @@ public class TitleParser {
priorityHelper(task);
}
- private static void listHelper(Task task, ArrayList tags) {
+ public static String trimParenthesis(String pattern){
+ if (pattern.charAt(0) == '#' || pattern.charAt(0) == '@') {
+ pattern = pattern.substring(1);
+ }
+ if ('(' == pattern.charAt(0)) {
+ return pattern.substring(1, pattern.length()-2);
+ }
+ return pattern;
+ }
+ public static void listHelper(Task task, ArrayList tags) {
String inputText = task.getValue(Task.TITLE);
- Pattern tagPattern = Pattern.compile("(\\s|^)#([^\\s]+)");
- Pattern contextPattern = Pattern.compile("(\\s|^)(@[^\\s]+)");
+ Pattern tagPattern = Pattern.compile("(\\s|^)#(\\(.*\\)|[^\\s]+)");
+ Pattern contextPattern = Pattern.compile("(\\s|^)@(\\(.*\\)|[^\\s]+)");
while(true) {
Matcher m = tagPattern.matcher(inputText);
if(m.find()) {
- tags.add(m.group(2));
+ tags.add(TitleParser.trimParenthesis(m.group(2)));
} else {
m = contextPattern.matcher(inputText);
if(m.find()) {
- tags.add(m.group(2));
+ tags.add(TitleParser.trimParenthesis(m.group(2)));
}else{
break;
}
diff --git a/astrid/src/com/todoroo/astrid/welcome/tutorial/ViewPagerAdapter.java b/astrid/src/com/todoroo/astrid/welcome/tutorial/ViewPagerAdapter.java
index 2089ea5ab..6d6139543 100644
--- a/astrid/src/com/todoroo/astrid/welcome/tutorial/ViewPagerAdapter.java
+++ b/astrid/src/com/todoroo/astrid/welcome/tutorial/ViewPagerAdapter.java
@@ -13,6 +13,9 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.timsu.astrid.R;
+import com.todoroo.andlib.service.Autowired;
+import com.todoroo.andlib.service.DependencyInjectionService;
+import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.viewpagerindicator.TitleProvider;
public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
@@ -60,10 +63,20 @@ public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
};
private final Context context;
public WelcomeWalkthrough parent;
+ @Autowired ActFmPreferenceService actFmPreferenceService;
- public ViewPagerAdapter( Context context )
+ public ViewPagerAdapter( Context context, boolean manual)
{
this.context = context;
+ DependencyInjectionService.getInstance().inject(this);
+
+ if(manual) {
+ layouts[layouts.length - 1] = R.layout.welcome_walkthrough_page;
+ title[title.length - 1] = R.string.welcome_title_7_return;
+ images[images.length - 1] = R.drawable.welcome_walkthrough_1;
+ body[body.length - 1] = R.string.welcome_body_7_return;
+ }
+
}
@@ -81,14 +94,15 @@ public class ViewPagerAdapter extends PagerAdapter implements TitleProvider
View pageView = inflater.inflate(layouts[position], null, true);
pageView.setLayoutParams( new ViewGroup.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT));
- if (position != getCount()-1){
- ImageView imageView = (ImageView) pageView.findViewById(R.id.welcome_walkthrough_image);
- imageView.setImageResource(images[position]);
+ if (pageView.findViewById(R.id.welcome_walkthrough_image) != null) {
+ ImageView imageView = (ImageView) pageView.findViewById(R.id.welcome_walkthrough_image);
+ imageView.setImageResource(images[position]);
+
+ TextView titleView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_title);
+ titleView.setText(title[position]);
- TextView titleView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_title);
- titleView.setText(title[position]);
- TextView bodyView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_body);
- bodyView.setText(body[position]);
+ TextView bodyView = (TextView) pageView.findViewById(R.id.welcome_walkthrough_body);
+ bodyView.setText(body[position]);
}
((ViewPager)pager).addView( pageView, 0 );
diff --git a/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java b/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java
index 169423aef..31737a1d8 100644
--- a/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java
+++ b/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java
@@ -31,12 +31,14 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
public static final String KEY_SHOWED_WELCOME_LOGIN = "key_showed_welcome_login"; //$NON-NLS-1$
+ public static final String TOKEN_MANUAL_SHOW = "manual"; //$NON-NLS-1$
+
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
- mAdapter = new ViewPagerAdapter(this);
+ mAdapter = new ViewPagerAdapter(this, getIntent().hasExtra(TOKEN_MANUAL_SHOW));
mAdapter.parent = this;
mPager = (ViewPager)findViewById(R.id.pager);
@@ -44,6 +46,7 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
+
}
@Override
protected int getContentViewResource() {
@@ -68,10 +71,22 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
protected void initializeUI() {
if(mAdapter == null)
return;
- if(currentPage == mAdapter.getCount()-1){
- super.initializeUI();
- setupTermsOfService();
- setupLoginLater();
+ if(currentPage == mAdapter.getCount()-1) {
+ if(findViewById(R.id.fb_login) != null) {
+ super.initializeUI();
+ setupTermsOfService();
+ setupLoginLater();
+ } else {
+ OnClickListener done = new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ finish();
+ }
+ };
+ currentView.findViewById(R.id.welcome_walkthrough_title).setOnClickListener(done);
+ currentView.findViewById(R.id.welcome_walkthrough_image).setOnClickListener(done);
+ }
+
}
}
@@ -106,12 +121,6 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
Button pwLogin = (Button) findViewById(R.id.pw_login);
pwLogin.setOnClickListener(signUpListener);
}
- /*
- protected void setupWalkthroughLogin() {
- Button loginButton = (Button)currentView.findViewById(R.id.walkthrough_login);
- loginButton.setOnClickListener(showWalkthroughLoginListener);
- }*/
-
protected void setupLoginLater() {
TextView loginLater = (TextView)currentView.findViewById(R.id.login_later);
diff --git a/tests/src/com/todoroo/andlib/utility/TitleParserTest.java b/tests/src/com/todoroo/andlib/utility/TitleParserTest.java
index 27ab7a4ed..704b0d3ed 100644
--- a/tests/src/com/todoroo/andlib/utility/TitleParserTest.java
+++ b/tests/src/com/todoroo/andlib/utility/TitleParserTest.java
@@ -1,6 +1,7 @@
package com.todoroo.andlib.utility;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -10,6 +11,7 @@ import com.timsu.astrid.R;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.test.DatabaseTestCase;
+import com.todoroo.astrid.utility.TitleParser;
public class TitleParserTest extends DatabaseTestCase {
@@ -504,6 +506,48 @@ public class TitleParserTest extends DatabaseTestCase {
//----------------Repeats end----------------//
+ //----------------Tags begin----------------//
+ /** tests all words using priority 0 */
+ public void testTagsPound() throws Exception {
+ String[] acceptedStrings = {
+ "#tag",
+ "#a",
+ "#(a cool tag)",
+ "#(cool)"
+ };
+ TaskService taskService = new TaskService();
+ Task task = new Task();
+ for (String acceptedString:acceptedStrings){
+ task = new Task();
+ task.setValue(Task.TITLE, "Jog " + acceptedString); //test at end of task. should set importance.
+ ArrayList tags = new ArrayList();
+ TitleParser.listHelper(task, tags);
+ assertTrue("test pound at failed for string: " + acceptedString + " for tags: " + tags.toString(),tags.contains(TitleParser.trimParenthesis(acceptedString)));
+ }
+ }
+
+ /** tests all words using priority 0 */
+ public void testTagsAt() throws Exception {
+ String[] acceptedStrings = {
+ "@tag",
+ "@a",
+ "@(a cool tag)",
+ "@(cool)"
+ };
+ TaskService taskService = new TaskService();
+ Task task = new Task();
+ for (String acceptedString:acceptedStrings){
+ task = new Task();
+ task.setValue(Task.TITLE, "Jog " + acceptedString); //test at end of task. should set importance.
+ ArrayList tags = new ArrayList();
+ TitleParser.listHelper(task, tags);
+ assertTrue("testTagsAt failed for string: " + acceptedString+ " for tags: " + tags.toString(),tags.contains(TitleParser.trimParenthesis(acceptedString)));
+ }
+ }
+
+
+
+ //----------------Priority end----------------//
}