This seems like it should be trivial, but I can't figure out how to set the layout_gravity for a FrameLayout's child programmatically for the life of me.
There's a ton of similar questions on SO, but after trying a good 10 of them, none of the setGravity, new FrameLayout.LayoutParams, etc. solutions seem to work.
Below is a simplified version of what I'm trying to achieve.
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextureView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"/>
</FrameLayout>
However, for external reasons, I'm adding the TextureView to the FrameLayout programatically.
mCameraPreview = new CameraPreview(this, recordMode);
FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview_wrapper);
preview.addView(mCameraPreview);
When I try to set the layout_gravity on the mCameraPreview, it only gives me an option for gravity, which I don't want.
Is there something I'm missing here?