From 0de393e4c3c30422c8d6703f99af542d9105a470 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 2 Dec 2011 16:12:47 -0800 Subject: [PATCH] Updated some more transition animations --- .../astrid/actfm/TagSettingsActivity.java | 23 ++++++++++++++++++- .../astrid/actfm/TagUpdatesActivity.java | 9 ++++++++ .../todoroo/astrid/actfm/TagViewActivity.java | 7 ++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java index 29ca91f80..543603bed 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java @@ -193,8 +193,11 @@ public class TagSettingsActivity extends Activity { Intent intent = new Intent(this, TagViewActivity.class); intent.putExtra(TagViewActivity.EXTRA_TAG_NAME, newName); intent.putExtra(TagViewActivity.TOKEN_FILTER, TagFilterExposer.filterFromTagData(this, tagData)); - finish(); + super.finish(); startActivity(intent); + AndroidUtilities.callApiMethod(5, this, "overridePendingTransition", //$NON-NLS-1$ + new Class[] { Integer.TYPE, Integer.TYPE }, + R.anim.slide_left_in, R.anim.slide_left_out); return; } @@ -202,6 +205,24 @@ public class TagSettingsActivity extends Activity { finish(); } + @Override + public void finish() { + finishWithAnimation(true); + } + + private void finishWithAnimation(boolean backAnimation) { + super.finish(); + if (backAnimation) { + AndroidUtilities.callApiMethod(5, this, "overridePendingTransition", //$NON-NLS-1$ + new Class[] { Integer.TYPE, Integer.TYPE }, + R.anim.slide_right_in, R.anim.slide_right_out); + } else { + AndroidUtilities.callApiMethod(5, this, "overridePendingTransition", //$NON-NLS-1$ + new Class[] { Integer.TYPE, Integer.TYPE }, + R.anim.slide_left_in, R.anim.slide_left_out); + } + } + @SuppressWarnings("nls") private void refreshSettingsPage() { tagName.setText(tagData.getValue(TagData.NAME)); diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java index 7deb356d7..738c40f41 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesActivity.java @@ -26,6 +26,7 @@ import com.timsu.astrid.R; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; +import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.astrid.actfm.ActFmCameraModule.CameraResultCallback; @@ -176,6 +177,14 @@ public class TagUpdatesActivity extends ListActivity { return true; } + @Override + public void finish() { + super.finish(); + AndroidUtilities.callApiMethod(5, this, "overridePendingTransition", //$NON-NLS-1$ + new Class[] { Integer.TYPE, Integer.TYPE }, + R.anim.slide_right_in, R.anim.slide_right_out); + } + @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { // handle my own menus diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java index f7a5e8ea3..79d9dd0cc 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java @@ -37,6 +37,7 @@ import com.todoroo.andlib.service.NotificationManager; import com.todoroo.andlib.service.NotificationManager.AndroidNotificationManager; import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.Query; +import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.Preferences; @@ -128,6 +129,9 @@ public class TagViewActivity extends TaskListActivity { Intent intent = new Intent(TagViewActivity.this, TagUpdatesActivity.class); intent.putExtra(EXTRA_TAG_DATA, tagData); startActivity(intent); + AndroidUtilities.callApiMethod(5, TagViewActivity.this, "overridePendingTransition", //$NON-NLS-1$ + new Class[] { Integer.TYPE, Integer.TYPE }, + R.anim.slide_left_in, R.anim.slide_left_out); } }); } @@ -142,6 +146,9 @@ public class TagViewActivity extends TaskListActivity { Intent intent = new Intent(TagViewActivity.this, TagSettingsActivity.class); intent.putExtra(EXTRA_TAG_DATA, tagData); startActivityForResult(intent, REQUEST_CODE_SETTINGS); + AndroidUtilities.callApiMethod(5, TagViewActivity.this, "overridePendingTransition", //$NON-NLS-1$ + new Class[] { Integer.TYPE, Integer.TYPE }, + R.anim.slide_left_in, R.anim.slide_left_out); } };