本文整理匯總了Java中android.support.v7.widget.RecyclerView.ItemAnimator方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.ItemAnimator方法的具體用法?Java RecyclerView.ItemAnimator怎麽用?Java RecyclerView.ItemAnimator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.ItemAnimator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: waitForAnimationsToEnd
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void waitForAnimationsToEnd(int timeoutInSeconds) throws InterruptedException {
RecyclerView.ItemAnimator itemAnimator = mRecyclerView.getItemAnimator();
if (itemAnimator == null) {
return;
}
final CountDownLatch latch = new CountDownLatch(1);
final boolean running = itemAnimator.isRunning(
new RecyclerView.ItemAnimator.ItemAnimatorFinishedListener() {
@Override
public void onAnimationsFinished() {
latch.countDown();
}
}
);
if (running) {
latch.await(timeoutInSeconds, TimeUnit.SECONDS);
}
}
示例2: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initView() {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext, R.color.color_Actionbar)));
}
mCoordinatorLayout = findViewById(R.id.coordinator);
RecyclerView recyclerView = findViewById(R.id.recycle_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof DefaultItemAnimator) {
((DefaultItemAnimator) animator).setSupportsChangeAnimations(false);
}
mAdapter = new CancelAdapter(this, new ArrayList<DayLesson>());
@SuppressWarnings("unchecked") SwingBottomInAnimationAdapter animatorAdapter = new SwingBottomInAnimationAdapter(mAdapter, recyclerView);
recyclerView.setAdapter(animatorAdapter);
ItemTouchHelper.Callback callback = new ItemTouchHelperCallBackNoMove(mAdapter);
ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
touchHelper.attachToRecyclerView(recyclerView);
mView_FABMenu = findViewById(R.id.fab_menu_1);
mView_FABMenu.setVisibility(View.GONE);
}
示例3: getMain
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@NonNull
@Override
protected RecyclerView getMain(Context context, AttributeSet parentAttrs) {
RecyclerView recyclerView = new RecyclerView(context);
recyclerView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
recyclerView.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false));
RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator();
itemAnimator.setChangeDuration(10);
recyclerView.setItemAnimator(itemAnimator);
return recyclerView;
}
示例4: getMain
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@NonNull
protected RecyclerView getMain(Context context, AttributeSet parentAttrs) {
RecyclerView recyclerView = new RecyclerView(context);
recyclerView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
recyclerView.setLayoutManager(new GridLayoutManager(context, mMainSpanCount));
RecyclerView.ItemAnimator itemAnimator = new ClassifyItemAnimator();
itemAnimator.setChangeDuration(CHANGE_DURATION);
recyclerView.setItemAnimator(itemAnimator);
return recyclerView;
}
示例5: getSub
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@NonNull
@Override
protected RecyclerView getSub(Context context, AttributeSet parentAttrs) {
RecyclerView recyclerView = new RecyclerView(context);
recyclerView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
recyclerView.setLayoutManager(new LinearLayoutManager(context));
RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator();
itemAnimator.setChangeDuration(10);
recyclerView.setItemAnimator(itemAnimator);
return recyclerView;
}
示例6: initUI
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
protected void initUI() {
swipeRefreshLayout.setOnRefreshListener(this);
swipeRefreshLayout.setColorSchemeResources(R.color.colorWhite);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(
ContextCompat.getColor(getActivity(), R.color.colorPrimary));
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator();
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(itemAnimator);
adapter = new SalariesAdapter(getActivity());
recyclerView.setAdapter(adapter);
updateData();
}
示例7: getSub
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@NonNull
@Override
protected RecyclerView getSub(Context context, AttributeSet parentAttrs) {
RecyclerView recyclerView = new RecyclerView(context);
recyclerView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
recyclerView.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false));
RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator();
itemAnimator.setChangeDuration(10);
recyclerView.setItemAnimator(itemAnimator);
return recyclerView;
}
示例8: refreshView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void refreshView() {
final RecyclerView.ItemAnimator a = listView.getItemAnimator();
listView.setItemAnimator(null);
notifyDataSetChanged();
listView.postDelayed(new Runnable() {
@Override
public void run() {
listView.setItemAnimator(a);
}
}, 500);
refreshLayout.setRefreshing(false);
}
示例9: setItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void setItemAnimator(RecyclerView.ItemAnimator animator) {
mRecycler.setItemAnimator(animator);
}
示例10: setARecyclerViewItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public ms_AlertDialog setARecyclerViewItemAnimator(RecyclerView.ItemAnimator animator)
{
obtainARecyclerView().setItemAnimator(animator);
return this;
}
示例11: setItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void setItemAnimator(RecyclerView.ItemAnimator animator) {
mRecyclerView.setItemAnimator(animator);
}
示例12: setItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void setItemAnimator(RecyclerView.ItemAnimator itemAnimator) {
if (itemAnimator != null) {
display.setItemAnimator(itemAnimator);
}
}
示例13: setItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
/**
* Sets the {@link RecyclerView.ItemAnimator} that will handle animations involving changes
* to the items in this RecyclerView. By default, RecyclerView instantiates and
* uses an instance of {@link android.support.v7.widget.DefaultItemAnimator}. Whether item animations are enabled for the RecyclerView depends on the ItemAnimator and whether
* the LayoutManager {@link android.support.v7.widget.RecyclerView.LayoutManager#supportsPredictiveItemAnimations()
* supports item animations}.
*
* @param animator The ItemAnimator being set. If null, no animations will occur
* when changes occur to the items in this RecyclerView.
*/
public void setItemAnimator(RecyclerView.ItemAnimator animator) {
mRecyclerView.setItemAnimator(animator);
}
示例14: setItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
/**
* Sets the {@link RecyclerView.ItemAnimator} that will handle animations involving changes
* to the items in wrapped RecyclerView. By default, RecyclerView instantiates and
* uses an instance of {@link DefaultItemAnimator}. Whether item animations are
* enabled for the RecyclerView depends on the ItemAnimator and whether
* the LayoutManager {@link RecyclerView.LayoutManager#supportsPredictiveItemAnimations()
* supports item animations}.
*
* @param animator The ItemAnimator being set. If null, no animations will occur
* when changes occur to the items in this RecyclerView.
*/
@SuppressWarnings("unused")
public final void setItemAnimator(RecyclerView.ItemAnimator animator) {
getRvCategories().setItemAnimator(animator);
}
示例15: setItemAnimator
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
void setItemAnimator(RecyclerView.ItemAnimator animator);