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


Java SimpleItemAnimator.setSupportsChangeAnimations方法代碼示例

本文整理匯總了Java中android.support.v7.widget.SimpleItemAnimator.setSupportsChangeAnimations方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleItemAnimator.setSupportsChangeAnimations方法的具體用法?Java SimpleItemAnimator.setSupportsChangeAnimations怎麽用?Java SimpleItemAnimator.setSupportsChangeAnimations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.widget.SimpleItemAnimator的用法示例。


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

示例1: setAdapter

import android.support.v7.widget.SimpleItemAnimator; //導入方法依賴的package包/類
/**
 * Sets adapter for MessagesList
 *
 * @param adapter       Adapter. Must extend MessagesListAdapter
 * @param reverseLayout weather to use reverse layout for layout manager.
 * @param <MESSAGE>     Message model class
 */
public <MESSAGE extends IMessage>
void setAdapter(MessagesListAdapter<MESSAGE> adapter, boolean reverseLayout) {
    SimpleItemAnimator itemAnimator = new DefaultItemAnimator();
    itemAnimator.setSupportsChangeAnimations(false);

    LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(),
            LinearLayoutManager.VERTICAL, reverseLayout);

    setItemAnimator(itemAnimator);
    setLayoutManager(layoutManager);
    adapter.setLayoutManager(layoutManager);
    adapter.setStyle(messagesListStyle);

    addOnScrollListener(new RecyclerScrollMoreListener(layoutManager, adapter));
    super.setAdapter(adapter);
}
 
開發者ID:sciage,項目名稱:FinalProject,代碼行數:24,代碼來源:MessagesList.java

示例2: setAdapter

import android.support.v7.widget.SimpleItemAnimator; //導入方法依賴的package包/類
/**
 * Set adapter for MessageList.
 *
 * @param adapter   Adapter, extends MsgListAdapter.
 * @param <MESSAGE> Message model extends IMessage.
 */
public <MESSAGE extends IMessage> void setAdapter(MsgListAdapter<MESSAGE> adapter) {
    mAdapter = adapter;
    SimpleItemAnimator itemAnimator = new DefaultItemAnimator();
    itemAnimator.setSupportsChangeAnimations(false);
    setItemAnimator(itemAnimator);

    LinearLayoutManager layoutManager = new LinearLayoutManager(
            getContext(), LinearLayoutManager.VERTICAL, true);
    layoutManager.setStackFromEnd(true);
    setLayoutManager(layoutManager);
    
    adapter.setLayoutManager(layoutManager);
    adapter.setStyle(mContext, mMsgListStyle);
    mScrollMoreListener = new ScrollMoreListener(layoutManager, adapter);
    addOnScrollListener(mScrollMoreListener);
    super.setAdapter(adapter);
}
 
開發者ID:jpush,項目名稱:aurora-imui,代碼行數:24,代碼來源:MessageList.java

示例3: setAdapter

import android.support.v7.widget.SimpleItemAnimator; //導入方法依賴的package包/類
/**
 * Set adapter for DialogsList
 *
 * @param adapter  Adapter. Must extend DialogsListAdapter
 * @param <DIALOG> Dialog model class
 */
public <DIALOG extends IDialog> void setAdapter(DialogsListAdapter<DIALOG> adapter) {
    SimpleItemAnimator itemAnimator = new DefaultItemAnimator();
    itemAnimator.setSupportsChangeAnimations(false);

    LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(),
            LinearLayoutManager.VERTICAL, true);

    setItemAnimator(itemAnimator);
    setLayoutManager(layoutManager);

    adapter.setStyle(dialogStyle);

    super.setAdapter(adapter);
}
 
開發者ID:sciage,項目名稱:FinalProject,代碼行數:21,代碼來源:DialogsList.java

示例4: onCreateView

import android.support.v7.widget.SimpleItemAnimator; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_manage_devices, container, false);

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler);
    HeaderAdapter myHeader = new HeaderAdapter(R.layout.device_header, R.string.my_devices);
    HeaderAdapter availableHeader = new HeaderAdapter(R.layout.device_header,
            R.string.available_devices);
    if (savedInstanceState != null) {
        mMyDevices.onRestoreInstanceState(savedInstanceState.getBundle(KEY_MY_DEVICES));
        mAvailableDevices.onRestoreInstanceState(
                savedInstanceState.getBundle(KEY_AVAILABLE_DEVICES));
    }
    CompositeRecyclerAdapter adapter = new CompositeRecyclerAdapter(myHeader, mMyDevices,
            availableHeader, mAvailableDevices);
    adapter.setHasStableIds(true);
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(
            new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
    // Don't animate on change: https://code.google.com/p/android/issues/detail?id=204277.
    SimpleItemAnimator animator = new DefaultItemAnimator();
    animator.setSupportsChangeAnimations(false);
    recyclerView.setItemAnimator(animator);
    return view;
}
 
開發者ID:google,項目名稱:science-journal,代碼行數:29,代碼來源:ManageDevicesRecyclerFragment.java

示例5: onCreateView

import android.support.v7.widget.SimpleItemAnimator; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view;
    final LayoutManager layoutManager;
    if (mShowInNavigationDrawer) {
        view = inflater.inflate(R.layout.tab_drawer, container, false);
        layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
        setupFrameLayoutButton(view, R.id.tab_header_button, R.id.plusIcon);
        setupFrameLayoutButton(view, R.id.new_tab_button, R.id.icon_plus);
        setupFrameLayoutButton(view, R.id.action_back, R.id.icon_back);
        setupFrameLayoutButton(view, R.id.action_forward, R.id.icon_forward);
        setupFrameLayoutButton(view, R.id.action_home, R.id.icon_home);
    } else {
        view = inflater.inflate(R.layout.tab_strip, container, false);
        layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false);
        ImageView newTab = view.findViewById(R.id.new_tab_button);
        newTab.setColorFilter(ThemeUtils.getIconDarkThemeColor(getActivity()));
        newTab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mUiController.newTabButtonClicked();
            }
        });
    }

    mUnbinder = ButterKnife.bind(this, view);

    SimpleItemAnimator animator;
    if (mShowInNavigationDrawer) {
        animator = new VerticalItemAnimator();
    } else {
        animator = new HorizontalItemAnimator();
    }
    animator.setSupportsChangeAnimations(false);
    animator.setAddDuration(200);
    animator.setChangeDuration(0);
    animator.setRemoveDuration(200);
    animator.setMoveDuration(200);
    mRecyclerView.setLayerType(View.LAYER_TYPE_NONE, null);
    mRecyclerView.setItemAnimator(animator);
    mRecyclerView.setLayoutManager(layoutManager);
    mTabsAdapter = new LightningViewAdapter(mShowInNavigationDrawer);
    mRecyclerView.setAdapter(mTabsAdapter);
    mRecyclerView.setHasFixedSize(true);

    return view;
}
 
開發者ID:JTechMe,項目名稱:JumpGo,代碼行數:49,代碼來源:TabsFragment.java


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