Commit d7286585 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add transition animation when changing servers

parent ea0eee80
...@@ -9,6 +9,7 @@ import com.hadisatrio.optional.Optional; ...@@ -9,6 +9,7 @@ import com.hadisatrio.optional.Optional;
import java.util.List; import java.util.List;
import chat.rocket.android.LaunchUtil; import chat.rocket.android.LaunchUtil;
import chat.rocket.android.R;
import chat.rocket.android.RocketChatCache; import chat.rocket.android.RocketChatCache;
import chat.rocket.android.helper.Logger; import chat.rocket.android.helper.Logger;
import chat.rocket.android.push.PushManager; import chat.rocket.android.push.PushManager;
...@@ -104,7 +105,10 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity { ...@@ -104,7 +105,10 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
} }
if (assertServerRealmStoreExists(newHostname)) { if (assertServerRealmStoreExists(newHostname)) {
recreate(); Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
overridePendingTransition(R.anim.slide_in, R.anim.slide_out);
} else { } else {
recoverFromHostnameError(); recoverFromHostnameError();
} }
......
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true"
android:interpolator="@android:anim/decelerate_interpolator">
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="100%p"
android:toYDelta="0">
</translate>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="0%p"
android:toYDelta="0">
</translate>
</set>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment