Search in sources :

Example 1 with ActivitySwipeDetector

use of org.storymaker.app.ui.ActivitySwipeDetector in project storymaker by StoryMaker.

the class OverlayCameraActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    overlayGroup = getIntent().getIntExtra("group", 0);
    overlayIdx = getIntent().getIntExtra("overlay", 0);
    mStoryMode = getIntent().getIntExtra("mode", -1);
    mOverlayView = new ImageView(this);
    ActivitySwipeDetector swipe = new ActivitySwipeDetector(this);
    mOverlayView.setOnTouchListener(swipe);
    mOverlayView.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            closeOverlay();
        }
    });
    mSurfaceView = new SurfaceView(this);
    addContentView(mSurfaceView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    mSurfaceHolder = mSurfaceView.getHolder();
    mSurfaceHolder.addCallback(this);
    mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    addContentView(mOverlayView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
Also used : LayoutParams(android.view.WindowManager.LayoutParams) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) ActivitySwipeDetector(org.storymaker.app.ui.ActivitySwipeDetector) SurfaceView(android.view.SurfaceView) ImageView(android.widget.ImageView) View(android.view.View) SurfaceView(android.view.SurfaceView)

Aggregations

SurfaceView (android.view.SurfaceView)1 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 LayoutParams (android.view.WindowManager.LayoutParams)1 ImageView (android.widget.ImageView)1 ActivitySwipeDetector (org.storymaker.app.ui.ActivitySwipeDetector)1