java类android.view.animation.GridLayoutAnimationController的实例源码

GridLayout.java 文件源码 项目:apps-for-android 阅读 31 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child,
        ViewGroup.LayoutParams params, int index, int count) {

    GridLayoutAnimationController.AnimationParameters animationParams =
            (GridLayoutAnimationController.AnimationParameters)
                    params.layoutAnimationParameters;

    if (animationParams == null) {
        animationParams = new GridLayoutAnimationController.AnimationParameters();
        params.layoutAnimationParameters = animationParams;
    }

    animationParams.count = count;
    animationParams.index = index;
    animationParams.columnsCount = mNumColumns;
    animationParams.rowsCount = mNumRows;

    animationParams.column = index % mNumColumns;
    animationParams.row = index / mNumColumns;
}
GridLayout.java 文件源码 项目:kora 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child,
        ViewGroup.LayoutParams params, int index, int count)
{

    GridLayoutAnimationController.AnimationParameters animationParams =
            (GridLayoutAnimationController.AnimationParameters)
                    params.layoutAnimationParameters;

    if (animationParams == null) {
        animationParams = new GridLayoutAnimationController.AnimationParameters();
        params.layoutAnimationParameters = animationParams;
    }

    animationParams.count = count;
    animationParams.index = index;
    animationParams.columnsCount = mNumColumns;
    animationParams.rowsCount = mNumRows;

    animationParams.column = index % mNumColumns;
    animationParams.row = index / mNumColumns;
}
GridRecyclerView.java 文件源码 项目:MyAnimeViewer 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {
    if (!isInEditMode())
        if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager) {

            GridLayoutAnimationController.AnimationParameters animationParams =
                    (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

            if (animationParams == null) {
                animationParams = new GridLayoutAnimationController.AnimationParameters();
                params.layoutAnimationParameters = animationParams;
            }

            int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

            animationParams.count = count;
            animationParams.index = index;
            animationParams.columnsCount = columns;
            animationParams.rowsCount = count / columns;

            final int invertedIndex = count - 1 - index;
            animationParams.column = columns - 1 - (invertedIndex % columns);
            animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

        } else {
            super.attachLayoutAnimationParameters(child, params, index, count);
        }
}
StaggeredGridRecyclerView.java 文件源码 项目:RecyclerViewAnimation 阅读 33 收藏 0 点赞 0 评论 0
/**
 * 支持GridLayoutManager以及StaggeredGridLayoutManager
 *
 * @param child
 * @param params
 * @param index
 * @param count
 */
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params,
                                               int index, int count) {
    LayoutManager layoutManager = this.getLayoutManager();
    if (getAdapter() != null && (layoutManager instanceof GridLayoutManager
            || layoutManager instanceof StaggeredGridLayoutManager)) {

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = 0;
        if (layoutManager instanceof GridLayoutManager) {
            columns = ((GridLayoutManager) layoutManager).getSpanCount();
        } else {
            columns = ((StaggeredGridLayoutManager) layoutManager).getSpanCount();
        }

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
GridRecyclerView.java 文件源码 项目:Schoolbook 阅读 29 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager){

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
GridRecyclerView.java 文件源码 项目:narrate-android 阅读 26 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager){

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
EndlessRecyclerView.java 文件源码 项目:materialup 阅读 25 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && false) {
        LayoutManager manager = getLayoutManager();

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = 1;
        if (manager instanceof GridLayoutManager) {
            columns = ((GridLayoutManager) manager).getSpanCount();
        }

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
GridLayoutAnimationControllerSubject.java 文件源码 项目:truth-android 阅读 29 收藏 0 点赞 0 评论 0
public static SubjectFactory<GridLayoutAnimationControllerSubject, GridLayoutAnimationController> type() {
  return new SubjectFactory<GridLayoutAnimationControllerSubject, GridLayoutAnimationController>() {
    @Override
    public GridLayoutAnimationControllerSubject getSubject(FailureStrategy fs, GridLayoutAnimationController that) {
      return new GridLayoutAnimationControllerSubject(fs, that);
    }
  };
}
GridRecyclerView.java 文件源码 项目:material-activity-chooser 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, @NonNull ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager) {

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();


        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns + 1;

        animationParams.column = index % columns;
        animationParams.row = index % columns + index / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
GridRecyclerView.java 文件源码 项目:cv4j 阅读 25 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, @NonNull ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager) {

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
GridRecyclerView.java 文件源码 项目:android-temperature-logger 阅读 30 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

  if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager){

    GridLayoutAnimationController.AnimationParameters animationParams =
        (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

    if (animationParams == null) {
      animationParams = new GridLayoutAnimationController.AnimationParameters();
      params.layoutAnimationParameters = animationParams;
    }

    int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

    animationParams.count = count;
    animationParams.index = index;
    animationParams.columnsCount = columns;
    animationParams.rowsCount = count / columns;

    final int invertedIndex = count - 1 - index;
    animationParams.column = columns - 1 - (invertedIndex % columns);
    animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

  } else {
    super.attachLayoutAnimationParameters(child, params, index, count);
  }
}
GridRecyclerView.java 文件源码 项目:bridddle-for-dribbble 阅读 31 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager){

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
BaseRecyclerView.java 文件源码 项目:droidddle 阅读 30 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && false) {
        LayoutManager manager = getLayoutManager();

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = 1;
        if (manager instanceof GridLayoutManager) {
            columns = ((GridLayoutManager) manager).getSpanCount();
        }

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
RecyclerViewSwipeable.java 文件源码 项目:Superuser-UI 阅读 21 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager){

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
TwoWayGridView.java 文件源码 项目:recent-images 阅读 23 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child,
        ViewGroup.LayoutParams params, int index, int count) {

    GridLayoutAnimationController.AnimationParameters animationParams =
        (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

    if (animationParams == null) {
        animationParams = new GridLayoutAnimationController.AnimationParameters();
        params.layoutAnimationParameters = animationParams;
    }

    animationParams.count = count;
    animationParams.index = index;
    animationParams.columnsCount = mNumColumns;
    animationParams.rowsCount = count / mNumColumns;

    if (!mStackFromBottom) {
        animationParams.column = index % mNumColumns;
        animationParams.row = index / mNumColumns;
    } else {
        final int invertedIndex = count - 1 - index;

        animationParams.column = mNumColumns - 1 - (invertedIndex % mNumColumns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / mNumColumns;
    }
}
GridRecyclerView.java 文件源码 项目:MaterializeYourApp 阅读 29 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, @NonNull ViewGroup.LayoutParams params, int index, int count) {

    if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager) {

        GridLayoutAnimationController.AnimationParameters animationParams =
                (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

        if (animationParams == null) {
            animationParams = new GridLayoutAnimationController.AnimationParameters();
            params.layoutAnimationParameters = animationParams;
        }

        int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

        animationParams.count = count;
        animationParams.index = index;
        animationParams.columnsCount = columns;
        animationParams.rowsCount = count / columns;

        final int invertedIndex = count - 1 - index;
        animationParams.column = columns - 1 - (invertedIndex % columns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;

    } else {
        super.attachLayoutAnimationParameters(child, params, index, count);
    }
}
GridView.java 文件源码 项目:StockAdapterView 阅读 38 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child,
                                               ViewGroup.LayoutParams params, int index, int count) {

    GridLayoutAnimationController.AnimationParameters animationParams =
            (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

    if (animationParams == null) {
        animationParams = new GridLayoutAnimationController.AnimationParameters();
        params.layoutAnimationParameters = animationParams;
    }

    animationParams.count = count;
    animationParams.index = index;
    animationParams.columnsCount = mNumColumns;
    animationParams.rowsCount = count / mNumColumns;

    if (!mStackFromBottom) {
        animationParams.column = index % mNumColumns;
        animationParams.row = index / mNumColumns;
    } else {
        final int invertedIndex = count - 1 - index;

        animationParams.column = mNumColumns - 1 - (invertedIndex % mNumColumns);
        animationParams.row = animationParams.rowsCount - 1 - invertedIndex / mNumColumns;
    }
}
BRecyclerView.java 文件源码 项目:bhammer-android-old 阅读 26 收藏 0 点赞 0 评论 0
@Override
protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {

    if (mWithAnim) {
        if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager) {

            GridLayoutAnimationController.AnimationParameters animationParams =
                    (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;

            if (animationParams == null) {
                animationParams = new GridLayoutAnimationController.AnimationParameters();
                params.layoutAnimationParameters = animationParams;
            }

            int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();

            animationParams.count = count;
            animationParams.index = index;
            animationParams.columnsCount = columns;
            animationParams.rowsCount = count / columns;

            final int invertedIndex = count - 1 - index;
            animationParams.column = columns - 1 - (invertedIndex % columns);
            animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;


        } else {
            super.attachLayoutAnimationParameters(child, params, index, count);
        }
    }
}
AnimationHelper.java 文件源码 项目:AnimatedGridView 阅读 29 收藏 0 点赞 0 评论 0
public static GridLayoutAnimationController getLayoutAnimation() {
    AnimationSet set = new AnimationSet(true);
    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(40);
    set.addAnimation(animation);
    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
            0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, -1.0f,
            Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(75);
    set.addAnimation(animation);
    GridLayoutAnimationController controller = new GridLayoutAnimationController(set);
    return controller;
}
GridLayoutAnimationControllerSubject.java 文件源码 项目:truth-android 阅读 29 收藏 0 点赞 0 评论 0
protected GridLayoutAnimationControllerSubject(FailureStrategy failureStrategy, GridLayoutAnimationController subject) {
  super(failureStrategy, subject);
}
ClassDescGridLayoutAnimation.java 文件源码 项目:itsnat_droid 阅读 25 收藏 0 点赞 0 评论 0
@Override
public Class<GridLayoutAnimationController> getDeclaredClass()
{
    return GridLayoutAnimationController.class;
}
ClassDescGridLayoutAnimation.java 文件源码 项目:itsnat_droid 阅读 30 收藏 0 点赞 0 评论 0
@Override
protected GridLayoutAnimationController createResourceNative(Context ctx)
{
    return new GridLayoutAnimationController(ctx,null);
}
ClassDescGridLayoutAnimation.java 文件源码 项目:itsnat_droid 阅读 25 收藏 0 点赞 0 评论 0
@Override
public boolean isAttributeIgnored(GridLayoutAnimationController resource, String namespaceURI, String name)
{
    return false;
}
GridLayoutAnimationControllerAssert.java 文件源码 项目:assertj-android 阅读 23 收藏 0 点赞 0 评论 0
public GridLayoutAnimationControllerAssert(GridLayoutAnimationController actual) {
  super(actual, GridLayoutAnimationControllerAssert.class);
}


问题


面经


文章

微信
公众号

扫码关注公众号