本文整理匯總了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);
}