Merge and resolve conflicts from upstream/master

pull/14/head
Sam Bosley 13 years ago
commit 78b607aba9

@ -100,6 +100,27 @@
</classpath>
</javadoc>
</target>
<target name="setup-lite">
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="API_PACKAGE = .*"
replace="API_PACKAGE = &quot;com.todoroo.astridlite&quot;;"
/>
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="ASTRID_PACKAGE = .*"
replace="ASTRID_PACKAGE = &quot;com.todoroo.astridlite&quot;;"
/>
</target>
<target name="teardown-lite">
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="API_PACKAGE = .*"
replace="API_PACKAGE = &quot;com.todoroo.astrid&quot;;"
/>
<replaceregexp file="${source.dir}/com/todoroo/astrid/api/AstridApiConstants.java"
match="ASTRID_PACKAGE = .*"
replace="ASTRID_PACKAGE = &quot;com.timsu.astrid&quot;;"
/>
</target>
<import file="${sdk.dir}/tools/ant/build.xml" />

@ -66,16 +66,16 @@ public class DateUtilities {
}
/** Represents a single hour */
public static long ONE_HOUR = 3600000L;
public static final long ONE_HOUR = 3600000L;
/** Represents a single day */
public static long ONE_DAY = 24 * ONE_HOUR;
public static final long ONE_DAY = 24 * ONE_HOUR;
/** Represents a single week */
public static long ONE_WEEK = 7 * ONE_DAY;
public static final long ONE_WEEK = 7 * ONE_DAY;
/** Represents a single minute */
public static long ONE_MINUTE = 60000L;
public static final long ONE_MINUTE = 60000L;
/* ======================================================================
* =========================================================== formatters

@ -51,6 +51,20 @@ public class Preferences {
editor.putBoolean(key, value);
}
/**
* Helper to write to editor if key specified is null
* @param prefs
* @param editor
* @param r
* @param keyResource
* @param value
*/
public static void setIfUnset(SharedPreferences prefs, Editor editor, Resources r, int keyResource, String value) {
String key = r.getString(keyResource);
if(!prefs.contains(key) || !(prefs.getAll().get(key) instanceof String))
editor.putString(key, value);
}
/* ======================================================================
* ======================================================= helper methods
* ====================================================================== */

