android - Fullscreen photo at surfaceview -


i need ontouchfocus fullscreen surfaceview in example: https://github.com/jayrambhia/touch2focus works fine in landscape orientation (surfaceview changes resolution in portrait mode not fine @ standart android camera app). ideas how fix it? thanks.

add code in oncreate()

 window window = getwindow();         if (build.version.sdk_int < 16)             window.setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen);         else             window.getdecorview().setsystemuivisibility(view.system_ui_flag_fullscreen); 

this set activity window fullscreen android camera app. also, doing following in surfacechanged(surfaceholder holder, int format, int width, int height) method:

        if (height > width)             _camera.setdisplayorientation(90);         else             _camera.setdisplayorientation(0);          // setting bestpreviewsize current pixels         camera.parameters p = _camera.getparameters();          camera.size size = null;         list<camera.size> list = parameters.getsupportedpreviewsizes();          size = list.get(0);          for(int = 1; < list.size(); i++) {             if((list.get(i).width * list.get(i).height) > (size.width * size.height))             size = list.get(i);         }          if(size != null) {             p.setpreviewsize(size.width, size.height);             _camera.setparameters(p);         }         _camera.startpreview(); 

this gets list of supported preview sizes , chooses 1 closest screen size, , setting camera parameter. cheers :)


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -