コード例 #1
0
 public void backSecondMenuWithAnimation() {
   int scrollOffset =
       mThirdHorizontalLayout.getLastScrollX() - mThirdHorizontalLayout.getScrollX();
   mThirdHorizontalLayout.startCollapseAnim(
       mThirdHorizontalLayout.getLastExpandPosition() - scrollOffset);
   mSecondHorizontalLayout.show(true);
 }
コード例 #2
0
 public void quitMenu() {
   backTopAndCenterWithAnimation();
   hideBottomSecondMenuWithAnimation();
   mThirdHorizontalLayout.setVisibility(View.GONE);
   mEffectBackView.setVisibility(View.GONE);
   mBackMainView.setVisibility(View.VISIBLE);
   mSecondHorizontalLayout.setVisibility(View.VISIBLE);
 }
コード例 #3
0
  @Override
  public void addSecondHSLChildViews(
      List childList, float showCount, View.OnClickListener onClickListener) {
    PGEditBaseHoriScrollItemAdapter baseHoriScrollItemAdapter =
        new PGEditHSLHoriScrollItemAdapter();
    baseHoriScrollItemAdapter.setContext(mActivity);
    baseHoriScrollItemAdapter.setData(childList);
    mSecondHorizontalLayout.setItemCountOnScreen(showCount);
    baseHoriScrollItemAdapter.setOnItemViewClickListener(onClickListener);

    mSecondHorizontalLayout.setAdapter(baseHoriScrollItemAdapter);
  }
コード例 #4
0
  @Override
  public void showFirstImageViewPhoto(
      List mPGEditMenusBeanList, float showCount, View.OnClickListener onClickListener) {

    mActivity.findViewById(R.id.step_layout).setVisibility(View.VISIBLE);
    mActivity.findViewById(R.id.first_top).setVisibility(View.VISIBLE);

    PGEditBaseHoriScrollItemAdapter baseHoriScrollItemAdapter =
        new PGEditBaseHoriScrollItemAdapter();
    baseHoriScrollItemAdapter.setContext(mActivity);
    baseHoriScrollItemAdapter.setData(mPGEditMenusBeanList);
    mFirstHorizontalLayout.setItemCountOnScreen(showCount);
    baseHoriScrollItemAdapter.setOnItemViewClickListener(onClickListener);

    mFirstHorizontalLayout.setAdapter(baseHoriScrollItemAdapter);
  }
コード例 #5
0
  public void hideBottomSecondMenuWithAnimation() {
    if (Build.VERSION.SDK_INT >= 11) {
      float secondBottomHeight =
          mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_height);
      TranslateAnimation translateAnimation =
          new TranslateAnimation(0f, 0f, 0f, secondBottomHeight);
      translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
      translateAnimation.setDuration(ANIMATION_TIME);
      translateAnimation.setAnimationListener(
          new AnimationAdapter() {
            @Override
            public void onAnimationEnd(Animation animation) {
              mActivity.runOnUiThread(
                  new Runnable() {
                    @Override
                    public void run() {
                      if (null != mMenuListener) {
                        mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
                      }
                    }
                  });
            }
          });
      mSecondMenusLayout.startAnimation(translateAnimation);

      mFirstHorizontalLayout.setVisibility(View.VISIBLE);
      float bottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_bottom_height);
      TranslateAnimation firstTranslateAnimation = new TranslateAnimation(0f, 0f, bottomHeight, 0f);
      firstTranslateAnimation.setDuration(ANIMATION_TIME);
      firstTranslateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
      AlphaAnimation firstAlphaAnimation = new AlphaAnimation(0f, 1f);
      firstAlphaAnimation.setDuration(ANIMATION_TIME);
      firstAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());

      AnimationSet animationSet = new AnimationSet(true);
      animationSet.addAnimation(firstTranslateAnimation);
      animationSet.addAnimation(firstAlphaAnimation);
      mFirstHorizontalLayout.startAnimation(animationSet);

    } else {
      if (null != mMenuListener) {
        mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
      }

      mFirstHorizontalLayout.setVisibility(View.VISIBLE);
    }
  }
コード例 #6
0
  @Override
  public void addSecondFrameChildViews(
      List effectList,
      float v,
      View.OnClickListener mThirdClickListener,
      String pg_sdk_edit_effect_check,
      int color) {
    PGEditEffectHoriScrollItemAdapter baseHoriScrollItemAdapter =
        new PGEditEffectHoriScrollItemAdapter(mSecondHorizontalLayout, -1);
    baseHoriScrollItemAdapter.setContext(mActivity);
    baseHoriScrollItemAdapter.setMaskResource(pg_sdk_edit_effect_check);
    baseHoriScrollItemAdapter.hideFirstPosition();
    mSecondHorizontalLayout.setItemCountOnScreen(v);
    baseHoriScrollItemAdapter.setData(effectList);
    baseHoriScrollItemAdapter.setOnItemViewClickListener(mThirdClickListener);

    mSecondHorizontalLayout.setAdapter(baseHoriScrollItemAdapter);
  }
コード例 #7
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);
  }
コード例 #8
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);
              }
            });
  }