@ -21,17 +21,22 @@ public class AstridApiConstants {
/**
* Astrid broadcast base package name
*/
public static final String PACKAGE = "com.todoroo.astrid";
public static final String API_PACKAGE = "com.todoroo.astrid";
/**
* Astrid app base package name
*/
public static final String ASTRID_PACKAGE = "com.timsu.astrid";
/**
* Permission for reading tasks and receiving to GET_FILTERS intent
*/
public static final String PERMISSION_READ = PACKAGE + ".READ";
public static final String PERMISSION_READ = API_PACKAGE + ".READ";
/**
* Permission for writing and creating tasks
*/
public static final String PERMISSION_WRITE = PACKAGE + ".WRITE";
public static final String PERMISSION_WRITE = API_PACKAGE + ".WRITE";
/**
* Name of Astrid's publicly readable preference store
@ -82,34 +87,34 @@ public class AstridApiConstants {
/**
* Action name for broadcast intent requesting add-ons
*/
public static final String BROADCAST_REQUEST_ADDONS = PACKAGE + ".REQUEST_ADDONS";
public static final String BROADCAST_REQUEST_ADDONS = API_PACKAGE + ".REQUEST_ADDONS";
/**
* Action name for broadcast intent sending add-ons back to Astrid
* <li> EXTRAS_RESPONSE an {@link Addon} object
*/
public static final String BROADCAST_SEND_ADDONS = PACKAGE + ".SEND_ADDONS";
public static final String BROADCAST_SEND_ADDONS = API_PACKAGE + ".SEND_ADDONS";
// --- Filters API
/**
* Action name for broadcast intent requesting filters
*/
public static final String BROADCAST_REQUEST_FILTERS = PACKAGE + ".REQUEST_FILTERS";
public static final String BROADCAST_REQUEST_FILTERS = API_PACKAGE + ".REQUEST_FILTERS";
/**
* Action name for broadcast intent sending filters back to Astrid
* <li> EXTRAS_ADDON your add-on identifier </li>
* <li> EXTRAS_RESPONSE an array of {@link FilterListItem}s </li>
*/
public static final String BROADCAST_SEND_FILTERS = PACKAGE + ".SEND_FILTERS";
public static final String BROADCAST_SEND_FILTERS = API_PACKAGE + ".SEND_FILTERS";
// -- Custom criteria API
/**
* Action name for a broadcast intent requesting custom filter criteria (e.g. "Due by, Tagged, Tag contains", etc.)
*/
public static final String BROADCAST_REQUEST_CUSTOM_FILTER_CRITERIA = PACKAGE + ".REQUEST_CUSTOM_FILTER_CRITERIA";
public static final String BROADCAST_REQUEST_CUSTOM_FILTER_CRITERIA = API_PACKAGE + ".REQUEST_CUSTOM_FILTER_CRITERIA";
/**
@ -117,7 +122,7 @@ public class AstridApiConstants {
* <li> EXTRAS_ADDON you add-on identifier
* <li> EXTRAS_RESPONSE an array of {@link CustomFilterCriterion} </li>
*/
public static final String BROADCAST_SEND_CUSTOM_FILTER_CRITERIA = PACKAGE + ".SEND_CUSTOM_FILTER_CRITERIA";
public static final String BROADCAST_SEND_CUSTOM_FILTER_CRITERIA = API_PACKAGE + ".SEND_CUSTOM_FILTER_CRITERIA";
// --- Edit Controls API
@ -125,14 +130,14 @@ public class AstridApiConstants {
* Action name for broadcast intent requesting task edit controls
* <li> EXTRAS_TASK_ID id of the task user is editing
*/
public static final String BROADCAST_REQUEST_EDIT_CONTROLS = PACKAGE + ".REQUEST_EDIT_CONTROLS";
public static final String BROADCAST_REQUEST_EDIT_CONTROLS = API_PACKAGE + ".REQUEST_EDIT_CONTROLS";
/**
* Action name for broadcast intent sending task edit controls back to Astrid
* <li> EXTRAS_ADDON your add-on identifier
* <li> EXTRAS_RESPONSE a {@link RemoteViews} with your edit controls
*/
public static final String BROADCAST_SEND_EDIT_CONTROLS = PACKAGE + ".SEND_EDIT_CONTROLS";
public static final String BROADCAST_SEND_EDIT_CONTROLS = API_PACKAGE + ".SEND_EDIT_CONTROLS";
// --- Task Details API
@ -143,7 +148,7 @@ public class AstridApiConstants {
* <li> EXTRAS_TASK_ID id of the task
* <li> EXTRAS_EXTENDED whether request is for standard or extended details
*/
public static final String BROADCAST_REQUEST_DETAILS = PACKAGE + ".REQUEST_DETAILS";
public static final String BROADCAST_REQUEST_DETAILS = API_PACKAGE + ".REQUEST_DETAILS";
/**
* Action name for broadcast intent sending details back to Astrid
@ -152,7 +157,7 @@ public class AstridApiConstants {
* <li> EXTRAS_EXTENDED whether request is for standard or extended details
* <li> EXTRAS_RESPONSE a String
*/
public static final String BROADCAST_SEND_DETAILS = PACKAGE + ".SEND_DETAILS";
public static final String BROADCAST_SEND_DETAILS = API_PACKAGE + ".SEND_DETAILS";
// --- Sync Action API
@ -160,14 +165,14 @@ public class AstridApiConstants {
* Action name for broadcast intent requesting a listing of active
* sync actions users can activate from the menu
*/
public static final String BROADCAST_REQUEST_SYNC_ACTIONS = PACKAGE + ".REQUEST_SYNC_ACTIONS";
public static final String BROADCAST_REQUEST_SYNC_ACTIONS = API_PACKAGE + ".REQUEST_SYNC_ACTIONS";
/**
* Action name for broadcast intent sending sync provider information back to Astrid
* <li> EXTRAS_ADDON your add-on identifier
* <li> EXTRAS_RESPONSE a {@link SyncAction} to invoke synchronization
*/
public static final String BROADCAST_SEND_SYNC_ACTIONS = PACKAGE + ".SEND_SYNC_ACTIONS";
public static final String BROADCAST_SEND_SYNC_ACTIONS = API_PACKAGE + ".SEND_SYNC_ACTIONS";
// --- Task Decorations API
@ -175,7 +180,7 @@ public class AstridApiConstants {
* Action name for broadcast intent requesting task list decorations for a task
* <li> EXTRAS_TASK_ID id of the task
*/
public static final String BROADCAST_REQUEST_DECORATIONS = PACKAGE + ".REQUEST_DECORATIONS";
public static final String BROADCAST_REQUEST_DECORATIONS = API_PACKAGE + ".REQUEST_DECORATIONS";
/**
* Action name for broadcast intent sending decorations back to Astrid
@ -183,7 +188,7 @@ public class AstridApiConstants {
* <li> EXTRAS_TASK_ID id of the task
* <li> EXTRAS_RESPONSE a {@link TaskDecoration}
*/
public static final String BROADCAST_SEND_DECORATIONS = PACKAGE + ".SEND_DECORATIONS";
public static final String BROADCAST_SEND_DECORATIONS = API_PACKAGE + ".SEND_DECORATIONS";
// --- Actions API
@ -191,33 +196,33 @@ public class AstridApiConstants {
* Action name for intents to be displayed on task context menu
* <li> EXTRAS_TASK_ID id of the task
*/
public static final String ACTION_TASK_CONTEXT_MENU = PACKAGE + ".CONTEXT_MENU";
public static final String ACTION_TASK_CONTEXT_MENU = API_PACKAGE + ".CONTEXT_MENU";
/**
* Action name for intents to be displayed on Astrid's task list menu
* <li> EXTRAS_ADDON your add-on identifier
* <li> EXTRAS_RESPONSE an array of {@link Intent}s
*/
public static final String ACTION_TASK_LIST_MENU = PACKAGE + ".TASK_LIST_MENU";
public static final String ACTION_TASK_LIST_MENU = API_PACKAGE + ".TASK_LIST_MENU";
/**
* Action name for intents to be displayed in Astrid's settings. By default,
* your application will be put into the category named by your application,
* but you can add a string meta-data with name "category" to override this.
*/
public static final String ACTION_SETTINGS = PACKAGE + ".SETTINGS";
public static final String ACTION_SETTINGS = API_PACKAGE + ".SETTINGS";
// --- Events API
/**
* Action name for broadcast intent notifying add-ons that Astrid started up
*/
public static final String BROADCAST_EVENT_STARTUP = PACKAGE + ".STARTUP";
public static final String BROADCAST_EVENT_STARTUP = API_PACKAGE + ".STARTUP";
/**
* Action name for broadcast intent notifying Astrid task list to refresh
*/
public static final String BROADCAST_EVENT_REFRESH = PACKAGE + ".REFRESH";
public static final String BROADCAST_EVENT_REFRESH = API_PACKAGE + ".REFRESH";
/**
* Action name for broadcast intent notifying Astrid to clear detail cache
@ -225,20 +230,20 @@ public class AstridApiConstants {
* logging out of a sync provider). Use this call carefully, as loading
* details can degrade the performance of Astrid.
*/
public static final String BROADCAST_EVENT_FLUSH_DETAILS = PACKAGE + ".FLUSH_DETAILS";
public static final String BROADCAST_EVENT_FLUSH_DETAILS = API_PACKAGE + ".FLUSH_DETAILS";
/**
* Action name for broadcast intent notifying that task was created or
* title was changed
* <li> EXTRAS_TASK_ID id of the task
*/
public static final String BROADCAST_EVENT_TASK_LIST_UPDATED = PACKAGE + ".TASK_LIST_UPDATED";
public static final String BROADCAST_EVENT_TASK_LIST_UPDATED = API_PACKAGE + ".TASK_LIST_UPDATED";
/**
* Action name for broadcast intent notifying that task was completed
* <li> EXTRAS_TASK_ID id of the task
*/
public static final String BROADCAST_EVENT_TASK_COMPLETED = PACKAGE + ".TASK_COMPLETED";
public static final String BROADCAST_EVENT_TASK_COMPLETED = API_PACKAGE + ".TASK_COMPLETED";
/**
* Action name for broadcast intent notifying that task was created from repeating template
@ -246,7 +251,7 @@ public class AstridApiConstants {
* <li> EXTRAS_OLD_DUE_DATE task old due date (could be 0)
* <li> EXTRAS_NEW_DUE_DATE task new due date (will not be 0)
*/
public static final String BROADCAST_EVENT_TASK_REPEATED = PACKAGE + ".TASK_REPEATED";
public static final String BROADCAST_EVENT_TASK_REPEATED = API_PACKAGE + ".TASK_REPEATED";
/**
* Action name for broadcast intent notifying that a repeating task has passed its repeat_until value
@ -254,11 +259,11 @@ public class AstridApiConstants {
* <li> EXTRAS_OLD_DUE_DATE task old due date (could be 0)
* <li> EXTRAS_NEW_DUE_DATE task new due date (will not be 0)
*/
public static final String BROADCAST_EVENT_TASK_REPEAT_FINISHED = PACKAGE + ".TASK_REPEAT_FINISHED";
public static final String BROADCAST_EVENT_TASK_REPEAT_FINISHED = API_PACKAGE + ".TASK_REPEAT_FINISHED";
/**
* Action name for broadcast intent notifying that tag was deleted
*/
public static final String BROADCAST_EVENT_TAG_DELETED = PACKAGE + ".TAG_DELETED";
public static final String BROADCAST_EVENT_TAG_DELETED = API_PACKAGE + ".TAG_DELETED";
}

@ -45,7 +45,7 @@ public class FilterWithCustomIntent extends Filter {
public Intent getCustomIntent() {
Intent intent = new Intent();
intent.putExtra("filter", this); //$NON-NLS-1$
intent.setComponent(new ComponentName("com.timsu.astrid", "com.todoroo.astrid.activity.TaskListActivity")); //$NON-NLS-1$ //$NON-NLS-2$
intent.setComponent(new ComponentName(AstridApiConstants.ASTRID_PACKAGE, "com.todoroo.astrid.activity.TaskListActivity")); //$NON-NLS-1$
if(customExtras != null)
intent.putExtras(customExtras);

@ -32,7 +32,7 @@ public class Metadata extends AbstractModel {
public static final Table TABLE = new Table("metadata", Metadata.class);
/** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name);
// --- properties

@ -32,7 +32,7 @@ public class StoreObject extends AbstractModel {
public static final Table TABLE = new Table("store", StoreObject.class);
/** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name);
// --- properties

@ -36,7 +36,7 @@ public final class TagData extends RemoteModel {
public static final Class<? extends OutstandingEntry<TagData>> OUTSTANDING_MODEL = TagOutstanding.class;
/** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name);
// --- properties

@ -41,7 +41,7 @@ public final class Task extends RemoteModel {
public static final Class<? extends OutstandingEntry<Task>> OUTSTANDING_MODEL = TaskOutstanding.class;
/** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name);
// --- properties

@ -32,7 +32,7 @@ public class Update extends RemoteModel {
public static final Table TABLE = new Table("updates", Update.class);
/** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name);
// --- properties

@ -33,7 +33,7 @@ public final class User extends RemoteModel {
public static final Table TABLE = new Table("users", User.class);
/** content uri for this model */
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.API_PACKAGE + "/" +
TABLE.name);
// --- properties

@ -31,5 +31,6 @@
<classpathentry kind="lib" path="libs/crittercism_v2_1_2.jar"/>
<classpathentry kind="lib" path="libs/findbugs-annotations.jar"/>
<classpathentry kind="lib" path="libs/CWAC-SackOfViewsAdapter.jar"/>
<classpathentry kind="lib" path="libs/gcm.jar" sourcepath="libs/gcm-src.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

@ -6,7 +6,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionName="4.5.0-sync-beta"
android:versionName="4.6.0-sync-beta"
android:versionCode="300">
<!-- widgets, alarms, and services will break if Astrid is installed on SD card -->
@ -45,6 +45,9 @@
<!-- required for in-app billing of premium subscriptions -->
<uses-permission android:name="com.android.vending.BILLING"/>
<!-- Required for GCM - keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- ============================================== Exported Permissions = -->
@ -82,7 +85,8 @@
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<application android:icon="@drawable/icon" android:label="@string/app_name"
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/Theme"
android:name="greendroid.app.GDApplication"
android:hardwareAccelerated="false"
@ -412,19 +416,17 @@
android:windowSoftInputMode="stateHidden"
android:theme="@style/Theme.Dialog"/>
<activity android:name="com.todoroo.astrid.actfm.CommentsActivity"
android:windowSoftInputMode="stateHidden"/>
<receiver android:name="com.timsu.astrid.C2DMReceiver" permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.timsu.astrid" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.timsu.astrid" />
</intent-filter>
</receiver>
android:windowSoftInputMode="stateHidden"/>
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.timsu.astrid" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
<!-- gtasks -->
<activity android:name="com.todoroo.astrid.gtasks.GtasksListFragment"

@ -64,12 +64,14 @@
message="Cannot run two different modes at the same time. If you are running more than one debug/release/instrument type targets, call them from different Ant calls." />
</target>
<target name="-pre-build" depends="get-version, copy-sources, updatekeys, updatekeys-release, update-market-strategy">
<target name="-pre-build" depends="get-version, copy-sources, setup-lite, updatekeys, updatekeys-release, update-market-strategy">
<mkdir dir="gen" />
<property name="proguard.jar" location="antlib/proguard.jar" />
<taskdef name="proguard" classname="proguard.ant.ProGuardTask" classpath="${proguard.jar}" />
</target>
<target name="-post-astrid-build" depends="teardown-lite" />
<target name="copy-sources">
<delete dir="${source.dir}" />
<mkdir dir="${source.dir}" />
@ -150,6 +152,8 @@
match="API_SECRET = .*"
replace="API_SECRET = &quot;${apikey.analytics.secret}&quot;;" />
<antcall target="updatekeys-lite" />
<replaceregexp file="${source.dir}/com/todoroo/astrid/billing/BillingConstants.java"
match="PUB_KEY_REPLACE_CHAR = .*"
replace="PUB_KEY_REPLACE_CHAR = &#39;${apikey.googleplay.replacechar}&#39;;" />
@ -159,6 +163,15 @@
replace="PUB_KEY_OBFUSCATED = &quot;${apikey.googleplay.pubkey}&quot;;" />
</target>
<target name="updatekeys-lite" if="lite.enabled">
<replaceregexp file="${source.dir}/com/todoroo/astrid/service/abtesting/ABTestInvoker.java"
match="API_KEY = .*"
replace="API_KEY = &quot;${apikey.analytics.lite.id}&quot;;" />
<replaceregexp file="${source.dir}/com/todoroo/astrid/service/abtesting/ABTestInvoker.java"
match="API_SECRET = .*"
replace="API_SECRET = &quot;${apikey.analytics.lite.secret}&quot;;" />
</target>
<target name="updatekeys-pre" if="pre.astrid" description="use pre.astrid.com">
<property file="${apikey.keyfile}" />
<replaceregexp file="${source.dir}/com/todoroo/astrid/actfm/sync/ActFmInvoker.java"
@ -174,6 +187,7 @@
match="APP_ID = .*"
replace="APP_ID = &quot;${apikey.facebook.id}&quot;;" />
</target>
<target name="-release-prompt-for-password" description="override to set signature">
<property file="${signjar.passfile}" /> <echo message="${signjar.passfile}" />
@ -216,6 +230,118 @@
<move file="AndroidManifest_old.xml" tofile="AndroidManifest.xml" />
</target>
<!-- build lite release package with updated version name -->
<target name="release-lite" depends="clean, set-lite-property, release" />
<target name="debug-lite" depends="clean, set-lite-property, debug" />
<target name="set-lite-property">
<property name="lite.enabled" value="true" />
<subant target="setup-lite">
<fileset file="../api/build.xml"/>
</subant>
</target>
<target name="setup-lite" if="lite.enabled">
<copy file="AndroidManifest.xml" tofile="AndroidManifest_old.xml" />
<replaceregexp file="${source.dir}/com/todoroo/astrid/utility/Constants.java"
match="ASTRID_LITE = .*"
replace="ASTRID_LITE = true;" />
<replaceregexp file="${source.dir}/com/todoroo/astrid/utility/Constants.java"
match="LOCALYTICS_KEY = .*"
replace="LOCALYTICS_KEY = LOCALYTICS_KEY_LITE;" />
<replaceregexp file="AndroidManifest.xml"
match="package=&quot;.*&quot;"
replace="package=&quot;com.todoroo.astridlite&quot;" />
<replaceregexp file="AndroidManifest.xml"
match="authorities=&quot;(.*)&quot;"
replace="authorities=&quot;\1.lite&quot;"
flags="g"/>
<replaceregexp file="AndroidManifest.xml"
match="action android:name=&quot;com.todoroo.astrid"
replace="action android:name=&quot;com.todoroo.astridlite"
flags="g"
/>
<replaceregexp file="AndroidManifest.xml"
match="category android:name=&quot;com.timsu.astrid&quot;"
replace="category android:name=&quot;com.todoroo.astridlite&quot;"
flags="g"
/>
<replaceregexp file="AndroidManifest.xml"
match="com.timsu.astrid.C2DMReceiver"
replace="com.todoroo.astridlite.C2DMReceiver"
flags="g"
/>
<replaceregexp file="AndroidManifest.xml"
match="com.timsu.astrid.permission"
replace="com.todoroo.astridlite.permission"
flags="g"
/>
<replaceregexp file="AndroidManifest.xml"
match="com.todoroo.astrid.READ"
replace="com.todoroo.astridlite.READ"
flags="g"
/>
<replaceregexp file="AndroidManifest.xml"
match="com.todoroo.astrid.WRITE"
replace="com.todoroo.astridlite.WRITE"
flags="g"
/>
<replaceregexp file="AndroidManifest.xml"
match="(android:versionName=&quot;)4"
replace="\10"
/>
<replaceregexp file="AndroidManifest.xml"
match="application android:icon=&quot;(.*)&quot;"
replace="application android:icon=&quot;@drawable/icon_simple&quot;"
/>
<replaceregexp file="${source.dir}/com/todoroo/astrid/backup/BackupConstants.java"
match="ASTRID_DIR = .*"
replace="ASTRID_DIR = &quot;/astridlite&quot;;"
/>
<move file="${source.dir}/com/timsu/astrid" tofile="${source.dir}/com/todoroo/astridlite" />
<copy todir="res_old">
<fileset dir="res"/>
</copy>
<replace dir="res" token="com.timsu.astrid" value="com.todoroo.astridlite"/>
<replace dir="${source.dir}" token="com.timsu.astrid" value="com.todoroo.astridlite"/>
<replaceregexp match="&gt;(.*\s)task(.*)"
replace="&gt;\1to-do\2"
flags="g">
<fileset dir="res/values">
<include name="strings-*.xml"/>
</fileset>
</replaceregexp>
<replaceregexp match="&gt;(.*)Task(.*)"
replace="&gt;\1To-do\2"
flags="g">
<fileset dir="res/values">
<include name="strings-*.xml"/>
</fileset>
</replaceregexp>
<replaceregexp file="res/values/strings-core.xml"
match="app_name&quot;&gt;.*&lt;"
replace="app_name&quot;&gt;Simple To-do&lt;"
/>
<replaceregexp file="res/values/strings-widget.xml"
match="(PPW_widget.*)Astrid(.*)"
replace="\1Simple To-do -\2"
flags="g"
/>
</target>
<target name="teardown-lite" if="lite.enabled">
<delete dir="res" />
<move file="res_old" tofile="res"/>
<move file="AndroidManifest_old.xml" tofile="AndroidManifest.xml" />
<subant target="teardown-lite">
<fileset file="../api/build.xml"/>
</subant>
</target>
<!-- build custom unsigned package with updated version name -->
<target name="unsigned-custom" depends="clean">
@ -290,14 +416,14 @@
-->
<!-- version-tag: custom -->
<target name="debug" depends="-set-debug-files, -do-debug"
<target name="debug" depends="-set-debug-files, -do-debug, -post-astrid-build"
description="Builds the application and signs it with a debug key.">
<record-build-info />
<delete file="${out.packaged.file}" />
</target>
<target name="release"
depends="-set-release-mode, -release-obfuscation-check, -package, -release-prompt-for-password, -release-nosign"
depends="-set-release-mode, -release-obfuscation-check, -package, -release-prompt-for-password, -release-nosign, -post-astrid-build"
if="has.keystore"
description="Builds the application. The generated apk file must be signed before
it is published.">
@ -318,8 +444,21 @@
<!-- Zip aligns the APK -->
<mkdir dir="../release" />
<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-release.apk" />
<property name="out.release.file"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
<if>
<condition>
<isset property="lite.enabled"/>
</condition>
<then>
<property name="out.release.file"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release-lite.apk" />
</then>
<else>
<property name="out.release.file"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
</else>
</if>
<zipalign-helper in.package="${out.unaligned.file}"
out.package="${out.final.file}" />
<copy file="${out.final.file}" tofile="${out.release.file}" />

Binary file not shown.

Binary file not shown.

@ -1,8 +1,3 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.timsu.astrid;
import java.io.IOException;
@ -12,7 +7,6 @@ import org.json.JSONObject;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@ -20,6 +14,8 @@ import android.provider.Settings.Secure;
import android.text.TextUtils;
import android.util.Log;
import com.google.android.gcm.GCMBaseIntentService;
import com.google.android.gcm.GCMRegistrar;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
@ -55,36 +51,18 @@ import com.todoroo.astrid.tags.TagFilterExposer;
import com.todoroo.astrid.utility.Constants;
@SuppressWarnings("nls")
public class C2DMReceiver extends BroadcastReceiver {
public class GCMIntentService extends GCMBaseIntentService {
public static final String C2DM_SENDER = "c2dm@astrid.com"; //$NON-NLS-1$
public static final String SENDER_ID = "1003855277730"; //$NON-NLS-1$
public static final String PREF_REGISTRATION = "gcm_id";
public static final String PREF_NEEDS_REGISTRATION = "gcm_needs_reg";
private static final String PREF_REGISTRATION = "c2dm_key";
private static final String PREF_LAST_C2DM = "c2dm_last";
private static final String PREF_LAST_GCM = "c2dm_last";
public static final String PREF_C2DM_REGISTRATION = "c2dm_key";
private static final long MIN_MILLIS_BETWEEN_FULL_SYNCS = DateUtilities.ONE_HOUR;
@Autowired TaskService taskService;
@Autowired TagDataService tagDataService;
@Autowired UpdateDao updateDao;
@Autowired ActFmPreferenceService actFmPreferenceService;
@Autowired ActFmSyncService actFmSyncService;
static {
AstridDependencyInjector.initialize();
}
private final SyncResultCallbackAdapter refreshOnlyCallback = new SyncResultCallbackAdapter() {
@Override
public void finished() {
ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
}
};
private static String getDeviceID() {
public static String getDeviceID() {
String id = Secure.getString(ContextManager.getContext().getContentResolver(), Secure.ANDROID_ID);;
if(AndroidUtilities.getSdkVersion() > 8) { //Gingerbread and above
//the following uses relection to get android.os.Build.SERIAL to avoid having to build with Gingerbread
try {
if(!Build.UNKNOWN.equals(Build.SERIAL))
@ -101,31 +79,54 @@ public class C2DMReceiver extends BroadcastReceiver {
return id;
}
@Override
public void onReceive(Context context, final Intent intent) {
ContextManager.setContext(context);
static {
AstridDependencyInjector.initialize();
}
@Autowired
private ActFmSyncService actFmSyncService;
@Autowired
private ActFmPreferenceService actFmPreferenceService;
@Autowired
private TaskService taskService;
@Autowired
private TagDataService tagDataService;
@Autowired
private UpdateDao updateDao;
public GCMIntentService() {
super();
DependencyInjectionService.getInstance().inject(this);
if (intent.getAction().equals("com.google.android.c2dm.intent.REGISTRATION")) {
handleRegistration(intent);
} else if (intent.getAction().equals("com.google.android.c2dm.intent.RECEIVE")) {
new Thread(new Runnable() {
@Override
public void run() {
if (actFmPreferenceService.isLoggedIn()) {
if(intent.hasExtra("web_update"))
if (DateUtilities.now() - actFmPreferenceService.getLastSyncDate() > MIN_MILLIS_BETWEEN_FULL_SYNCS && !actFmPreferenceService.isOngoing())
new ActFmSyncV2Provider().synchronizeActiveTasks(false, refreshOnlyCallback);
else
handleWebUpdate(intent);
else
handleMessage(intent);
}
}
}).start();
}
}
}
// --- web update handling
// ===================== Messaging =================== //
private final SyncResultCallbackAdapter refreshOnlyCallback = new SyncResultCallbackAdapter() {
@Override
public void finished() {
ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
}
};
private static final long MIN_MILLIS_BETWEEN_FULL_SYNCS = DateUtilities.ONE_HOUR;
@Override
protected void onMessage(Context context, Intent intent) {
if (actFmPreferenceService.isLoggedIn()) {
if(intent.hasExtra("web_update"))
if (DateUtilities.now() - actFmPreferenceService.getLastSyncDate() > MIN_MILLIS_BETWEEN_FULL_SYNCS && !actFmPreferenceService.isOngoing())
new ActFmSyncV2Provider().synchronizeActiveTasks(false, refreshOnlyCallback);
else
handleWebUpdate(intent);
else
handleMessage(intent);
}
}
/** Handle web task or list changed */
protected void handleWebUpdate(Intent intent) {
@ -192,10 +193,10 @@ public class C2DMReceiver extends BroadcastReceiver {
if(TextUtils.isEmpty(message))
return;
long lastNotification = Preferences.getLong(PREF_LAST_C2DM, 0);
long lastNotification = Preferences.getLong(PREF_LAST_GCM, 0);
if(DateUtilities.now() - lastNotification < 5000L)
return;
Preferences.setLong(PREF_LAST_C2DM, DateUtilities.now());
Preferences.setLong(PREF_LAST_GCM, DateUtilities.now());
Intent notifyIntent = null;
int notifId;
@ -419,56 +420,67 @@ public class C2DMReceiver extends BroadcastReceiver {
return true;
}
private void handleRegistration(Intent intent) {
final String registration = intent.getStringExtra("registration_id");
if (intent.getStringExtra("error") != null) {
Log.w("astrid-actfm", "error-c2dm: " + intent.getStringExtra("error"));
} else if (intent.getStringExtra("unregistered") != null) {
// un-registration done
} else if (registration != null) {
DependencyInjectionService.getInstance().inject(this);
new Thread() {
@Override
public void run() {
try {
String deviceId = getDeviceID();
if (deviceId != null)
actFmSyncService.invoke("user_set_c2dm", "c2dm", registration, "device_id", deviceId);
else
actFmSyncService.invoke("user_set_c2dm", "c2dm", registration);
Preferences.setString(PREF_REGISTRATION, registration);
} catch (IOException e) {
Log.e("astrid-actfm", "error-c2dm-transfer", e);
}
// ==================== Registration ============== //
public static final void register(Context context) {
try {
if (AndroidUtilities.getSdkVersion() >= 8) {
GCMRegistrar.checkDevice(context);
GCMRegistrar.checkManifest(context);
final String regId = GCMRegistrar.getRegistrationId(context);
if ("".equals(regId)) {
GCMRegistrar.register(context, GCMIntentService.SENDER_ID);
} else {
// TODO: Already registered--do something?
}
}.start();
}
} catch (Exception e) {
// phone may not support gcm
Log.e("actfm-sync", "gcm-register", e);
}
}
/** try to request registration from c2dm service */
public static void register() {
if(Preferences.getStringValue(PREF_REGISTRATION) != null)
return;
new Thread() {
@Override
public void run() {
Context context = ContextManager.getContext();
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(context, 0, new Intent(), 0)); // boilerplate
registrationIntent.putExtra("sender", C2DM_SENDER);
context.startService(registrationIntent);
public static final void unregister(Context context) {
try {
if (AndroidUtilities.getSdkVersion() >= 8) {
GCMRegistrar.unregister(context);
}
}.start();
} catch (Exception e) {
Log.e("actfm-sync", "gcm-unregister", e);
}
}
/** unregister with c2dm service */
public static void unregister() {
Preferences.setString(PREF_REGISTRATION, null);
Context context = ContextManager.getContext();
Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
unregIntent.putExtra("app", PendingIntent.getBroadcast(context, 0, new Intent(), 0));
context.startService(unregIntent);
@Override
protected void onRegistered(Context context, String registrationId) {
actFmSyncService.setGCMRegistration(registrationId);
}
@Override
protected void onUnregistered(Context context, String registrationId) {
// Server can unregister automatically next time it tries to send a message
}
@Override
protected void onError(Context context, String intent) {
// Unrecoverable
}
// =========== Migration ============= //
public static class GCMMigration {
@Autowired
private ActFmPreferenceService actFmPreferenceService;
public GCMMigration() {
DependencyInjectionService.getInstance().inject(this);
}
public void performMigration(Context context) {
if (actFmPreferenceService.isLoggedIn()) {
GCMIntentService.register(context);
}
}
}
}

@ -50,7 +50,7 @@ import com.facebook.android.LoginButton;
import com.facebook.android.Util;
import com.google.android.googlelogin.GoogleLoginServiceConstants;
import com.google.android.googlelogin.GoogleLoginServiceHelper;
import com.timsu.astrid.C2DMReceiver;
import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
@ -95,7 +95,7 @@ public class ActFmLoginActivity extends FragmentActivity implements AuthListener
private Facebook facebook;
private AsyncFacebookRunner facebookRunner;
private TextView errors;
protected TextView errors;
public static final String SHOW_TOAST = "show_toast"; //$NON-NLS-1$
@ -572,12 +572,7 @@ public class ActFmLoginActivity extends FragmentActivity implements AuthListener
setResult(RESULT_OK);
finish();
try {
C2DMReceiver.register();
} catch (Exception e) {
// phone may not support c2dm
exceptionService.reportError("error-c2dm-register", e);
}
GCMIntentService.register(this);
}
@SuppressWarnings("nls")

@ -15,6 +15,7 @@ import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.widget.Toast;
import com.timsu.astrid.R;
@ -71,13 +72,18 @@ public class ActFmPreferences extends SyncProviderPreferences {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
findPreference(getString(R.string.actfm_inapp_billing)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
handleInAppBillingClicked();
return true;
}
});
PreferenceScreen screen = getPreferenceScreen();
Preference inAppBilling = findPreference(getString(R.string.actfm_inapp_billing));
if (Constants.ASTRID_LITE)
screen.removePreference(inAppBilling);
else
inAppBilling.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
handleInAppBillingClicked();
return true;
}
});
findPreference(getString(R.string.actfm_account_type)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override

@ -170,15 +170,6 @@ public class EditPeopleControlSet extends PopupControlSet {
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
sharedWithDialog.setContentView(v, new LayoutParams(metrics.widthPixels - (int)(30 * metrics.density), LayoutParams.WRAP_CONTENT));
Button dismiss = (Button) v.findViewById(R.id.edit_dlg_ok);
if (dismiss != null) {
dismiss.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
DialogUtilities.dismissDialog(EditPeopleControlSet.this.activity, sharedWithDialog);
}
});
}
sharedWithDialog.setOwnerActivity(this.activity);
assignedCustom = (EditText) getView().findViewById(R.id.assigned_custom);
@ -196,6 +187,20 @@ public class EditPeopleControlSet extends PopupControlSet {
setUpListeners();
}
@Override
protected void setupOkButton(View v) {
super.setupOkButton(getSharedWithView());
Button dismiss = (Button) getSharedWithView().findViewById(R.id.edit_dlg_ok);
if (dismiss != null) {
dismiss.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
DialogUtilities.dismissDialog(EditPeopleControlSet.this.activity, sharedWithDialog);
}
});
}
}
@Override
public void readFromTask(Task sourceTask) {
setTask(sourceTask);
@ -404,8 +409,8 @@ public class EditPeopleControlSet extends PopupControlSet {
int taskRabbitIndex = addUnassigned ? 3 : 2;
if (!addContactPicker)
taskRabbitIndex--;
coreUsers.add(taskRabbitIndex, taskRabbitUser);
if(l.didPostToTaskRabbit()){
coreUsers.add(taskRabbitIndex, taskRabbitUser);
assignedIndex = taskRabbitIndex;
}
}

@ -71,7 +71,7 @@ public class TagSettingsActivity extends FragmentActivity {
public static final int REQUEST_ACTFM_LOGIN = 3;
public static final String TOKEN_AUTOPOPULATE_MEMBERS = "autopopulateMembers"; //$NON-NLS-1$
public static final String TOKEN_AUTOPOPULATE_NAME = "autopopulateName"; //$NON-NLS-1$
private static final String MEMBERS_IN_PROGRESS = "members"; //$NON-NLS-1$
@ -149,8 +149,13 @@ public class TagSettingsActivity extends FragmentActivity {
isDialog = AstridPreferences.useTabletLayout(this);
if (isDialog)
setTheme(ThemeService.getDialogTheme());
else
else {
ThemeService.applyTheme(this);
if (ThemeService.getUnsimplifiedTheme() == R.style.Theme_White_Alt)
getTheme().applyStyle(R.style.SaveAsBackWhite, true);
else
getTheme().applyStyle(R.style.SaveAsBack, true);
}
}
private void showCollaboratorsPopover() {
@ -233,7 +238,7 @@ public class TagSettingsActivity extends FragmentActivity {
updateMembers(autopopulateMembers);
getIntent().removeExtra(TOKEN_AUTOPOPULATE_MEMBERS);
}
String autopopulateName = getIntent().getStringExtra(TOKEN_AUTOPOPULATE_NAME);
if (!TextUtils.isEmpty(autopopulateName)) {
tagName.setText(autopopulateName);
@ -494,12 +499,14 @@ public class TagSettingsActivity extends FragmentActivity {
public boolean onCreateOptionsMenu(Menu menu) {
MenuItem item;
item = menu.add(Menu.NONE, MENU_DISCARD_ID, 0, R.string.TEA_menu_discard);
item.setIcon(R.drawable.ic_menu_close);
item.setIcon(ThemeService.getDrawable(R.drawable.ic_menu_close));
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
item = menu.add(Menu.NONE, MENU_SAVE_ID, 0, R.string.TEA_menu_save);
item.setIcon(R.drawable.ic_menu_save);
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
if (isDialog) {
item = menu.add(Menu.NONE, MENU_SAVE_ID, 0, R.string.TEA_menu_save);
item.setIcon(ThemeService.getDrawable(R.drawable.ic_menu_save));
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
return super.onCreateOptionsMenu(menu);
}
@ -513,7 +520,9 @@ public class TagSettingsActivity extends FragmentActivity {
saveSettings();
break;
case android.R.id.home:
finish();
saveSettings();
if (!isFinishing())
finish();
break;
}
return super.onOptionsItemSelected(item);

@ -17,6 +17,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.view.Menu;
import android.support.v4.view.MenuItem;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
@ -71,7 +72,7 @@ public class TagViewFragment extends TaskListFragment {
private static final String LAST_FETCH_KEY = "tag-fetch-"; //$NON-NLS-1$
public static final String BROADCAST_TAG_ACTIVITY = AstridApiConstants.PACKAGE + ".TAG_ACTIVITY"; //$NON-NLS-1$
public static final String BROADCAST_TAG_ACTIVITY = AstridApiConstants.API_PACKAGE + ".TAG_ACTIVITY"; //$NON-NLS-1$
public static final String EXTRA_TAG_NAME = "tag"; //$NON-NLS-1$
@ -83,6 +84,7 @@ public class TagViewFragment extends TaskListFragment {
public static final String EXTRA_TAG_DATA = "tagData"; //$NON-NLS-1$
protected static final int MENU_REFRESH_ID = MENU_SUPPORT_ID + 1;
protected static final int MENU_LIST_SETTINGS_ID = R.string.tag_settings_title;
private static final int REQUEST_CODE_SETTINGS = 0;
@ -188,6 +190,16 @@ public class TagViewFragment extends TaskListFragment {
}
}
@Override
protected void addMenuItems(Menu menu, Activity activity) {
super.addMenuItems(menu, activity);
if (!Preferences.getBoolean(R.string.p_show_list_members, true)) {
MenuItem item = menu.add(Menu.NONE, MENU_LIST_SETTINGS_ID, 0, R.string.tag_settings_title);
item.setIcon(ThemeService.getDrawable(R.drawable.list_settings));
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
}
// --- data loading
@Override
@ -321,6 +333,10 @@ public class TagViewFragment extends TaskListFragment {
}
protected void setUpMembersGallery() {
if (!Preferences.getBoolean(R.string.p_show_list_members, true)) {
getView().findViewById(R.id.members_header).setVisibility(View.GONE);
return;
}
if (tagData == null)
return;
LinearLayout membersView = (LinearLayout)getView().findViewById(R.id.shared_with);
@ -561,6 +577,9 @@ public class TagViewFragment extends TaskListFragment {
case MENU_REFRESH_ID:
refreshData(true);
return true;
case MENU_LIST_SETTINGS_ID:
settingsListener.onClick(null);
return true;
}
return super.handleOptionsMenuItemSelected(id, intent);

@ -8,6 +8,7 @@ import android.widget.ListView;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Order;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.adapter.UpdateAdapter;
@ -55,10 +56,10 @@ public class TaskCommentsFragment extends CommentsFragment {
@Override
protected Cursor getCursor() {
if (!task.containsNonNullValue(Task.REMOTE_ID))
return updateDao.query(Query.select(Update.PROPERTIES).where(Update.TASK_LOCAL.eq(task.getId())));
return updateDao.query(Query.select(Update.PROPERTIES).where(Update.TASK_LOCAL.eq(task.getId())).orderBy(Order.desc(Update.CREATION_DATE)));
else
return updateDao.query(Query.select(Update.PROPERTIES).where(Criterion.or(
Update.TASK.eq(task.getValue(Task.REMOTE_ID)), Update.TASK_LOCAL.eq(task.getId()))));
Update.TASK.eq(task.getValue(Task.REMOTE_ID)), Update.TASK_LOCAL.eq(task.getId()))).orderBy(Order.desc(Update.CREATION_DATE)));
}
@Override

@ -105,8 +105,22 @@ public class ActFmInvoker {
*/
public JSONObject invoke(String method, Object... getParameters) throws IOException,
ActFmServiceException {
return invokeWithApi(null, method, getParameters);
}
/**
* Invokes API method using HTTP GET
*
* @param method
* API method to invoke
* @param getParameters
* Name/Value pairs. Values will be URL encoded.
* @return response object
*/
public JSONObject invokeWithApi(String api, String method, Object... getParameters) throws IOException,
ActFmServiceException {
try {
String request = createFetchUrl(method, getParameters);
String request = createFetchUrl(api, method, getParameters);
Log.e("act-fm-invoke", request);
String response = restClient.get(request);
Log.e("act-fm-invoke-response", response);
@ -135,7 +149,7 @@ public class ActFmInvoker {
public JSONObject post(String method, HttpEntity data, Object... getParameters) throws IOException,
ActFmServiceException {
try {
String request = createFetchUrl(method, getParameters);
String request = createFetchUrl(null, method, getParameters);
Log.e("act-fm-post", request);
String response = restClient.post(request, data);
Log.e("act-fm-post-response", response);
@ -158,7 +172,7 @@ public class ActFmInvoker {
* @throws UnsupportedEncodingException
* @throws NoSuchAlgorithmException
*/
public String createFetchUrl(String method, Object... getParameters) throws UnsupportedEncodingException, NoSuchAlgorithmException {
private String createFetchUrl(String api, String method, Object... getParameters) throws UnsupportedEncodingException, NoSuchAlgorithmException {
ArrayList<Pair<String, Object>> params = new ArrayList<Pair<String, Object>>();
for(int i = 0; i < getParameters.length; i += 2) {
if(getParameters[i+1] instanceof ArrayList) {
@ -195,14 +209,20 @@ public class ActFmInvoker {
});
String url = URL;
if (method.startsWith("/"))
url = url.replaceFirst("/api/", "");
boolean customApi = false;
if (api != null) {
customApi = true;
url = url.replace("api", api);
}
if (Preferences.getBoolean(R.string.actfm_https_key, false))
url = "https:" + url;
else
url = "http:" + url;
StringBuilder requestBuilder = new StringBuilder(url).append(API_VERSION).append("/").append(method).append('?');
StringBuilder requestBuilder = new StringBuilder(url);
if (!customApi)
requestBuilder.append(API_VERSION).append("/");
requestBuilder.append(method).append('?');
StringBuilder sigBuilder = new StringBuilder(method);
for(Pair<String, Object> entry : params) {
if(entry.getRight() == null)

@ -32,6 +32,7 @@ import android.os.ConditionVariable;
import android.text.TextUtils;
import android.util.Log;
import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.AbstractModel;
import com.todoroo.andlib.data.DatabaseDao;
@ -1233,6 +1234,31 @@ public final class ActFmSyncService {
}
}
public void setGCMRegistration(String regId) {
try {
String deviceId = GCMIntentService.getDeviceID();
String existingC2DM = Preferences.getStringValue(GCMIntentService.PREF_C2DM_REGISTRATION);
ArrayList<Object> params = new ArrayList<Object>();
params.add("gcm"); params.add(regId);
if (!TextUtils.isEmpty(deviceId)) {
params.add("device_id"); params.add(deviceId);
}
if (!TextUtils.isEmpty(existingC2DM)) { // Unregisters C2DM with the server for migration purposes
params.add("c2dm"); params.add(existingC2DM);
}
invoke("user_set_gcm", params.toArray(new Object[params.size()]));
Preferences.setString(GCMIntentService.PREF_REGISTRATION, regId);
Preferences.setString(GCMIntentService.PREF_C2DM_REGISTRATION, null);
Preferences.setString(GCMIntentService.PREF_NEEDS_REGISTRATION, null);
} catch (IOException e) {
Preferences.setString(GCMIntentService.PREF_NEEDS_REGISTRATION, regId);
Log.e("gcm", "error-gcm-register", e);
}
}
private void pushQueuedUpdatesForTag(TagData tagData) {
Criterion criterion = null;
if (tagData.getValue(TagData.REMOTE_ID) < 1) {

@ -14,7 +14,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONException;
import org.json.JSONObject;
import com.timsu.astrid.C2DMReceiver;
import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.AbstractModel;
import com.todoroo.andlib.data.TodorooCursor;
@ -148,7 +148,7 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
actFmPreferenceService.setToken(null);
actFmPreferenceService.clearLastSyncDate();
ActFmPreferenceService.premiumLogout();
C2DMReceiver.unregister();
GCMIntentService.unregister(ContextManager.getContext());
}
@Override
@ -197,6 +197,10 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
/** fetch user status hash*/
@SuppressWarnings("nls")
public void updateUserStatus() {
if (Preferences.getStringValue(GCMIntentService.PREF_NEEDS_REGISTRATION) != null) {
actFmSyncService.setGCMRegistration(Preferences.getStringValue(GCMIntentService.PREF_NEEDS_REGISTRATION));
}
if (Preferences.getBoolean(BillingConstants.PREF_NEEDS_SERVER_UPDATE, false)) {
actFmSyncService.updateUserSubscriptionStatus(null, null, null);
}
@ -317,8 +321,8 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
/** @return runnable to fetch changes to tags */
private void startTaskFetcher(final boolean manual, final SyncResultCallback callback,
final AtomicInteger finisher) {
final boolean pushActiveTasksOrder = actFmSyncService.cancelFilterOrderingPush(SubtasksUpdater.ACTIVE_TASKS_ORDER);
final boolean pushTodayOrder = actFmSyncService.cancelFilterOrderingPush(SubtasksUpdater.TODAY_TASKS_ORDER);
final boolean pushActiveTasksOrder = actFmSyncService.cancelFilterOrderingPush(SubtasksUpdater.ACTIVE_TASKS_ORDER) && manual;
final boolean pushTodayOrder = actFmSyncService.cancelFilterOrderingPush(SubtasksUpdater.TODAY_TASKS_ORDER) && manual;
actFmSyncService.fetchActiveTasks(manual, handler, new Runnable() {
@Override
@ -466,8 +470,8 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
fetchTagData(tagData, noRemoteId, manual, callback, finisher);
if(!noRemoteId) {
boolean orderPushQueued = actFmSyncService.cancelTagOrderingPush(tagData.getId()) && manual;
actFmSyncService.waitUntilEmpty();
boolean orderPushQueued = actFmSyncService.cancelTagOrderingPush(tagData.getId());
fetchTasksForTag(tagData, manual, orderPushQueued, callback, finisher);
fetchUpdatesForTag(tagData, manual, callback, finisher);
}

@ -5,6 +5,8 @@
*/
package com.todoroo.astrid.core;
import java.util.ArrayList;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
@ -27,6 +29,7 @@ import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.sql.QueryTemplate;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.activity.FilterListFragment;
import com.todoroo.astrid.api.AstridApiConstants;
@ -100,44 +103,56 @@ public final class CustomFilterExposer extends BroadcastReceiver implements Astr
private Filter[] buildSavedFilters(Context context, Resources r) {
int themeFlags = ThemeService.getFilterThemeFlags();
boolean useCustomFilters = Preferences.getBoolean(R.string.p_use_filters, true);
StoreObjectDao dao = PluginServices.getStoreObjectDao();
TodorooCursor<StoreObject> cursor = dao.query(Query.select(StoreObject.PROPERTIES).where(
TodorooCursor<StoreObject> cursor = null;
if (useCustomFilters)
cursor = dao.query(Query.select(StoreObject.PROPERTIES).where(
StoreObject.TYPE.eq(SavedFilter.TYPE)).orderBy(Order.asc(SavedFilter.NAME)));
try {
Filter[] list = new Filter[cursor.getCount() + 3];
ArrayList<Filter> list = new ArrayList<Filter>();
// stock filters
list[0] = getTodayFilter(r);
list[1] = new Filter(r.getString(R.string.BFE_Recent),
r.getString(R.string.BFE_Recent),
new QueryTemplate().where(
TaskCriteria.ownedByMe()).orderBy(
Order.desc(Task.MODIFICATION_DATE)).limit(15),
null);
list[1].listingIcon = ((BitmapDrawable)r.getDrawable(
ThemeService.getDrawable(R.drawable.filter_pencil, themeFlags))).getBitmap();
list[2] = getAssignedByMeFilter(r);
StoreObject savedFilter = new StoreObject();
for(int i = 3; i < list.length; i++) {
cursor.moveToNext();
savedFilter.readFromCursor(cursor);
list[i] = SavedFilter.load(savedFilter);
Intent deleteIntent = new Intent(context, DeleteActivity.class);
deleteIntent.putExtra(TOKEN_FILTER_ID, savedFilter.getId());
deleteIntent.putExtra(TOKEN_FILTER_NAME, list[i].title);
list[i].contextMenuLabels = new String[] { context.getString(R.string.BFE_Saved_delete) };
list[i].contextMenuIntents = new Intent[] { deleteIntent };
list[i].listingIcon = ((BitmapDrawable)r.getDrawable(
ThemeService.getDrawable(R.drawable.filter_sliders, themeFlags))).getBitmap();
if (Preferences.getBoolean(R.string.p_show_today_filter, true))
list.add(getTodayFilter(r));
if (Preferences.getBoolean(R.string.p_show_recently_modified_filter, true)) {
Filter recent = new Filter(r.getString(R.string.BFE_Recent),
r.getString(R.string.BFE_Recent),
new QueryTemplate().where(
TaskCriteria.ownedByMe()).orderBy(
Order.desc(Task.MODIFICATION_DATE)).limit(15),
null);
recent.listingIcon = ((BitmapDrawable)r.getDrawable(
ThemeService.getDrawable(R.drawable.filter_pencil, themeFlags))).getBitmap();
list.add(recent);
}
if (Preferences.getBoolean(R.string.p_show_ive_assigned_filter, true))
list.add(getAssignedByMeFilter(r));
if (useCustomFilters && cursor != null) {
StoreObject savedFilter = new StoreObject();
for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
savedFilter.readFromCursor(cursor);
Filter f = SavedFilter.load(savedFilter);
Intent deleteIntent = new Intent(context, DeleteActivity.class);
deleteIntent.putExtra(TOKEN_FILTER_ID, savedFilter.getId());
deleteIntent.putExtra(TOKEN_FILTER_NAME, f.title);
f.contextMenuLabels = new String[] { context.getString(R.string.BFE_Saved_delete) };
f.contextMenuIntents = new Intent[] { deleteIntent };
f.listingIcon = ((BitmapDrawable)r.getDrawable(
ThemeService.getDrawable(R.drawable.filter_sliders, themeFlags))).getBitmap();
list.add(f);
}
}
return list;
return list.toArray(new Filter[list.size()]);
} finally {
cursor.close();
if (cursor != null)
cursor.close();
}
}

@ -29,6 +29,7 @@ import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gcal.GCalHelper;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.utility.AstridPreferences;
/**
* Displays the preference screen for users to manage their old tasks and events
@ -111,6 +112,8 @@ public class OldTaskPreferences extends TodorooPreferenceActivity {
deleteDatabase(database.getName());
AstridPreferences.setPreferenceDefaults();
System.exit(0);
}
},

@ -11,7 +11,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
public class CalendarStartupReceiver extends BroadcastReceiver {
public static final String BROADCAST_RESCHEDULE_CAL_ALARMS = AstridApiConstants.PACKAGE + ".SCHEDULE_CAL_REMINDERS"; //$NON-NLS-1$
public static final String BROADCAST_RESCHEDULE_CAL_ALARMS = AstridApiConstants.API_PACKAGE + ".SCHEDULE_CAL_REMINDERS"; //$NON-NLS-1$
@Override
public void onReceive(Context context, Intent intent) {

@ -10,7 +10,6 @@ import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.Menu;
import android.view.MenuInflater;
import android.widget.TextView;
import com.timsu.astrid.R;
@ -110,8 +109,8 @@ public class GtasksListFragment extends SubtasksListFragment {
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
protected void addMenuItems(Menu menu, Activity activity) {
super.addMenuItems(menu, activity);
addMenuItem(menu, R.string.gtasks_GTA_clear_completed, android.R.drawable.ic_input_delete, MENU_CLEAR_COMPLETED_ID, false);
}

@ -47,6 +47,7 @@ import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Order;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Preferences;
@ -287,11 +288,11 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
TodorooCursor<Update> updates;
if (!task.containsNonNullValue(Task.UUID)) {
updates = updateDao.query(Query.select(Update.PROPERTIES).where(Update.TASK_LOCAL.eq(task.getId())));
updates = updateDao.query(Query.select(Update.PROPERTIES).where(Update.TASK_LOCAL.eq(task.getId())).orderBy(Order.desc(Update.CREATION_DATE)));
}
else {
updates = updateDao.query(Query.select(Update.PROPERTIES).where(Criterion.or(
Update.TASK_UUID.eq(task.getValue(Task.UUID)), Update.TASK_LOCAL.eq(task.getId()))));
Update.TASK_UUID.eq(task.getValue(Task.UUID)), Update.TASK_LOCAL.eq(task.getId()))).orderBy(Order.desc(Update.CREATION_DATE)));
}
try {
Update update = new Update();

@ -149,8 +149,10 @@ public class ReminderDialog extends Dialog {
((TextView) findViewById(R.id.reminder_message)).setText(
Notifications.getRandomReminder(activity.getResources().getStringArray(R.array.reminder_responses)));
Task task = taskService.fetchById(taskId, Task.ID, Task.SHARED_WITH);
addFacesToReminder(activity, task);
if (Preferences.getBoolean(R.string.p_rmd_social, true)) {
Task task = taskService.fetchById(taskId, Task.ID, Task.SHARED_WITH);
addFacesToReminder(activity, task);
}
}
private void addFacesToReminder(Activity activity, Task task) {
@ -165,7 +167,7 @@ public class ReminderDialog extends Dialog {
addTagFaces(task.getId(), pictureUrls, isSharedTask);
}
if (pictureUrls.size() > 0 && Preferences.getBoolean(R.string.p_social_reminders, false)) {
if (pictureUrls.size() > 0) {
DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
LinearLayout layout = new LinearLayout(activity);
LinearLayout.LayoutParams containerParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

@ -99,6 +99,11 @@ public class ReminderPreferences extends TodorooPreferenceActivity {
preference.setSummary(R.string.rmd_EPr_enabled_desc_true);
else
preference.setSummary(R.string.rmd_EPr_enabled_desc_false);
} else if (r.getString(R.string.p_rmd_social).equals(preference.getKey())) {
if ((Boolean)value)
preference.setSummary(R.string.rmd_EPr_social_summary_enabled);
else
preference.setSummary(R.string.rmd_EPr_social_summary_disabled);
}
}

@ -210,11 +210,6 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
applyListeners = APPLY_LISTENERS_NONE;
}
@Override
protected int computeMinRowHeight() {
return (int) (metrics.density * 40);
}
@Override
protected ViewHolder getTagFromCheckBox(View v) {
return (ViewHolder)((View)v.getParent()).getTag();
@ -296,7 +291,7 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
}
if (madeChanges) {
updater.writeSerialization(list, updater.serializeTree());
updater.writeSerialization(list, updater.serializeTree(), true);
}
} finally {
recurring.close();
@ -321,6 +316,7 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
updater.onCreateTask(list, getFilter(), task.getId());
fragment.reconstructCursor();
fragment.loadTaskListContent(true);
fragment.selectCustomId(task.getId());
}
public void onDeleteTask(Task task) {

@ -50,7 +50,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
private final HashMap<Long, Node> idToNode;
protected abstract String getSerializedTree(LIST list, Filter filter);
protected abstract void writeSerialization(LIST list, String serialized);
protected abstract void writeSerialization(LIST list, String serialized, boolean shouldQueueSync);
protected abstract void applyToFilter(Filter filter);
public int getIndentForTask(long targetTaskId) {
@ -105,7 +105,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
tasks.close();
}
if (changedThings)
writeSerialization(list, serializeTree());
writeSerialization(list, serializeTree(), false);
}
private void removeNodes(Set<Long> idsToRemove) {
@ -222,7 +222,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
newSiblings.add(insertAfter + 1, node);
}
writeSerialization(list, serializeTree());
writeSerialization(list, serializeTree(), true);
applyToFilter(filter);
}
@ -300,7 +300,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
beforeIndex--;
}
newSiblings.add(beforeIndex, moveThis);
writeSerialization(list, serializeTree());
writeSerialization(list, serializeTree(), true);
applyToFilter(filter);
}
@ -321,7 +321,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
treeRoot.children.add(moveThis);
moveThis.parent = treeRoot;
setNodeIndent(moveThis, 0);
writeSerialization(list, serializeTree());
writeSerialization(list, serializeTree(), true);
applyToFilter(filter);
}
@ -332,7 +332,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
Node newNode = new Node(taskId, treeRoot, 0);
treeRoot.children.add(newNode);
idToNode.put(taskId, newNode);
writeSerialization(list, serializeTree());
writeSerialization(list, serializeTree(), true);
applyToFilter(filter);
}
@ -355,7 +355,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
}
idToNode.remove(taskId);
writeSerialization(list, serializeTree());
writeSerialization(list, serializeTree(), true);
applyToFilter(filter);
}

@ -15,9 +15,10 @@ public class SubtasksFilterUpdater extends SubtasksUpdater<String> {
}
@Override
protected void writeSerialization(String list, String serialized) {
protected void writeSerialization(String list, String serialized, boolean shouldQueueSync) {
Preferences.setString(list, serialized);
actFmSyncService.pushFilterOrderingOnSave(list);
if (shouldQueueSync)
actFmSyncService.pushFilterOrderingOnSave(list);
}
}

@ -15,10 +15,11 @@ public class SubtasksTagUpdater extends SubtasksUpdater<TagData> {
}
@Override
protected void writeSerialization(TagData list, String serialized) {
protected void writeSerialization(TagData list, String serialized, boolean shouldQueueSync) {
list.setValue(TagData.TAG_ORDERING, serialized);
tagDataService.save(list);
actFmSyncService.pushTagOrderingOnSave(list.getId());
if (shouldQueueSync)
actFmSyncService.pushTagOrderingOnSave(list.getId());
}
}

@ -29,6 +29,7 @@ import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.QueryTemplate;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.TagViewFragment;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.AstridFilterExposer;
@ -154,7 +155,10 @@ public class TagFilterExposer extends BroadcastReceiver implements AstridFilterE
}
private FilterCategory filterFromTags(Tag[] tags, int name) {
int length = addUntaggedFilter ? tags.length + 1 : tags.length;
boolean shouldAddUntagged = addUntaggedFilter &&
Preferences.getBoolean(R.string.p_show_not_in_list_filter, true);
int length = shouldAddUntagged ? tags.length + 1 : tags.length;
Filter[] filters = new Filter[length];
Context context = ContextManager.getContext();
@ -163,7 +167,7 @@ public class TagFilterExposer extends BroadcastReceiver implements AstridFilterE
int themeFlags = ThemeService.getFilterThemeFlags();
// --- untagged
if (addUntaggedFilter) {
if (shouldAddUntagged) {
int untaggedLabel = gtasksPreferenceService.isLoggedIn() ?
R.string.tag_FEx_untagged_w_astrid : R.string.tag_FEx_untagged;
Filter untagged = new Filter(r.getString(untaggedLabel),
@ -176,7 +180,7 @@ public class TagFilterExposer extends BroadcastReceiver implements AstridFilterE
}
for(int i = 0; i < tags.length; i++) {
int index = addUntaggedFilter ? i + 1 : i;
int index = shouldAddUntagged ? i + 1 : i;
filters[index] = constructFilter(context, tags[i]);
}
FilterCategory filter = new FilterCategory(context.getString(name), filters);

@ -9,7 +9,6 @@ import android.support.v4.view.MenuItem;
import android.text.TextUtils;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.MenuInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
@ -64,10 +63,8 @@ public class FeaturedTaskListFragment extends TagViewFragment {
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
if (!isCurrentTaskListFragment())
return;
protected void addMenuItems(Menu menu, Activity activity) {
super.addMenuItems(menu, activity);
MenuItem item = menu.add(Menu.NONE, MENU_CLONE_LIST, 0, R.string.actfm_feat_list_clone);
item.setIcon(R.drawable.ic_menu_list_copy);
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" android:drawable="@drawable/comment_blue_alt_pressed"/>
<item android:state_focused="true" android:drawable="@drawable/comment_blue_alt_pressed"/>
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/comment_blue_alt_normal"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" android:drawable="@drawable/comment_blue_alt_filled_pressed"/>
<item android:state_focused="true" android:drawable="@drawable/comment_blue_alt_filled_pressed"/>
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/comment_blue_alt_filled_normal"/>
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 512 B

@ -0,0 +1,27 @@
<?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">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/custom_tab_indicator_unselected_alt" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/custom_tab_indicator_selected_alt" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/custom_tab_indicator_unselected_focused_alt" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/custom_tab_indicator_selected_focused_alt" />
</selector>

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

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

Loading…
Cancel
Save