Backed out changeset 4c73bc9c874e (bug 1100904)

This commit is contained in:
Carsten "Tomcat" Book 2014-11-24 16:43:18 +01:00
parent 473a1c4700
commit be575b70a0
3 changed files with 24 additions and 15 deletions

View File

@ -7,7 +7,6 @@ package org.mozilla.gecko;
import java.io.File;
import java.io.FileNotFoundException;
import java.lang.Override;
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.util.EnumSet;
@ -25,7 +24,6 @@ import org.mozilla.gecko.DynamicToolbar.VisibilityTransition;
import org.mozilla.gecko.GeckoProfileDirectories.NoMozillaDirectoryException;
import org.mozilla.gecko.Tabs.TabEvents;
import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.animation.TransitionsTracker;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserContract.SearchHistory;
@ -1973,8 +1971,6 @@ public class BrowserApp extends GeckoApp
final PropertyAnimator animator = new PropertyAnimator(250);
animator.setUseHardwareLayer(false);
TransitionsTracker.track(animator);
mBrowserToolbar.startEditing(url, animator);
final String panelId = selectedTab.getMostRecentHomePanel();

View File

@ -262,6 +262,12 @@ public class DynamicPanel extends HomeFragment {
public void requestDataset(DatasetRequest request) {
Log.d(LOGTAG, "Requesting request: " + request);
// Ignore dataset requests while the fragment is not
// allowed to load its content.
if (!getCanLoadHint()) {
return;
}
final Bundle bundle = new Bundle();
bundle.putParcelable(DATASET_REQUEST, request);

View File

@ -223,7 +223,7 @@ public class HomePager extends ViewPager {
final HomeAdapter adapter = new HomeAdapter(mContext, fm);
adapter.setOnAddPanelListener(mAddPanelListener);
adapter.setCanLoadHint(true);
adapter.setCanLoadHint(!shouldAnimate);
setAdapter(adapter);
// Don't show the tabs strip until we have the
@ -243,6 +243,7 @@ public class HomePager extends ViewPager {
@Override
public void onPropertyAnimationEnd() {
setLayerType(View.LAYER_TYPE_NONE, null);
adapter.setCanLoadHint(true);
}
});
@ -372,7 +373,9 @@ public class HomePager extends ViewPager {
final HomeAdapter adapter = (HomeAdapter) getAdapter();
// Disable any fragment loading until we have the initial
// panel selection done.
// panel selection done. Store previous value to restore
// it if necessary once the UI is fully updated.
final boolean canLoadHint = adapter.getCanLoadHint();
adapter.setCanLoadHint(false);
// Destroy any existing panels currently loaded
@ -433,15 +436,19 @@ public class HomePager extends ViewPager {
}
}
// The selection is updated asynchronously so we need to post to
// UI thread to give the pager time to commit the new page selection
// internally and load the right initial panel.
ThreadUtils.getUiHandler().post(new Runnable() {
@Override
public void run() {
adapter.setCanLoadHint(true);
}
});
// If the load hint was originally true, this means the pager
// is not animating and it's fine to restore the load hint back.
if (canLoadHint) {
// The selection is updated asynchronously so we need to post to
// UI thread to give the pager time to commit the new page selection
// internally and load the right initial panel.
ThreadUtils.getUiHandler().post(new Runnable() {
@Override
public void run() {
adapter.setCanLoadHint(true);
}
});
}
}
public void setOnPanelChangeListener(OnPanelChangeListener listener) {