SlidingMenu icon indicating copy to clipboard operation
SlidingMenu copied to clipboard

I use ‘SlidingMenu + ActionBarSherlock + PullToRefreshListView + ViewPager‘;

Open wuyexiong opened this issue 13 years ago • 8 comments

I use ‘SlidingMenu + ActionBarSherlock + PullToRefreshView + ViewPager‘;

And this is my View;

view

I write the code lick this , and work well; https://github.com/jfeinstein10/SlidingMenu/blob/master/example/src/com/jeremyfeinstein/slidingmenu/example/ViewPagerActivity.java

  • When the ViewPager currentItem is 0
    I can press PullToRefreshView's center to scroll the SlidingMenu's LeftMenuView out ;

  • but, when I scroll the ViewPager to second item。
    ViewPager’s currentItem is 1; and The PageChangeListener will set getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN)
    then i can't press PullToRefreshView's center to scroll the SlidingMenu's LeftMenuView out;

  • if I don't set PageChangeListener…
    The ViewPager can scolle to right, but can't scoll to Left, SlidingMenu eat the event…

    I want

  • No matter what The Viewpager's currentItem is,
    I can press ListView to let the SlidingMenu's LeftMenuView out;

  • And the ViewPager still work like this
    [ https://github.com/jfeinstein10/SlidingMenu/blob/master/example/src/com/jeremyfeinstein/slidingmenu/example/ViewPagerActivity.java]([https://github.com/jfeinstein10/SlidingMenu/blob/master/example/src/com/jeremyfeinstein/slidingmenu/example/ViewPagerActivity.java]%28https://github.com/jfeinstein10/SlidingMenu/blob/master/example/src/com/jeremyfeinstein/slidingmenu/example/ViewPagerActivity.java%29)

    can you help me. Apologize for my bad English ;

wuyexiong avatar Jul 04 '13 18:07 wuyexiong

I have already fix it , But it can't pull down to refresh

 mViewPager.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                if(mViewPager.getCurrentItem() != 0)
                {
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                }
                return false;
            }
        });

wuyexiong avatar Jul 05 '13 07:07 wuyexiong

I like you with the layout being developed. I received a lot of help in your source. I fiexd that should not refresh the scroll view.

//source

    mPullToRefreshScrollView = (PullToRefreshScrollView)findViewById(R.id.customScrollView);
    mPullToRefreshScrollView.setOnRefreshListener(new OnRefreshListener<ScrollView>() {
        @Override
        public void onRefresh(PullToRefreshBase<ScrollView> refreshView) {
            new GetDataTask().execute();
        }
    });

    mScrollView = mPullToRefreshScrollView.getRefreshableView();

    mPager = (ViewPager)findViewById(R.id.pager);
    mPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager()));       
    mPager.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            mPullToRefreshScrollView.getParent().requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });

//source end

My answer to you, I hope power..

hm... I've sent an email to you, you have no answer..

Let's development while sharing other sources.

I do not speak English well.

If this is not the correct interpretation shall use the Google Translator.

saynull avatar Jul 08 '13 06:07 saynull

楼上二位可以直接写中文

tian9246 avatar Jul 11 '13 07:07 tian9246

哈哈~~由于订阅了SlidingMenu,每个回复都会收到邮件、看到中国人,真好

2013/7/11, tian9246 [email protected]:

楼上二位可以直接写中文


Reply to this email directly or view it on GitHub: https://github.com/jfeinstein10/SlidingMenu/issues/473#issuecomment-20794573

gavinliu avatar Jul 11 '13 09:07 gavinliu

非常感谢,问题已经解决。

wuyexiong avatar Jul 11 '13 16:07 wuyexiong

雄哥啊,微博上还认识你呢,哈哈~~~

shawnlinboy avatar Jul 17 '13 03:07 shawnlinboy

i find a better method,refer to https://github.com/jfeinstein10/SlidingMenu/issues/326

szitguy avatar Sep 16 '13 12:09 szitguy