当前位置: 首页>>代码示例>>Java>>正文


Java ScaleInAnimator类代码示例

本文整理汇总了Java中jp.wasabeef.recyclerview.animators.ScaleInAnimator的典型用法代码示例。如果您正苦于以下问题:Java ScaleInAnimator类的具体用法?Java ScaleInAnimator怎么用?Java ScaleInAnimator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ScaleInAnimator类属于jp.wasabeef.recyclerview.animators包,在下文中一共展示了ScaleInAnimator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initViews

import jp.wasabeef.recyclerview.animators.ScaleInAnimator; //导入依赖的package包/类
@Override
void initViews() {
    final Activity parentActivity = getActivity();
    final int spanCount = parentActivity.getResources().getInteger(R.integer.span_count);
    GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), spanCount);
    gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {

            return parentActivity.getResources().getInteger(R.integer.span_size);

        }
    });
    recyclerView.setLayoutManager(gridLayoutManager);
    recyclerView.setHasFixedSize(false);
    ScaleInAnimator scaleInAnimator = new ScaleInAnimator();
    scaleInAnimator.setAddDuration(350);
    scaleInAnimator.setRemoveDuration(350);
    scaleInAnimator.setMoveDuration(350);
    scaleInAnimator.setChangeDuration(350);
    recyclerView.setItemAnimator(scaleInAnimator);
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
}
 
开发者ID:murielK,项目名称:AndroidWPTemplate,代码行数:26,代码来源:GalleryFragment.java

示例2: initViews

import jp.wasabeef.recyclerview.animators.ScaleInAnimator; //导入依赖的package包/类
@Override
void initViews() {
    final Activity parentActivity = getActivity();
    final int spanCount = parentActivity.getResources().getInteger(R.integer.span_count);
    GridLayoutManager gridLayoutManager = new GridLayoutManager(parentActivity, spanCount);
    gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            switch (position) {
                case 0:
                    return providePadding() == null ? 1 : spanCount;
                default:
                    return parentActivity.getResources().getInteger(R.integer.span_size);
            }
        }
    });
    recyclerView.setLayoutManager(gridLayoutManager);
    recyclerView.setHasFixedSize(false);
    ScaleInAnimator scaleInAnimator = new ScaleInAnimator();
    scaleInAnimator.setAddDuration(350);
    scaleInAnimator.setRemoveDuration(350);
    scaleInAnimator.setMoveDuration(350);
    scaleInAnimator.setChangeDuration(350);
    recyclerView.setItemAnimator(scaleInAnimator);
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        final Bundle arg = getArguments();
        if (arg != null && arg.containsKey(FeedsActivity.ARG_INITIAL_POSITION)) {
            final int initPosition = arg.getInt(FeedsActivity.ARG_INITIAL_POSITION, 0);
            ScrollUtils.addOnGlobalLayoutListener(recyclerView, new Runnable() {
                @Override
                public void run() {
                    recyclerView.scrollVerticallyToPosition(initPosition);
                }
            });
        }
        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
}
 
开发者ID:murielK,项目名称:AndroidWPTemplate,代码行数:39,代码来源:AbsFeedFragment.java

示例3: showTrackedCoins

import jp.wasabeef.recyclerview.animators.ScaleInAnimator; //导入依赖的package包/类
@Override
public void showTrackedCoins(PriceMultiFull priceMultiFull) {
    PriceMultiFull price = priceMultiFull;
    HashMap display = priceMultiFull.getDISPLAY();
    ArrayList<DisplayPrice> displayPrices = new ArrayList<>();
    ArrayList<RawPrice> rawPrices = new ArrayList<>();
    RecyclerView.ItemDecoration dividerItemDecoration =
            new RVDividerItemDecoration(ContextCompat.getDrawable(this,
                    R.drawable.bg_rv_separator));

    if (display.size() > 0) {
        displayPrices = priceMultiFull.getDisplayPrices();
        rawPrices = priceMultiFull.getRawPrices();

        myCoinsAdapter = new MyCoinsAdapter(this, displayPrices, rawPrices, this);
        layoutManager = new LinearLayoutManager(this);
        ScaleInAnimator animator = new ScaleInAnimator();
        animator.setChangeDuration(2000);
        rvMyCoins.setAdapter(myCoinsAdapter);
        rvMyCoins.setLayoutManager(layoutManager);
        rvMyCoins.setNestedScrollingEnabled(false);
        rvMyCoins.setItemAnimator(animator);

        if (!isRefreshUserCoins) {
            // add item decoration only once
            rvMyCoins.addItemDecoration(dividerItemDecoration);
        } else {
            isRefreshUserCoins = false;
        }

        if (isCoinAdded) {
            Alerter.create(this)
                    .setTitle("Your coin(s) have been added")
                    .setBackgroundColorRes(R.color.colorPositiveNotification)
                    .setIcon(R.drawable.ic_thumbs_up_o)
                    .setDuration(2000)
                    .show();
            isCoinAdded = false;
        }
    } else {
        // TODO show meaningful error
    }
}
 
开发者ID:mayuroks,项目名称:Coin-Tracker,代码行数:44,代码来源:HomeActivity.java


注:本文中的jp.wasabeef.recyclerview.animators.ScaleInAnimator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。