From 3b75765d926f1c7cc1bc1d03d2a6e60683d40110 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Mon, 7 Sep 2015 20:00:54 -0400 Subject: [PATCH] Add a transition when entering and exiting the Reading mode --- .../acr/browser/lightning/activity/ReadingActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java b/app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java index 7cb77aa..9eb05b2 100644 --- a/app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java @@ -51,6 +51,7 @@ public class ReadingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { + overridePendingTransition(R.anim.slide_in_from_right, R.anim.fade_out_scale); mPreferences = PreferenceManager.getInstance(); mInvert = mPreferences.getInvertColors(); final int color; @@ -228,6 +229,14 @@ public class ReadingActivity extends AppCompatActivity { super.onDestroy(); } + @Override + protected void onPause() { + super.onPause(); + if (isFinishing()) { + overridePendingTransition(R.anim.fade_in_scale, R.anim.slide_out_to_right); + } + } + @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) {