use of android.support.v7.widget.SimpleItemAnimator in project actor-platform by actorapp.
the class GlobalSearchBaseFragment method showSearch.
private void showSearch() {
if (isSearchVisible) {
return;
}
isSearchVisible = true;
searchDisplay = messenger().buildSearchDisplayList();
searchDisplay.setBindHook(new BindedDisplayList.BindHook<SearchEntity>() {
@Override
public void onScrolledToEnd() {
scrolledToEnd = true;
checkGlobalSearch();
}
@Override
public void onItemTouched(SearchEntity item) {
}
});
searchAdapter = new SearchAdapter(getActivity(), searchDisplay, new OnItemClickedListener<SearchEntity>() {
@Override
public void onClicked(SearchEntity item) {
onPeerPicked(item.getPeer());
searchMenu.collapseActionView();
}
@Override
public boolean onLongClicked(SearchEntity item) {
return false;
}
});
HeaderViewRecyclerAdapter recyclerAdapter = new HeaderViewRecyclerAdapter(searchAdapter);
View header = new View(getActivity());
header.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Screen.dp(0)));
header.setBackgroundColor(ActorSDK.sharedActor().style.getMainBackgroundColor());
recyclerAdapter.addHeaderView(header);
searchList.setAdapter(recyclerAdapter);
RecyclerView.ItemAnimator animator = searchList.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
searchDisplay.addListener(searchListener);
showView(searchHintView, false);
goneView(searchEmptyView, false);
showView(searchContainer, false);
Fragment parent = getParentFragment();
if (parent != null && parent instanceof GlobalSearchStateDelegate) {
((GlobalSearchStateDelegate) parent).onGlobalSearchStarted();
}
}
use of android.support.v7.widget.SimpleItemAnimator in project AntennaPod by AntennaPod.
the class AllEpisodesFragment method onCreateViewHelper.
protected View onCreateViewHelper(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, int fragmentResource) {
super.onCreateView(inflater, container, savedInstanceState);
View root = inflater.inflate(fragmentResource, container, false);
recyclerView = (RecyclerView) root.findViewById(android.R.id.list);
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build());
progLoading = (ProgressBar) root.findViewById(R.id.progLoading);
if (!itemsLoaded) {
progLoading.setVisibility(View.VISIBLE);
}
viewsCreated = true;
if (itemsLoaded) {
onFragmentLoaded();
}
return root;
}
use of android.support.v7.widget.SimpleItemAnimator in project apps-android-wikipedia by wikimedia.
the class LocalCompilationsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = inflater.inflate(R.layout.fragment_local_compilations, container, false);
unbinder = ButterKnife.bind(this, view);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new DrawableItemDecoration(getContext(), R.attr.list_separator_drawable));
((SimpleItemAnimator) recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
errorView.setBackClickListener(v -> getActivity().finish());
emptyDescription.setMovementMethod(LinkMovementMethod.getInstance());
emptyDescription.setText(StringUtil.fromHtml(getString(R.string.offline_library_empty_description_sideload)));
RichTextUtil.removeUnderlinesFromLinks(emptyDescription);
packsHint.setMovementMethod(LinkMovementMethod.getInstance());
packsHint.setText(StringUtil.fromHtml(getString(R.string.offline_library_packs_hint)));
RichTextUtil.removeUnderlinesFromLinks(packsHint);
dataUsageHint.setMovementMethod(new LinkMovementMethodExt((url, titleString) -> {
if (url.equals(UriUtil.LOCAL_URL_SETTINGS)) {
startActivity(SettingsActivity.newIntent(getContext()));
}
}));
dataUsageHint.setText(StringUtil.fromHtml(getString(R.string.offline_library_data_usage_hint)));
RichTextUtil.removeUnderlinesFromLinks(dataUsageHint);
funnel = new OfflineLibraryFunnel(WikipediaApp.getInstance(), 0);
return view;
}
use of android.support.v7.widget.SimpleItemAnimator in project apps-android-wikipedia by wikimedia.
the class RemoteCompilationsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = inflater.inflate(R.layout.fragment_remote_compilations, container, false);
unbinder = ButterKnife.bind(this, view);
toolbarLayout.setExpandedTitleColor(Color.WHITE);
toolbarLayout.setCollapsedTitleTextColor(Color.WHITE);
getAppCompatActivity().setSupportActionBar(toolbar);
getAppCompatActivity().getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getAppCompatActivity().getSupportActionBar().setTitle("");
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new DrawableItemDecoration(getContext(), R.attr.list_separator_drawable));
((SimpleItemAnimator) recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
errorView.setRetryClickListener((v) -> beginUpdate());
errorView.setBackClickListener((v) -> getActivity().finish());
beginUpdate();
return view;
}
use of android.support.v7.widget.SimpleItemAnimator in project EhViewer by seven332.
the class DownloadsScene method onCreateView3.
@Nullable
@Override
public View onCreateView3(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.scene_download, container, false);
View content = ViewUtils.$$(view, R.id.content);
mRecyclerView = (EasyRecyclerView) ViewUtils.$$(content, R.id.recycler_view);
FastScroller fastScroller = (FastScroller) ViewUtils.$$(content, R.id.fast_scroller);
mFabLayout = (FabLayout) ViewUtils.$$(view, R.id.fab_layout);
TextView tip = (TextView) ViewUtils.$$(view, R.id.tip);
mViewTransition = new ViewTransition(content, tip);
Context context = getContext2();
Assert.assertNotNull(content);
Resources resources = context.getResources();
Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_download);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
tip.setCompoundDrawables(null, drawable, null, null);
mAdapter = new DownloadAdapter();
mAdapter.setHasStableIds(true);
mRecyclerView.setAdapter(mAdapter);
mLayoutManager = new AutoStaggeredGridLayoutManager(0, StaggeredGridLayoutManager.VERTICAL);
mLayoutManager.setColumnSize(resources.getDimensionPixelOffset(Settings.getDetailSizeResId()));
mLayoutManager.setStrategy(AutoStaggeredGridLayoutManager.STRATEGY_MIN_SIZE);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setSelector(Ripple.generateRippleDrawable(context, false));
mRecyclerView.setDrawSelectorOnTop(true);
mRecyclerView.hasFixedSize();
mRecyclerView.setClipToPadding(false);
mRecyclerView.setOnItemClickListener(this);
mRecyclerView.setOnItemLongClickListener(this);
mRecyclerView.setChoiceMode(EasyRecyclerView.CHOICE_MODE_MULTIPLE_CUSTOM);
mRecyclerView.setCustomCheckedListener(new DownloadChoiceListener());
// Cancel change animation
RecyclerView.ItemAnimator itemAnimator = mRecyclerView.getItemAnimator();
if (itemAnimator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) itemAnimator).setSupportsChangeAnimations(false);
}
int interval = resources.getDimensionPixelOffset(R.dimen.gallery_list_interval);
int paddingH = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_h);
int paddingV = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_v);
MarginItemDecoration decoration = new MarginItemDecoration(interval, paddingH, paddingV, paddingH, paddingV);
mRecyclerView.addItemDecoration(decoration);
decoration.applyPaddings(mRecyclerView);
if (mInitPosition >= 0) {
mRecyclerView.scrollToPosition(mInitPosition);
mInitPosition = -1;
}
fastScroller.attachToRecyclerView(mRecyclerView);
HandlerDrawable handlerDrawable = new HandlerDrawable();
handlerDrawable.setColor(ResourcesUtils.getAttrColor(context, R.attr.colorAccent));
fastScroller.setHandlerDrawable(handlerDrawable);
fastScroller.setOnDragHandlerListener(this);
mFabLayout.setExpanded(false, false);
mFabLayout.setHidePrimaryFab(true);
mFabLayout.setAutoCancel(false);
mFabLayout.setOnClickFabListener(this);
addAboveSnackView(mFabLayout);
updateView();
guide();
return view;
}
Aggregations