I have got a task to develop a library, which uses Camera preview (Android Camera API 1). I have done all the hard work, which relates to the library(can't share, I have the agreement). However, the problem is severe.. camera preview stretches on some devices, or is not full size, leave background... I have tried all solutions(yes, pretty sure all :D ) in Popular question or similar posts... However, these solutions don't work up to today( not on all devices). I would use camera hardware 2, but I need to target API 15 also... Please, share your solution or code sample of how display preview. I have developer project in Github just for this issue, it might be useful for others in the future... I know it can be done, openCamera had done it, I learned a lot from that code https://opencamera.sourceforge.io/ My GitHub project
Asked
Active
Viewed 115 times
1 Answers
0
You can make the camera activity full screen using styles and themes. Just add these lines to your theme.
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
This will remove the actionbar and make the activity full screen. you can assign this theme to the activity separately using the manifest

NirmalCode
- 2,140
- 1
- 14
- 19