1

I have a ViewSwitcher that displays views. When the ViewSwitcher starts the initial view does not scroll.

    final ViewSwitcher vs = (ViewSwitcher)getView().findViewById(R.id.view_switcherz);

    mEventResource = new AlternateEventResource();

    mViewFactory = new AlternateDayViewFactory(vs, mEventResource, getActivity());

    vs.setFactory(mViewFactory);


    final DayView dv = (DayView) vs.getCurrentView();
    Time t = new Time();
    t.set(setTime.getTimeInMillis());
    dv.setSelected(t, false, false);
    dv.clearCachedEvents();

    dv.reloadEvents()

I have an application that uses a ViewSwitcher.

When initialising the ViewSwitcher, the view that is first displayed when scrolled causes a motion event that calls the onFling() method.

However the onFling() animation is not performed.

When the ViewSwitcher view is swiped to the second view the onFling() event starts functioning normally.

What could cause an onFling() to be called but simply ignored?

I have traced the code with a debugger and the onFling() is called but doesn't actually deliver any animation but only on the initial view.

Thanks. Source that I use can be pulled here to view problem!

git clone https://code.google.com/p/yadview/
Vivek Pradhan
  • 4,777
  • 3
  • 26
  • 46
  • If you forked that project from google code than recreate your steps and see where it started to fail. – user Feb 21 '15 at 13:33
  • I have done this, and the fling is called on the initial view when scrolled, but it doesn't actually do anything! Need to determine why the fling doesn't work..... the pulled git repo code doesn't work... so it is a problem with the initial codebase and nothing I have added.... –  Feb 21 '15 at 13:35
  • show your fling code. – Murtaza Khursheed Hussain Feb 24 '15 at 08:24
  • Had a similar problem before. It involved the assets being loaded into `ImageView` being too large (512 x 512) which was more than 1mb when rendered into a `Bitmap` – Math is Hard Feb 28 '15 at 03:06

0 Answers0