當前位置: 首頁>>代碼示例>>Java>>正文


Java SlideInItemAnimator類代碼示例

本文整理匯總了Java中io.plaidapp.ui.recyclerview.SlideInItemAnimator的典型用法代碼示例。如果您正苦於以下問題:Java SlideInItemAnimator類的具體用法?Java SlideInItemAnimator怎麽用?Java SlideInItemAnimator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SlideInItemAnimator類屬於io.plaidapp.ui.recyclerview包,在下文中一共展示了SlideInItemAnimator類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import io.plaidapp.ui.recyclerview.SlideInItemAnimator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search);
    ButterKnife.bind(this);
    setupSearchView();

    dataManager = new SearchDataManager(this) {
        @Override
        public void onDataLoaded(List<? extends PlaidItem> data) {
            if (data != null && data.size() > 0) {
                if (results.getVisibility() != View.VISIBLE) {
                    TransitionManager.beginDelayedTransition(container,
                            getTransition(R.transition.search_show_results));
                    progress.setVisibility(View.GONE);
                    results.setVisibility(View.VISIBLE);
                    fab.setVisibility(View.VISIBLE);
                }
                adapter.addAndResort(data);
            } else {
                TransitionManager.beginDelayedTransition(
                        container, getTransition(R.transition.auto));
                progress.setVisibility(View.GONE);
                setNoResultsVisibility(View.VISIBLE);
            }
        }
    };
    adapter = new FeedAdapter(this, dataManager, columns, PocketUtils.isPocketInstalled(this));
    setExitSharedElementCallback(FeedAdapter.createSharedElementReenterCallback(this));
    results.setAdapter(adapter);
    results.setItemAnimator(new SlideInItemAnimator());
    GridLayoutManager layoutManager = new GridLayoutManager(this, columns);
    layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            return adapter.getItemColumnSpan(position);
        }
    });
    results.setLayoutManager(layoutManager);
    results.addOnScrollListener(new InfiniteScrollListener(layoutManager, dataManager) {
        @Override
        public void onLoadMore() {
            dataManager.loadMore();
        }
    });
    results.setHasFixedSize(true);

    setupTransitions();
    onNewIntent(getIntent());
    ShortcutHelper.reportSearchUsed(this);
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:52,代碼來源:SearchActivity.java

示例2: onCreate

import io.plaidapp.ui.recyclerview.SlideInItemAnimator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search);
    ButterKnife.bind(this);
    setupSearchView();

    dataManager = new SearchDataManager(this) {
        @Override
        public void onDataLoaded(List<? extends PlaidItem> data) {
            if (data != null && data.size() > 0) {
                if (results.getVisibility() != View.VISIBLE) {
                    TransitionManager.beginDelayedTransition(container,
                            getTransition(R.transition.search_show_results));
                    progress.setVisibility(View.GONE);
                    results.setVisibility(View.VISIBLE);
                    fab.setVisibility(View.VISIBLE);
                }
                adapter.addAndResort(data);
            } else {
                TransitionManager.beginDelayedTransition(
                        container, getTransition(R.transition.auto));
                progress.setVisibility(View.GONE);
                setNoResultsVisibility(View.VISIBLE);
            }
        }
    };
    ViewPreloadSizeProvider<Shot> shotPreloadSizeProvider = new ViewPreloadSizeProvider<>();
    adapter = new FeedAdapter(this, dataManager, columns, PocketUtils.isPocketInstalled(this),
            shotPreloadSizeProvider);
    setExitSharedElementCallback(FeedAdapter.createSharedElementReenterCallback(this));
    results.setAdapter(adapter);
    results.setItemAnimator(new SlideInItemAnimator());
    GridLayoutManager layoutManager = new GridLayoutManager(this, columns);
    layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            return adapter.getItemColumnSpan(position);
        }
    });
    results.setLayoutManager(layoutManager);
    results.addOnScrollListener(new InfiniteScrollListener(layoutManager, dataManager) {
        @Override
        public void onLoadMore() {
            dataManager.loadMore();
        }
    });
    results.setHasFixedSize(true);
    RecyclerViewPreloader<Shot> shotPreloader =
            new RecyclerViewPreloader<>(this, adapter, shotPreloadSizeProvider, 4);
    results.addOnScrollListener(shotPreloader);

    setupTransitions();
    onNewIntent(getIntent());
    ShortcutHelper.reportSearchUsed(this);
}
 
開發者ID:nickbutcher,項目名稱:plaid,代碼行數:57,代碼來源:SearchActivity.java


注:本文中的io.plaidapp.ui.recyclerview.SlideInItemAnimator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。