Example #1
0
  public void initialize(Callback<T> callback) {
    mCallback = callback;
    requestLayout();

    mViewPool = new ViewPool<DeckChildView<T>, T>(getContext(), this);
    mInflater = LayoutInflater.from(getContext());
    mLayoutAlgorithm = new DeckViewLayoutAlgorithm<T>(mConfig);
    mStackScroller = new DeckViewScroller(getContext(), mConfig, mLayoutAlgorithm);
    mStackScroller.setCallbacks(this);
    mTouchHandler = new DeckViewTouchHandler(getContext(), this, mConfig, mStackScroller);

    mUIDozeTrigger =
        new DozeTrigger(
            mConfig.taskBarDismissDozeDelaySeconds,
            new Runnable() {
              @Override
              public void run() {
                // Show the task bar dismiss buttons
                int childCount = getChildCount();
                for (int i = 0; i < childCount; i++) {
                  DeckChildView tv = (DeckChildView) getChildAt(i);
                  tv.startNoUserInteractionAnimation();
                }
              }
            });
  }