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


Java ScaleInAnimationAdapter.setFirstOnly方法代码示例

本文整理汇总了Java中jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter.setFirstOnly方法的典型用法代码示例。如果您正苦于以下问题:Java ScaleInAnimationAdapter.setFirstOnly方法的具体用法?Java ScaleInAnimationAdapter.setFirstOnly怎么用?Java ScaleInAnimationAdapter.setFirstOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter的用法示例。


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

示例1: initRecyclerView

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
@Override
void initRecyclerView() {
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    mAdapter = new VideoViewAdapter(this, R.layout.adapter_video_item, new ArrayList<Data>());
    ((VideoViewAdapter) mAdapter).setTitle(mToolbar.getTitle().toString());
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    ScaleInAnimationAdapter animationAdapter = new ScaleInAnimationAdapter(mAdapter);
    animationAdapter.setFirstOnly(false);
    recyclerView.setAdapter(animationAdapter);
    recyclerView.setRecyclerListener(new RecyclerView.RecyclerListener() {
        @Override
        public void onViewRecycled(RecyclerView.ViewHolder holder) {
            if (((VideoViewAdapter.ViewHolder) holder).player != null) {
                ((VideoViewAdapter.ViewHolder) holder).player.resetPlayerData();
                ((VideoViewAdapter.ViewHolder) holder).player.release();
            }
        }
    });
}
 
开发者ID:wuyr,项目名称:LuZhiShen,代码行数:20,代码来源:VideoViewActivity.java

