Remove Android TV

This commit is contained in:
Andrew Rabert 2017-03-05 11:24:24 -05:00
parent 5d1889fd1d
commit 4bf393e73e
2 changed files with 45 additions and 62 deletions

View File

@ -28,7 +28,6 @@
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<uses-feature android:name="android.software.leanback" android:required="false"/>
<supports-screens android:anyDensity="true" android:xlargeScreens="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
@ -45,7 +44,6 @@
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
</activity>

View File

@ -102,7 +102,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
protected SubsonicFragment currentFragment;
protected View primaryContainer;
protected View secondaryContainer;
protected boolean tv = false;
protected boolean touchscreen = true;
protected Handler handler = new Handler();
Spinner actionBarSpinner;
@ -127,9 +126,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
@Override
protected void onCreate(Bundle bundle) {
UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
// tv = true;
}
PackageManager pm = getPackageManager();
if(!pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
touchscreen = false;
@ -240,11 +236,7 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
@Override
public void setContentView(int viewId) {
if(isTv()) {
super.setContentView(R.layout.static_drawer_activity);
} else {
super.setContentView(R.layout.abstract_activity);
}
rootView = (ViewGroup) findViewById(R.id.content_frame);
if(viewId != 0) {
@ -310,7 +302,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
updateDrawerHeader();
if(!isTv()) {
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
// Pass in toolbar if it exists
@ -357,7 +348,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
}
}
});
}
// Check whether this is a tablet or not
secondaryContainer = findViewById(R.id.fragment_second_container);
@ -795,17 +785,15 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
}
spinnerAdapter.notifyDataSetChanged();
actionBarSpinner.setSelection(spinnerAdapter.getCount() - 1);
if(!isTv()) {
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowCustomEnabled(true);
}
if(drawerToggle.isDrawerIndicatorEnabled()) {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
drawerToggle.setDrawerIndicatorEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
} else if(!isTv()) {
} else {
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setTitle(currentFragment.getTitle());
getSupportActionBar().setDisplayShowCustomEnabled(false);
@ -843,7 +831,7 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
}
private void applyFullscreen() {
fullScreen = Util.getPreferences(this).getBoolean(Constants.PREFERENCES_KEY_FULL_SCREEN, false);
if(fullScreen || isTv()) {
if(fullScreen ) {
// Hide additional elements on higher Android versions
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
@ -928,9 +916,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
return theme;
}
public boolean isTv() {
return tv;
}
public boolean isTouchscreen() {
return touchscreen;
}