Bug 1100904 - Don't block panel loading in HomeLoader.load() (r=margaret)

This commit is contained in:
Lucas Rocha 2014-11-24 15:13:23 +00:00
Родитель 4f9175bbc2
Коммит a03fe1006d
3 изменённых файлов: 15 добавлений и 24 удалений

Просмотреть файл

@ -7,6 +7,7 @@ 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;
@ -24,6 +25,7 @@ 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;
@ -1971,6 +1973,8 @@ 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();

Просмотреть файл

@ -262,12 +262,6 @@ 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);

Просмотреть файл

@ -223,7 +223,7 @@ public class HomePager extends ViewPager {
final HomeAdapter adapter = new HomeAdapter(mContext, fm);
adapter.setOnAddPanelListener(mAddPanelListener);
adapter.setCanLoadHint(!shouldAnimate);
adapter.setCanLoadHint(true);
setAdapter(adapter);
// Don't show the tabs strip until we have the
@ -243,7 +243,6 @@ public class HomePager extends ViewPager {
@Override
public void onPropertyAnimationEnd() {
setLayerType(View.LAYER_TYPE_NONE, null);
adapter.setCanLoadHint(true);
}
});
@ -373,9 +372,7 @@ public class HomePager extends ViewPager {
final HomeAdapter adapter = (HomeAdapter) getAdapter();
// Disable any fragment loading until we have the initial
// panel selection done. Store previous value to restore
// it if necessary once the UI is fully updated.
final boolean canLoadHint = adapter.getCanLoadHint();
// panel selection done.
adapter.setCanLoadHint(false);
// Destroy any existing panels currently loaded
@ -436,19 +433,15 @@ public class HomePager extends ViewPager {
}
}
// 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);
}
});
}
// 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) {