示例2: setUpRecyclerView

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
private void setUpRecyclerView(){
    staggeredGridLayoutManager = new StaggeredGridLayoutManager(1,
            StaggeredGridLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(staggeredGridLayoutManager);
    recyclerView.setHasFixedSize(true);

    SpacesItemDecoration decoration = new SpacesItemDecoration(16);
    recyclerView.addItemDecoration(decoration);

    animeAdapter = new AnimeAdapter(this, animes);

    AlphaInAnimationAdapter alphaAdapter = new AlphaInAnimationAdapter(animeAdapter);
    ScaleInAnimationAdapter scaleAdapter = new ScaleInAnimationAdapter(alphaAdapter);
    scaleAdapter.setFirstOnly(false);
    scaleAdapter.setInterpolator(new OvershootInterpolator(2f));

    recyclerView.setAdapter(scaleAdapter);
}
 
开发者ID:Androideity,项目名称:AndroidStudioTutorials,代码行数:19,代码来源:MainActivity.java

示例3: initRecyclerAdapter

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
public void initRecyclerAdapter() {
    mRecyclerAdapter = new DemandQueueRecyclerAdapter(getContext());
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    ScaleInAnimationAdapter scaleInAnimationAdapter = new ScaleInAnimationAdapter(mRecyclerAdapter);
    scaleInAnimationAdapter.setFirstOnly(true);
    mRecyclerAdapter.getOnBookClick()
            .subscribe(new Action1<DemandQueueRecyclerAdapter.DemandQueueRecyclerHolder>() {
                @Override
                public void call(DemandQueueRecyclerAdapter.DemandQueueRecyclerHolder demandQueueRecyclerHolder) {
                    startBookActivity(demandQueueRecyclerHolder);
                }
            });
    mRecyclerAdapter.getOnTransferClick()
            .subscribe(new Action1<Integer>() {
                @Override
                public void call(Integer position) {
                    mDemandQueuePresenter.onTransferBook(position);
                }
            });
    mRecyclerView.addOnScrollListener(onScrollListener);
    mRecyclerView.setAdapter(scaleInAnimationAdapter);
}
 
开发者ID:hypeapps,项目名称:wykopolka-android,代码行数:23,代码来源:DemandQueueFragment.java

示例4: initRecyclerAdapter

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
public void initRecyclerAdapter() {
    mRecyclerAdapter = new WishListRecyclerAdapter(getContext());
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    ScaleInAnimationAdapter scaleInAnimationAdapter = new ScaleInAnimationAdapter(mRecyclerAdapter);
    scaleInAnimationAdapter.setFirstOnly(true);
    mRecyclerAdapter.getOnBookClick()
            .subscribe(new Action1<WishListRecyclerAdapter.WishListRecyclerHolder>() {
                @Override
                public void call(WishListRecyclerAdapter.WishListRecyclerHolder wishListRecyclerHolder) {
                    startBookActivity(wishListRecyclerHolder);
                }
            });
    mRecyclerAdapter.getOnConfirmClick()
            .subscribe(new Action1<Integer>() {
                @Override
                public void call(Integer position) {
                    mWishListPresenter.onConfirmBook(position);
                }
            });
    mRecyclerView.addOnScrollListener(onScrollListener);
    mRecyclerView.setAdapter(scaleInAnimationAdapter);
}
 
开发者ID:hypeapps,项目名称:wykopolka-android,代码行数:23,代码来源:WishListFragment.java

示例5: setWeatherData

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
public void setWeatherData(WeatherBean weatherData, HuangLiBean huangLiData, ConstellationBean constellationData) {
    mWeatherData = weatherData;
    mBasicRvAdapter = new BasicRvAdapter(getContext(), mWeatherData, huangLiData, constellationData);
    ScaleInAnimationAdapter scaleAdapter = new ScaleInAnimationAdapter(mBasicRvAdapter);
    scaleAdapter.setFirstOnly(false);
    mBasicRecyclerView.setAdapter(scaleAdapter);
}
 
开发者ID:Codpoe,项目名称:OnlyWeather,代码行数:8,代码来源:BasicFragment.java

示例6: setWeatherData

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
public void setWeatherData(WeatherBean weatherData) {
    mWeatherData = weatherData;
    mForecastRvAdapter = new ForecastRvAdapter(getContext(), mWeatherData);
    ScaleInAnimationAdapter scaleAdapter= new ScaleInAnimationAdapter(mForecastRvAdapter);
    scaleAdapter.setFirstOnly(false);
    mMoreRecyclerView.setAdapter(scaleAdapter);
}
 
开发者ID:Codpoe,项目名称:OnlyWeather,代码行数:8,代码来源:ForecastFragment.java

示例7: initRecyclerView

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
void initRecyclerView() {
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    mAdapter = new PicturesViewAdapter(this, R.layout.activity_pictures_item, new ArrayList<Data>());
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    ScaleInAnimationAdapter animationAdapter = new ScaleInAnimationAdapter(mAdapter);
    animationAdapter.setFirstOnly(false);
    recyclerView.setAdapter(animationAdapter);
}
 
开发者ID:wuyr,项目名称:LuZhiShen,代码行数:9,代码来源:PicturesViewActivity.java

示例8: initRecyclerAdapter

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
public void initRecyclerAdapter() {
    mRecyclerAdapter = new BooksRecyclerAdapter(getContext());
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    ScaleInAnimationAdapter scaleInAnimationAdapter = new ScaleInAnimationAdapter(mRecyclerAdapter);
    scaleInAnimationAdapter.setFirstOnly(true);
    mRecyclerAdapter.getOnBookClicks()
            .subscribe(new Action1<BooksRecyclerAdapter.BooksRecyclerHolder>() {
                @Override
                public void call(BooksRecyclerAdapter.BooksRecyclerHolder booksRecyclerHolder) {
                    startBookActivity(mBooks, booksRecyclerHolder);
                }
            });
    mRecyclerView.addOnScrollListener(onScrollListener);
    mRecyclerView.setAdapter(scaleInAnimationAdapter);
}
 
开发者ID:hypeapps,项目名称:wykopolka-android,代码行数:16,代码来源:BaseBookListFragment.java

示例9: initRecyclerAdapter

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
private void initRecyclerAdapter(SearchBookRecyclerAdapter recyclerAdapter, RecyclerView recyclerView) {
    LinearLayoutManager layoutManager
            = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
    recyclerView.setLayoutManager(layoutManager);
    ScaleInAnimationAdapter scaleInAnimationAdapter = new ScaleInAnimationAdapter(recyclerAdapter);
    scaleInAnimationAdapter.setFirstOnly(true);
    recyclerAdapter.getOnBookClicks().subscribe(new Action1<Pair<SearchBookRecyclerAdapter.SearchBookRecyclerHolder, Book>>() {
        @Override
        public void call(Pair<SearchBookRecyclerAdapter.SearchBookRecyclerHolder, Book> searchBookRecyclerHolderBookPair) {
            startBookActivity(searchBookRecyclerHolderBookPair);
        }
    });
    recyclerView.setAdapter(scaleInAnimationAdapter);
}
 
开发者ID:hypeapps,项目名称:wykopolka-android,代码行数:15,代码来源:SearchBookActivity.java

示例10: initRecyclerView

import jp.wasabeef.recyclerview.adapters.ScaleInAnimationAdapter; //导入方法依赖的package包/类
private void initRecyclerView() {
    mRecyclerView = (RecyclerView) mRootView.findViewById(R.id.recycler_view);
    ScaleInAnimationAdapter animationAdapter = new ScaleInAnimationAdapter(mAdapter);
    animationAdapter.setFirstOnly(false);
    mRecyclerView.setAdapter(animationAdapter);
    mRecyclerView.setLayoutManager(getLayoutManager());
   /* mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {

        //用来标记是否正在向最后一个滑动,既是否向下滑动
        boolean isSlidingToLast;

        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            if (recyclerView.getLayoutManager() instanceof StaggeredGridLayoutManager
                    && newState == RecyclerView.SCROLL_STATE_IDLE) {
                // 当不滚动时
                //获取最后一个完全显示的ItemPosition
                StaggeredGridLayoutManager manager = (StaggeredGridLayoutManager) recyclerView.getLayoutManager();
                int[] lastVisiblePositions = manager.findLastVisibleItemPositions(new int[manager.getSpanCount()]);
                int lastVisiblePos = getMaxElem(lastVisiblePositions);
                int totalItemCount = manager.getItemCount();

                // 判断是否滚动到底部
                if (!mRefreshLayout.isRefreshing() && isSlidingToLast && !isLoadBarHiding && !isJumping &&
                        lastVisiblePos == totalItemCount) {
                    showJumpBar();
                    mAdapter.loadNext();
                }
            }
        }

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            isSlidingToLast = isScrollDown(dy);
            if (recyclerView.getLayoutManager() instanceof LinearLayoutManager)
                if (!mRefreshLayout.isRefreshing() && isSlidingToLast && !isLoadBarHiding && !isJumping &&
                        (((LinearLayoutManager) recyclerView.getLayoutManager())
                                .findLastVisibleItemPosition() == mAdapter.getDataSize() - 1 ||
                                ((LinearLayoutManager) recyclerView.getLayoutManager())
                                        .findLastVisibleItemPosition() == mAdapter.getDataSize() - 2)) {
                    showJumpBar();
                    mAdapter.loadNext();
                }
        }
    });
}

private int getMaxElem(int[] arr) {
    int maxVal = Integer.MIN_VALUE;
    for (int anArr : arr)
        if (anArr > maxVal)
            maxVal = anArr;
    return maxVal;
}

protected boolean isScrollDown(int y) {
    return y > 0;
}*/
}
 
开发者ID:wuyr,项目名称:LuZhiShen,代码行数:60,代码来源:BaseListFragment.java


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