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