Skip to content

Commit

Permalink
Disable scroll to top for now
Browse files Browse the repository at this point in the history
If you go to one page, then another, then back to that page, it crashes because it calls an old saved controller for some reason and not a new (recreated?) one. Need bluelinelabs/Conductor#166
  • Loading branch information
ZacSweers committed Nov 12, 2016
1 parent 6ecb9e9 commit 16cf748
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -10,9 +10,9 @@
import android.support.design.widget.TabLayout;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.util.SparseArrayCompat;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -98,7 +98,7 @@ public class PagerController extends BaseController {

// Ew, but the only way to get the controller later
// https://github.com/bluelinelabs/Conductor/issues/166
private SparseArray<Controller> controllers = new SparseArray<>();
private SparseArrayCompat<Controller> controllers = new SparseArrayCompat<>();

public PagerController() {
pagerAdapter = new ControllerPagerAdapter(this, true) {
Expand Down Expand Up @@ -268,7 +268,7 @@ public void onTabUnselected(TabLayout.Tab tab) {
public void onTabReselected(TabLayout.Tab tab) {
Controller controller = controllers.get(tab.getPosition());
if (controller instanceof Scrollable) {
((Scrollable) controller).onRequestScrollToTop();
// ((Scrollable) controller).onRequestScrollToTop();
appBarLayout.setExpanded(true, true);
}
}
Expand Down

0 comments on commit 16cf748

Please sign in to comment.