コード例 #1
0
  @Override
  public void addSecondLightingChildViews(
      List effectList,
      float v,
      View.OnClickListener onClickListener,
      View.OnClickListener mOnScrollClickListener,
      String pg_sdk_edit_effect_scroll) {
    PGEditEffectHoriScrollItemAdapter baseHoriScrollItemAdapter =
        new PGEditEffectHoriScrollItemAdapter(mSecondHorizontalLayout, -1);
    baseHoriScrollItemAdapter.setOnItemViewClickListener(onClickListener);
    baseHoriScrollItemAdapter.setOnScrollClickListener(mOnScrollClickListener);
    baseHoriScrollItemAdapter.setContext(mActivity);
    baseHoriScrollItemAdapter.setMaskResource(pg_sdk_edit_effect_scroll);
    baseHoriScrollItemAdapter.hideFirstPosition();
    mSecondHorizontalLayout.setItemCountOnScreen(v);
    baseHoriScrollItemAdapter.setData(effectList);

    mSecondHorizontalLayout.setAdapter(baseHoriScrollItemAdapter);
  }
コード例 #2
0
  @Override
  public void addThirdEffectChildViews(
      List list,
      float showCount,
      View.OnClickListener onThirdClickListener,
      View.OnClickListener onScrollClickListener,
      String maskIcon,
      View view,
      View lastSelectedView) {

    PGEditEffectHoriScrollItemAdapter baseHoriScrollItemAdapter =
        new PGEditEffectHoriScrollItemAdapter(mThirdHorizontalLayout, -1);
    baseHoriScrollItemAdapter.setOnItemViewClickListener(onThirdClickListener);
    baseHoriScrollItemAdapter.setOnScrollClickListener(onScrollClickListener);
    baseHoriScrollItemAdapter.setMaskResource(maskIcon);
    baseHoriScrollItemAdapter.setData(list);
    baseHoriScrollItemAdapter.setContext(mActivity);
    baseHoriScrollItemAdapter.setLastSelectedView(lastSelectedView);

    mThirdHorizontalLayout.setItemCountOnScreen(showCount);
    mThirdHorizontalLayout.setAdapter(baseHoriScrollItemAdapter);
    mThirdHorizontalLayout.setVisibility(View.VISIBLE);

    mSecondHorizontalLayout.hide(true);

    final int position = mSecondHorizontalLayout.getLinearContainer().indexOfChild(view);
    final int itemWidth = getEffectTypeItem(view).getWidth();
    mThirdHorizontalLayout
        .getViewTreeObserver()
        .addOnGlobalLayoutListener(
            new ViewTreeObserver.OnGlobalLayoutListener() {
              @Override
              public void onGlobalLayout() {
                int scroll =
                    mSecondHorizontalLayout.getScrollX() - mThirdHorizontalLayout.getScrollX();
                mThirdHorizontalLayout.startExpandAnim(position * itemWidth - scroll);
                mThirdHorizontalLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
              }
            });
  }
コード例 #3
0
  @Override
  public void addSecondEffectChildViews(
      List list,
      float showCount,
      View.OnClickListener onThirdClickListener,
      View.OnClickListener onScrollClickListener,
      String maskIcon,
      View lastSelectedView) {

    PGEditEffectHoriScrollItemAdapter baseHoriScrollItemAdapter =
        new PGEditEffectHoriScrollItemAdapter(mSecondHorizontalLayout, -1);
    baseHoriScrollItemAdapter.setOnItemViewClickListener(onThirdClickListener);
    baseHoriScrollItemAdapter.setOnScrollClickListener(onScrollClickListener);
    baseHoriScrollItemAdapter.hideFirstPosition();
    baseHoriScrollItemAdapter.setMaskResource(maskIcon);
    baseHoriScrollItemAdapter.setData(list);
    baseHoriScrollItemAdapter.setContext(mActivity);
    baseHoriScrollItemAdapter.setLastSelectedView(lastSelectedView);

    mSecondHorizontalLayout.setItemCountOnScreen(showCount);
    mSecondHorizontalLayout.setAdapter(baseHoriScrollItemAdapter);
  }