Bug 1151089 - Move slide up animations to onResume. r=liuche a=sylvestre
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 03 Apr 2015 15:45:49 -0700
changeset 258361 358448358c21
parent 258360 4db575e80883
child 258362 5b70a93a7f10
push id4651
push usermichael.l.comella@gmail.com
push date2015-04-08 16:33 +0000
treeherdermozilla-beta@358448358c21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sylvestre
bugs1151089
milestone38.0
Bug 1151089 - Move slide up animations to onResume. r=liuche a=sylvestre This should mean we do the slide up animation every time, not just when the Activity is created.
mobile/android/base/overlays/ui/ShareDialog.java
--- 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);