зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1100904 - Don't block panel loading in HomeLoader.load() (r=margaret)
This commit is contained in:
Родитель
4f9175bbc2
Коммит
a03fe1006d
|
@ -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,9 +433,6 @@ 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.
|
||||
|
@ -449,7 +443,6 @@ public class HomePager extends ViewPager {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnPanelChangeListener(OnPanelChangeListener listener) {
|
||||
mPanelChangedListener = listener;
|
||||
|
|
Загрузка…
Ссылка в новой задаче