【发布时间】:2016-03-19 05:43:02
【问题描述】:
Activity支持Landscape模式
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="landscape"
android:label="@string/app_name" >
我已将 50% 的空间分配给 Video Player(使用 FrameLayout),其余 50% 分配给 ListView。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/video_frame"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<ListView
android:id="@+id/video_list_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
现在,我已经开始播放视频 > 移到全屏模式> 按回退出全屏模式> 在纵向模式下获得活动(而我希望在横向模式下获得它)
boolean isFullScreen = false;
@Override
public void onGoToFullscreen() {
isFullScreen = true;
videoListView.setVisibility(View.INVISIBLE);
}
@Override
public void onReturnFromFullscreen() {
videoListView.setVisibility(View.VISIBLE);
}
@Override
public void onBackPressed() {
Log.d("boolean:-", Boolean.toString(isFullScreen));
if(isFullScreen) {
imaPlayer.getContentPlayer().setFullscreen(false);
}
else {
super.onBackPressed();
}
}
【问题讨论】:
标签: android android-activity android-manifest android-orientation exoplayer