I am working on one camera app and capturing image using custom camera api. For preview I am using frame layout.I want to make that frame layout which is circular as shown in the image and show preview in circular frame layout.Please help.
Asked
Active
Viewed 1,538 times
1
-
you are having an imageView inside the framelayout? – Sami Kanafani Sep 13 '17 at 13:32
-
@SamiKanafani no only frame layout for camera preview. – Ashutosh Singh Sep 13 '17 at 13:37
-
1https://stackoverflow.com/a/42083021/5156075 – John Joe Sep 13 '17 at 13:42
-
@JohnJoe that is imageview and if I am not wrong we can not show camera preview in image view.After capturing the image we can show captured image to image view.But my question is what about preview how to make it circular?For preview we can user surface layout or frame layout but challenge is making it circular. – Ashutosh Singh Sep 13 '17 at 13:58
-
1https://stackoverflow.com/q/15391329 may be this will help you. You can combine @John Joe answer and link content . Hop it will solve your problem. – Dipak Sonnar Oct 14 '17 at 05:23
-
@AshutoshSingh: Did you find a solution for this? I am stuck with the same implementation. Can you please post your solution. Thanks – user2234 Nov 11 '17 at 12:58
-
No, I did not find solution for this. – Ashutosh Singh Nov 13 '17 at 13:57
1 Answers
1
You want to change your view to circle, Right?
I found a library that can change your views to custom shapes.
link : https://github.com/florent37/ShapeOfView
<com.github.florent37.shapeofview.shapes.CircleView
android:layout_width="150dp"
android:layout_height="150dp"
android:elevation="4dp"
app:shape_circle_borderColor="@android:color/black"
app:shape_circle_borderWidth="2dp">
<!-- YOUR CONTENT -->
</com.github.florent37.shapeofview.shapes.CircleView>

Afinas EM
- 2,755
- 1
- 15
- 28