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


Java RecyclerView.ItemAnimator方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:VirtualLayoutManagerTest.java

示例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);
}
 
開發者ID:nhocga1995s,項目名稱:MyCalendar,代碼行數:26,代碼來源:CancelListActivity.java

示例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;
}
 
開發者ID:AlphaBoom,項目名稱:ClassifyView,代碼行數:12,代碼來源:LinearHVClassifyView.java

示例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;
}
 
開發者ID:AlphaBoom,項目名稱:ClassifyView,代碼行數:11,代碼來源:ClassifyView.java

示例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;
}
 
開發者ID:AlphaBoom,項目名稱:ClassifyView,代碼行數:12,代碼來源:LinearHVClassifyView.java

示例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();
}
 
開發者ID:graviton57,項目名稱:DOUSalaries,代碼行數:16,代碼來源:DemographicFragment.java

示例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;
}
 
開發者ID:AlphaBoom,項目名稱:ClassifyView,代碼行數:12,代碼來源:LinearHHClassifyView.java

示例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);

}
 
開發者ID:ccrama,項目名稱:Slide-RSS,代碼行數:14,代碼來源:FeedAdapter.java

示例9: setItemAnimator

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void setItemAnimator(RecyclerView.ItemAnimator animator) {
    mRecycler.setItemAnimator(animator);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:EasyRecyclerView.java

示例10: setARecyclerViewItemAnimator

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public ms_AlertDialog setARecyclerViewItemAnimator(RecyclerView.ItemAnimator animator)
{
	obtainARecyclerView().setItemAnimator(animator);
	return this;
}
 
開發者ID:MSay2,項目名稱:EasyUpdateApplication,代碼行數:6,代碼來源:ms_AlertDialog.java

示例11: setItemAnimator

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void setItemAnimator(RecyclerView.ItemAnimator animator) {
    mRecyclerView.setItemAnimator(animator);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:PullLoadMoreRecyclerView.java

示例12: setItemAnimator

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void setItemAnimator(RecyclerView.ItemAnimator itemAnimator) {
        if (itemAnimator != null) {
                display.setItemAnimator(itemAnimator);
        }
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:6,代碼來源:MultiFuncRecyclerView.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:14,代碼來源:UltimateRecyclerView.java

示例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);
}
 
開發者ID:sinhaDroid,項目名稱:BlogBookApp,代碼行數:16,代碼來源:HorizontalLoopBarView.java

示例15: setItemAnimator

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
void setItemAnimator(RecyclerView.ItemAnimator animator); 
開發者ID:Tenor-Inc,項目名稱:tenor-android-core,代碼行數:2,代碼來源:IRecyclerView.java


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