Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change Options #128

Closed
ahna92 opened this issue Dec 27, 2017 · 1 comment
Closed

How to change Options #128

ahna92 opened this issue Dec 27, 2017 · 1 comment

Comments

@ahna92
Copy link

ahna92 commented Dec 27, 2017

I was wondering if it's possible to change the option returned in the Cameralistener when camera opens :

@Override public void onCameraOpened(CameraOptions options) { super.onCameraOpened(options); }

in the CameraOptions there is options.getSupportedPictureAspectRatios()

which return a list of Aspect Ratios, one of them is 16:9

is there a way to select that Ratio , because it is the most fit in my situation .

this might be off topic, but the reason I want to select it is because match_parent is not working as descried.

this is my fragment layout :

`

<com.otaliastudios.cameraview.CameraView
    android:id="@+id/camera"
    android:visibility="visible"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_centerInParent="true"
    android:keepScreenOn="true"
    app:cameraSessionType="video"
    android:background="@android:color/white"
    />

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/tv_timer"/>
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        android:id="@+id/camera_flash"
        android:src="@drawable/ic_flash_off_white_24dp" />

    <app.com.insta.ui.views.RecordButton
        android:id="@+id/camera_record"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="40dp" />
</RelativeLayout>
`

screen shoot with user already selected 4:3 from the system app camera :

screenshot_20171227-184636

after user change to 16:9 then open the app the problem of the black area disappear which
kinda solve the problem except for that the camera width is not filling the whole screen :

screenshot_20171227-184708

test handsets :
-google pixel (both problems)
-sony z3 (only the match_parent problem ).

@ahna92 ahna92 changed the title How to change Option How to change Option s Dec 27, 2017
@ahna92 ahna92 changed the title How to change Option s How to change Options Dec 27, 2017
@ahna92 ahna92 closed this as completed Dec 28, 2017
@ahna92 ahna92 reopened this Dec 28, 2017
@ahna92
Copy link
Author

ahna92 commented Dec 28, 2017

I was using android:hardwareAccelerated ="false" in the manifest , once removed every thing worked perfectly

`<application
android:name=".ApplicationController"

    android:allowBackup="true"

    android:hardwareAccelerated="false" // removed

    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="false"
    android:theme="@style/AppTheme"
    tools:replace="allowBackup,supportsRtl">`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant