Fix SurfaceControl demo app layout
The fixes sizes could end up being wider than the screen (e.g on Pixel 3a) PiperOrigin-RevId: 278642828
This commit is contained in:
parent
efc7f55616
commit
f51f7bd405
@ -124,10 +124,10 @@ public final class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
gridLayout.addView(view);
|
gridLayout.addView(view);
|
||||||
GridLayout.LayoutParams layoutParams = new GridLayout.LayoutParams();
|
GridLayout.LayoutParams layoutParams = new GridLayout.LayoutParams();
|
||||||
layoutParams.width = 400;
|
layoutParams.width = 0;
|
||||||
layoutParams.height = 400;
|
layoutParams.height = 0;
|
||||||
layoutParams.columnSpec = GridLayout.spec(i % 3);
|
layoutParams.columnSpec = GridLayout.spec(i % 3, 1f);
|
||||||
layoutParams.rowSpec = GridLayout.spec(i / 3);
|
layoutParams.rowSpec = GridLayout.spec(i / 3, 1f);
|
||||||
layoutParams.bottomMargin = 10;
|
layoutParams.bottomMargin = 10;
|
||||||
layoutParams.leftMargin = 10;
|
layoutParams.leftMargin = 10;
|
||||||
layoutParams.topMargin = 10;
|
layoutParams.topMargin = 10;
|
||||||
|
@ -20,24 +20,32 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:keepScreenOn="true">
|
android:keepScreenOn="true">
|
||||||
|
|
||||||
<GridLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/grid_layout"
|
android:orientation="vertical">
|
||||||
android:columnCount="3" />
|
|
||||||
|
<GridLayout
|
||||||
|
android:id="@+id/grid_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:columnCount="3"/>
|
||||||
|
|
||||||
|
<com.google.android.exoplayer2.ui.PlayerControlView
|
||||||
|
android:id="@+id/player_control_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
app:show_timeout="0"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<SurfaceView
|
<SurfaceView
|
||||||
|
android:id="@+id/full_screen_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/full_screen_view"
|
android:visibility="gone"/>
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<com.google.android.exoplayer2.ui.PlayerControlView
|
|
||||||
android:id="@+id/player_control_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
app:show_timeout="0" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user