diff --git a/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java b/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java
index 879e59a..14f70b1 100644
--- a/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java
+++ b/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java
@@ -13,6 +13,8 @@ import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
+import acr.browser.lightning.R;
+
/**
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
* to be used with AppCompat.
@@ -26,6 +28,7 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ overridePendingTransition(R.anim.slide_in_from_right, R.anim.fade_out_scale);
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
@@ -89,6 +92,14 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
getDelegate().onConfigurationChanged(newConfig);
}
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if (isFinishing()) {
+ overridePendingTransition(R.anim.fade_in_scale, R.anim.slide_out_to_right);
+ }
+ }
+
@Override
protected void onStop() {
super.onStop();
diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
index 3a5482b..d8f9cca 100644
--- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
+++ b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
@@ -782,6 +782,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
return true;
case R.id.action_incognito:
startActivity(new Intent(this, IncognitoActivity.class));
+ overridePendingTransition(R.anim.slide_up_in, R.anim.fade_out_scale);
return true;
case R.id.action_share:
if (mCurrentView != null && !mCurrentView.getUrl().startsWith(Constants.FILE)) {
@@ -1444,6 +1445,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
+ if (isIncognito() && isFinishing()) {
+ overridePendingTransition(R.anim.fade_in_scale, R.anim.slide_down_out);
+ }
}
void saveOpenTabs() {
diff --git a/app/src/main/res/anim/fade_in_scale.xml b/app/src/main/res/anim/fade_in_scale.xml
new file mode 100644
index 0000000..8c19011
--- /dev/null
+++ b/app/src/main/res/anim/fade_in_scale.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/fade_out_scale.xml b/app/src/main/res/anim/fade_out_scale.xml
new file mode 100644
index 0000000..053f009
--- /dev/null
+++ b/app/src/main/res/anim/fade_out_scale.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_down_out.xml b/app/src/main/res/anim/slide_down_out.xml
new file mode 100644
index 0000000..9594c77
--- /dev/null
+++ b/app/src/main/res/anim/slide_down_out.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_in_from_right.xml b/app/src/main/res/anim/slide_in_from_right.xml
new file mode 100644
index 0000000..ea83032
--- /dev/null
+++ b/app/src/main/res/anim/slide_in_from_right.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_out_to_right.xml b/app/src/main/res/anim/slide_out_to_right.xml
new file mode 100644
index 0000000..9368fd6
--- /dev/null
+++ b/app/src/main/res/anim/slide_out_to_right.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/anim/slide_up_in.xml b/app/src/main/res/anim/slide_up_in.xml
new file mode 100644
index 0000000..625f6df
--- /dev/null
+++ b/app/src/main/res/anim/slide_up_in.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file