Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬,oppo手机第一次无法正常滑动 #135

Open
Cashdispenser opened this issue Oct 12, 2018 · 1 comment
Open

大佬,oppo手机第一次无法正常滑动 #135

Cashdispenser opened this issue Oct 12, 2018 · 1 comment

Comments

@Cashdispenser
Copy link

在已关闭的问题里面有,但是那个是2016年的了,现在这个问题怎么处理呢,用的是CommonNavigator,目前只发现oppo手机是这样的
CommonNavigator commonNavigator = new CommonNavigator(mActivity);
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
@OverRide
public int getCount() {
return null == custom ? 0 : custom.size();
}

        @Override
        public IPagerTitleView getTitleView(Context context, final int i) {
            SimplePagerTitleView simplePagerTitleView = new ScaleTransitionPagerTitleView(context);
            simplePagerTitleView.setText(custom.get(i).getName());
            simplePagerTitleView.setTextSize(20);
            simplePagerTitleView.setNormalColor(Color.parseColor("#999999"));
            simplePagerTitleView.setSelectedColor(Color.parseColor("#333333"));
            if (simplePagerTitleView.isSelected()) {
                simplePagerTitleView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
            } else {
                simplePagerTitleView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
            }
            simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    pos = i;
                    vp_home.setCurrentItem(i);
                    gridViewAdapter.setSelectPos(i);
                    gridViewAdapter.notifyDataSetChanged();
                    NormalUtils.baiduStatistics(mActivity, custom.get(i).getEventid(), "首页-" + custom.get(i).getName());

                }
            });
            return simplePagerTitleView;
        }

        @Override
        public IPagerIndicator getIndicator(Context context) {
            LinePagerIndicator indicator = new LinePagerIndicator(context);
            indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
            indicator.setLineHeight(UIUtil.dip2px(context, 0));
            indicator.setLineWidth(UIUtil.dip2px(context, 0));
            indicator.setStartInterpolator(new AccelerateInterpolator());
            indicator.setEndInterpolator(new DecelerateInterpolator(2.0f));
            indicator.setColors(Color.parseColor("#ff4849"));
            return indicator;
        }
    });
    magic_indicator.setNavigator(commonNavigator);
    ViewPagerHelper.bind(magic_indicator, vp_home);
@hackware1993
Copy link
Owner

你先确保 ViewPager 是不是能滑动,以及 ViewPager 的滑动回调是不是出错了,MI 是无状态的,滑不滑、滑多少完全依赖外面的回调。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants