Java 类android.view.animation.GridLayoutAnimationController 实例源码

项目:apps-for-android    文件:GridLayout.java   
@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;
}
项目:kora    文件:GridLayout.java   
@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;
}
项目:MyAnimeViewer    文件:GridRecyclerView.java   
@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);
        }
}
项目:RecyclerViewAnimation    文件:StaggeredGridRecyclerView.java   
/**
 * 支持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);
    }
}
项目:Schoolbook    文件:GridRecyclerView.java   
@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);
    }
}
项目:narrate-android    文件:GridRecyclerView.java   
@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);
    }
}
项目:materialup    文件:EndlessRecyclerView.java   
@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);
    }
}
项目:truth-android    文件:GridLayoutAnimationControllerSubject.java   
public static SubjectFactory<GridLayoutAnimationControllerSubject, GridLayoutAnimationController> type() {
  return new SubjectFactory<GridLayoutAnimationControllerSubject, GridLayoutAnimationController>() {
    @Override
    public GridLayoutAnimationControllerSubject getSubject(FailureStrategy fs, GridLayoutAnimationController that) {
      return new GridLayoutAnimationControllerSubject(fs, that);
    }
  };
}
项目:material-activity-chooser    文件:GridRecyclerView.java   
@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);
    }
}
项目:cv4j    文件:GridRecyclerView.java   
@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);
    }
}
项目:android-temperature-logger    文件:GridRecyclerView.java   
@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);
  }
}
项目:bridddle-for-dribbble    文件:GridRecyclerView.java   
@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);
    }
}
项目:droidddle    文件:BaseRecyclerView.java   
@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);
    }
}
项目:Superuser-UI    文件:RecyclerViewSwipeable.java   
@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);
    }
}
项目:recent-images    文件:TwoWayGridView.java   
@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;
    }
}
项目:MaterializeYourApp    文件:GridRecyclerView.java   
@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);
    }
}
项目:StockAdapterView    文件:GridView.java   
@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;
    }
}
项目:bhammer-android-old    文件:BRecyclerView.java   
@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);
        }
    }
}
项目:AnimatedGridView    文件:AnimationHelper.java   
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;
}
项目:truth-android    文件:GridLayoutAnimationControllerSubject.java   
protected GridLayoutAnimationControllerSubject(FailureStrategy failureStrategy, GridLayoutAnimationController subject) {
  super(failureStrategy, subject);
}
项目:itsnat_droid    文件:ClassDescGridLayoutAnimation.java   
@Override
public Class<GridLayoutAnimationController> getDeclaredClass()
{
    return GridLayoutAnimationController.class;
}
项目:itsnat_droid    文件:ClassDescGridLayoutAnimation.java   
@Override
protected GridLayoutAnimationController createResourceNative(Context ctx)
{
    return new GridLayoutAnimationController(ctx,null);
}
项目:itsnat_droid    文件:ClassDescGridLayoutAnimation.java   
@Override
public boolean isAttributeIgnored(GridLayoutAnimationController resource, String namespaceURI, String name)
{
    return false;
}
项目:assertj-android    文件:GridLayoutAnimationControllerAssert.java   
public GridLayoutAnimationControllerAssert(GridLayoutAnimationController actual) {
  super(actual, GridLayoutAnimationControllerAssert.class);
}