我在实现自定义进度对话框时遇到了一些困难。即使覆盖拦截了触摸事件,用户仍然可以操作轨迹球并单击应该禁用的元素。
有没有办法解决?
编辑:这是一个解决方案
//=====================================================================================
protected void showProgressIndicator()
{
progressIndicator_.show();
}
//=====================================================================================
@Override
public boolean onTrackballEvent(MotionEvent event)
{
return progressIndicator_.getVisibility() == View.VISIBLE;
}
//=====================================================================================
protected void hideProgressIndicator()
{
progressIndicator_.hide();
}
一个 then in show 方法
//=====================================================================================
public void show()
{
setVisibility(VISIBLE);
if (animationHandler_ != null)
return;
animationHandler_ = new Handler();
animationHandler_.post(animateTask_);
requestFocus();
}