1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-11 12:05:06 -05:00
k-9/src/com/fsck/k9/activity/ToggleScrollView.java
2010-07-13 21:49:28 +00:00

34 lines
744 B
Java

package com.fsck.k9.activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;
public class ToggleScrollView extends ScrollView
{
private boolean mScrolling = true;
public ToggleScrollView(Context context, AttributeSet attrs)
{
super(context, attrs);
}
public void setScrolling(boolean enable)
{
mScrolling = enable;
}
@Override
public boolean onTouchEvent(MotionEvent ev)
{
return (mScrolling) ? super.onTouchEvent(ev) : true;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
return (mScrolling) ? super.onInterceptTouchEvent(ev) : false;
}
}