Default to landscape orientation for Android TV
This commit is contained in:
parent
330eb896d8
commit
8d98f9a967
1 changed files with 3 additions and 2 deletions
|
|
@ -164,13 +164,14 @@ public final class MainVideoPlayer extends AppCompatActivity
|
||||||
super.onChange(selfChange);
|
super.onChange(selfChange);
|
||||||
if (globalScreenOrientationLocked()) {
|
if (globalScreenOrientationLocked()) {
|
||||||
final boolean lastOrientationWasLandscape = defaultPreferences.getBoolean(
|
final boolean lastOrientationWasLandscape = defaultPreferences.getBoolean(
|
||||||
getString(R.string.last_orientation_landscape_key), false);
|
getString(R.string.last_orientation_landscape_key), FireTvUtils.isFireTv());
|
||||||
setLandscape(lastOrientationWasLandscape);
|
setLandscape(lastOrientationWasLandscape);
|
||||||
} else {
|
} else {
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
getContentResolver().registerContentObserver(
|
getContentResolver().registerContentObserver(
|
||||||
Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION),
|
Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION),
|
||||||
false, rotationObserver);
|
false, rotationObserver);
|
||||||
|
|
@ -238,7 +239,7 @@ public final class MainVideoPlayer extends AppCompatActivity
|
||||||
|
|
||||||
if (globalScreenOrientationLocked()) {
|
if (globalScreenOrientationLocked()) {
|
||||||
boolean lastOrientationWasLandscape = defaultPreferences.getBoolean(
|
boolean lastOrientationWasLandscape = defaultPreferences.getBoolean(
|
||||||
getString(R.string.last_orientation_landscape_key), false);
|
getString(R.string.last_orientation_landscape_key), FireTvUtils.isFireTv());
|
||||||
setLandscape(lastOrientationWasLandscape);
|
setLandscape(lastOrientationWasLandscape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue