I'm having a tough time forcing my app to use portrait mode on Google TV. I know this is technically unsupported but I feel like I should be able to do this manually somehow, especially seeing as some apps on Google Play successfully force this behavior system wide (like: https://play.google.com/store/apps/details?id=com.coinsoft.android.orientcontrol and https://play.google.com/store/apps/details?id=nl.fameit.rotate&hl=en).
In my activity I am doing:
public void onStart() {
View root = findViewById(android.R.id.content);
Animator anim = AnimatorInflater.loadAnimator(this, R.anim.rotate_90);
anim.setTarget(root);
anim.start();
}
My rotate_90.xml:
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="0"
android:propertyName="rotation"
android:repeatCount="0"
android:valueTo="90"
android:valueType="floatType" />
This seems to work, but of course doesn't do exactly what I want. The view is rotated, but all the items on the far left are now off screen. Is there a way to dynamically re-size the root layout to fit the screen in portrait mode?