Camera PreviewSize is very tricky to set.
On some phones, the top status bar's height will not be taken into consideration, but other implementation do will take that height into consideration. And also the bottom virtual button area.
For eg, if the total screen's width = 1080 and height = 1920, then when the status bar's height and virtual button area's height are not be taken into consideration, if you set PreviewSize a ratio with 16:9, it will be look good. But! When the status bar's height and the virtaul button ares's height are taken into consideration, the available screen height will never get 1920, then the ratio in your screen will be different to the PreviewSize, and it will be stretched.
To solve the problem, you should implement your own getOptimalPreviewSize() method and choose the proper preview ratio according to your available screen height.