本文整理汇总了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);
}
示例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);
}