I am trying to write an internal extension for Adobe to catch a mouse wheel on an android.
Android receives the mouse wheel event when I test it as a native application.
But when I try to pack this code as my own extension, I do not receive the event.
I follow this tutorial .
Can I add a listener to the current view?
Did I miss something else?
Is there a mouse wheel extension for mouse wheel in android?
public class OpenAppANE extends Activity implements FREExtension, OnTouchListener {
public void startMouseEvent()
{
LinearLayout touchLayout = new LinearLayout(this);
LayoutParams lp = new LayoutParams(30, LayoutParams.MATCH_PARENT);
touchLayout.setLayoutParams(lp);
touchLayout.setOnTouchListener(this);
WindowManager mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
WindowManager.LayoutParams mParams = new WindowManager.LayoutParams(30,
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
mParams.gravity = Gravity.LEFT | Gravity.TOP;
Log.i("TAG", "add View");
mWindowManager.addView(touchLayout, mParams);
}
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
Toast.makeText(appContext, "inside onGenericMotionEvent" , Toast.LENGTH_SHORT ).show();
}
}
source
share