use of acr.browser.lightning.fragment.anim.VerticalItemAnimator in project Lightning-Browser by anthonycr.
the class TabsFragment method onCreateView.
@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 = (ImageView) 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;
}
Aggregations