2013-07-05 31 views
0

在我的應用程序我有一個flipView使用emilsjolander庫。這很好,但我無法在打開FlipView時自動停止翻轉效果。事實上,如果我觸摸屏幕的效果停止,但我會在幾秒鐘後停止。你知道庫是否包含一個方法,或者,在幾秒鐘後模擬touchEvent? 感謝的停止與emilsjolander翻轉FlipView

回答

0

我知道答案是這麼晚,但如果他們陷入這個問題,它會幫助別人。反正

//peakNext(false); 
+0

感謝,但我同樣解決了修改庫:您可以通過只禁用評論第一頁自動翻轉你的迴應 – hasmet

0
public class MyFlipView extends se.emilsjolander.flipview.FlipView 
{ 
    private boolean isEnabled = true; 

    public MyFlipView(Context context) 
    { 
     super(context); 

    } 

    public MyFlipView(Context context, AttributeSet attrs) 
    { 
     super(context, attrs, 0); 
    } 

    public MyFlipView(Context context, AttributeSet attrs, int defStyle) 
    { 
     super(context, attrs, defStyle); 
    } 

    @Override 
    public boolean onInterceptTouchEvent(MotionEvent ev) 
    { 
     if (isEnabled) 
      return super.onInterceptTouchEvent(ev); 
     else 
      return false; 
    } 

    public void disable() 
    { 
     isEnabled = false; 
    } 

    public void enable() 
    { 
     isEnabled = true; 
    } 
} 

申報XML作爲 < 「YourPackage」 .MyFlipView

/>