Bug 1151089 - Move slide up animations to onResume. r=liuche
This should mean we do the slide up animation every time, not just when the
Activity is created.
--- a/mobile/android/base/overlays/ui/ShareDialog.java
+++ b/mobile/android/base/overlays/ui/ShareDialog.java
@@ -165,17 +165,16 @@ public class ShareDialog extends Locales
toast.show();
finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getWindow().setWindowAnimations(0);
setContentView(R.layout.overlay_share_dialog);
LocalBroadcastManager.getInstance(this).registerReceiver(uiEventListener,
new IntentFilter(OverlayConstants.SHARE_METHOD_UI_EVENT));
// Send tab.
sendTabList = (SendTabList) findViewById(R.id.overlay_send_tab_btn);
@@ -249,16 +248,21 @@ public class ShareDialog extends Locales
}
// Have the service start any initialisation work that's necessary for us to show the correct
// UI. The results of such work will come in via the BroadcastListener.
Intent serviceStartupIntent = new Intent(this, OverlayActionService.class);
serviceStartupIntent.setAction(OverlayConstants.ACTION_PREPARE_SHARE);
startService(serviceStartupIntent);
+ // Start the slide-up animation.
+ getWindow().setWindowAnimations(0);
+ final Animation anim = AnimationUtils.loadAnimation(this, R.anim.overlay_slide_up);
+ findViewById(R.id.sharedialog).startAnimation(anim);
+
// If provided, we use the subject text to give us something nice to display.
// If not, we wing it with the URL.
// TODO: Consider polling Fennec databases to find better information to display.
final String subjectText = intent.getStringExtra(Intent.EXTRA_SUBJECT);
final String telemetryExtras = "title=" + (subjectText != null);
if (subjectText != null) {
@@ -301,20 +305,16 @@ public class ShareDialog extends Locales
}
};
titleView.setOnClickListener(launchBrowser);
subtitleView.setOnClickListener(launchBrowser);
final LocalBrowserDB browserDB = new LocalBrowserDB(getCurrentProfile());
setButtonState(url, browserDB);
-
- // Start the slide-up animation.
- final Animation anim = AnimationUtils.loadAnimation(this, R.anim.overlay_slide_up);
- findViewById(R.id.sharedialog).startAnimation(anim);
}
@Override
protected void onNewIntent(final Intent intent) {
super.onNewIntent(intent);
// The intent returned by getIntent is not updated automatically.
setIntent(intent);