use of com.qualcomm.robotcore.util.ImmersiveMode in project Relic_Main by TeamOverdrive.
the class FtcRobotControllerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// robustify against onCreate() following onDestroy() but using the same app instance, which apparently does happen
RobotLog.onApplicationStart();
RobotLog.vv(TAG, "onCreate()");
// do this way instead of inherit to help AppInventor
ThemedActivity.appAppThemeToActivity(getTag(), this);
Assert.assertTrue(FtcRobotControllerWatchdogService.isFtcRobotControllerActivity(AppUtil.getInstance().getRootActivity()));
Assert.assertTrue(AppUtil.getInstance().isRobotController());
// a stand-alone USB-connected module?
if (LynxConstants.isRevControlHub()) {
if (LynxConstants.disableDragonboard()) {
// Double-sure check that the Lynx Module can operate over USB, etc, then get out of Dodge
RobotLog.vv(TAG, "disabling Dragonboard and exiting robot controller");
DragonboardLynxDragonboardIsPresentPin.getInstance().setState(false);
AppUtil.getInstance().finishRootActivityAndExitApp();
} else {
// Double-sure check that we can talk to the DB over the serial TTY
DragonboardLynxDragonboardIsPresentPin.getInstance().setState(true);
}
}
context = this;
utility = new Utility(this);
DeviceNameManager.getInstance().start(deviceNameManagerStartResult);
PreferenceRemoterRC.getInstance().start(prefRemoterStartResult);
receivedUsbAttachmentNotifications = new ConcurrentLinkedQueue<UsbDevice>();
eventLoop = null;
setContentView(R.layout.activity_ftc_controller);
preferencesHelper = new PreferencesHelper(TAG, context);
preferencesHelper.writeBooleanPrefIfDifferent(context.getString(R.string.pref_rc_connected), true);
preferencesHelper.getSharedPreferences().registerOnSharedPreferenceChangeListener(sharedPreferencesListener);
entireScreenLayout = (LinearLayout) findViewById(R.id.entire_screen);
buttonMenu = (ImageButton) findViewById(R.id.menu_buttons);
buttonMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AppUtil.getInstance().openOptionsMenuFor(FtcRobotControllerActivity.this);
}
});
BlocksOpMode.setActivityAndWebView(this, (WebView) findViewById(R.id.webViewBlocksRuntime));
ClassManagerFactory.registerFilters();
ClassManagerFactory.processAllClasses();
cfgFileMgr = new RobotConfigFileManager(this);
// Clean up 'dirty' status after a possible crash
RobotConfigFile configFile = cfgFileMgr.getActiveConfig();
if (configFile.isDirty()) {
configFile.markClean();
cfgFileMgr.setActiveConfig(false, configFile);
}
textDeviceName = (TextView) findViewById(R.id.textDeviceName);
textNetworkConnectionStatus = (TextView) findViewById(R.id.textNetworkConnectionStatus);
textRobotStatus = (TextView) findViewById(R.id.textRobotStatus);
textOpMode = (TextView) findViewById(R.id.textOpMode);
textErrorMessage = (TextView) findViewById(R.id.textErrorMessage);
textGamepad[0] = (TextView) findViewById(R.id.textGamepad1);
textGamepad[1] = (TextView) findViewById(R.id.textGamepad2);
immersion = new ImmersiveMode(getWindow().getDecorView());
dimmer = new Dimmer(this);
dimmer.longBright();
programmingWebHandlers = new ProgrammingWebHandlers();
programmingModeController = new ProgrammingModeControllerImpl(this, (TextView) findViewById(R.id.textRemoteProgrammingMode), programmingWebHandlers);
updateUI = createUpdateUI();
callback = createUICallback(updateUI);
PreferenceManager.setDefaultValues(this, R.xml.app_settings, false);
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "");
hittingMenuButtonBrightensScreen();
wifiLock.acquire();
callback.networkConnectionUpdate(WifiDirectAssistant.Event.DISCONNECTED);
readNetworkType();
ServiceController.startService(FtcRobotControllerWatchdogService.class);
bindToService();
logPackageVersions();
}
use of com.qualcomm.robotcore.util.ImmersiveMode in project robotcode by OutoftheBoxFTC.
the class FtcRobotControllerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// robustify against onCreate() following onDestroy() but using the same app instance, which apparently does happen
RobotLog.onApplicationStart();
RobotLog.vv(TAG, "onCreate()");
/* // Modified for OpenRC
* Check to see if the DS app is also installed.
* If it is, then show the user a dialog explaining
* the situation and offer them the option to uninstall
* either the DS app or the RC app
*/
if (BuildConfig.IS_OPENRC && Utils.isFtcDriverStationInstalled(getPackageManager())) {
UiUtils.showDsAppInstalledDialog(this);
}
if (BuildConfig.IS_OPENRC && !Utils.hasAcknowledgedLegalityStatus()) {
UiUtils.showLegalityAcknowlegementDialog(this);
}
// do this way instead of inherit to help AppInventor
ThemedActivity.appAppThemeToActivity(getTag(), this);
Assert.assertTrue(FtcRobotControllerWatchdogService.isFtcRobotControllerActivity(AppUtil.getInstance().getRootActivity()));
Assert.assertTrue(AppUtil.getInstance().isRobotController());
// a stand-alone USB-connected module?
if (LynxConstants.isRevControlHub()) {
if (LynxConstants.disableDragonboard()) {
// Double-sure check that the Lynx Module can operate over USB, etc, then get out of Dodge
RobotLog.vv(TAG, "disabling Dragonboard and exiting robot controller");
DragonboardLynxDragonboardIsPresentPin.getInstance().setState(false);
AppUtil.getInstance().finishRootActivityAndExitApp();
} else {
// Double-sure check that we can talk to the DB over the serial TTY
DragonboardLynxDragonboardIsPresentPin.getInstance().setState(true);
}
}
context = this;
utility = new Utility(this);
DeviceNameManager.getInstance().start(deviceNameManagerStartResult);
PreferenceRemoterRC.getInstance().start(prefRemoterStartResult);
receivedUsbAttachmentNotifications = new ConcurrentLinkedQueue<UsbDevice>();
eventLoop = null;
setContentView(R.layout.activity_ftc_controller);
preferencesHelper = new PreferencesHelper(TAG, context);
preferencesHelper.writeBooleanPrefIfDifferent(context.getString(R.string.pref_rc_connected), true);
preferencesHelper.getSharedPreferences().registerOnSharedPreferenceChangeListener(sharedPreferencesListener);
entireScreenLayout = (LinearLayout) findViewById(R.id.entire_screen);
buttonMenu = (ImageButton) findViewById(R.id.menu_buttons);
buttonMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AppUtil.getInstance().openOptionsMenuFor(FtcRobotControllerActivity.this);
}
});
if (isFullVersion) {
BlocksOpMode.setActivityAndWebView(this, (WebView) findViewById(R.id.webViewBlocksRuntime));
}
ClassManagerFactory.registerFilters();
ClassManagerFactory.processAllClasses();
cfgFileMgr = new RobotConfigFileManager(this);
// Clean up 'dirty' status after a possible crash
RobotConfigFile configFile = cfgFileMgr.getActiveConfig();
if (configFile.isDirty()) {
configFile.markClean();
cfgFileMgr.setActiveConfig(false, configFile);
}
textDeviceName = (TextView) findViewById(R.id.textDeviceName);
textNetworkConnectionStatus = (TextView) findViewById(R.id.textNetworkConnectionStatus);
textRobotStatus = (TextView) findViewById(R.id.textRobotStatus);
textOpMode = (TextView) findViewById(R.id.textOpMode);
textErrorMessage = (TextView) findViewById(R.id.textErrorMessage);
textGamepad[0] = (TextView) findViewById(R.id.textGamepad1);
textGamepad[1] = (TextView) findViewById(R.id.textGamepad2);
if (BuildConfig.IS_OPENRC) {
textOpenRCVersion = (TextView) findViewById(R.id.openrc_version);
textOpenRCVersion.setText(org.openftc.rc.BuildConfig.VERSION_COMPLETE);
}
immersion = new ImmersiveMode(getWindow().getDecorView());
dimmer = new Dimmer(this);
dimmer.longBright();
if (isFullVersion) {
programmingWebHandlers = new ProgrammingWebHandlers();
programmingModeController = new ProgrammingModeControllerImpl(this, (TextView) findViewById(R.id.textRemoteProgrammingMode), programmingWebHandlers);
}
updateUI = createUpdateUI();
callback = createUICallback(updateUI);
PreferenceManager.setDefaultValues(this, R.xml.app_settings, false);
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "");
hittingMenuButtonBrightensScreen();
wifiLock.acquire();
callback.networkConnectionUpdate(WifiDirectAssistant.Event.DISCONNECTED);
readNetworkType();
ServiceController.startService(FtcRobotControllerWatchdogService.class);
bindToService();
logPackageVersions();
}
use of com.qualcomm.robotcore.util.ImmersiveMode in project FTC-2017 by FIRST-4030.
the class FtcRobotControllerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// robustify against onCreate() following onDestroy() but using the same app instance, which apparently does happen
RobotLog.onApplicationStart();
RobotLog.vv(TAG, "onCreate()");
// do this way instead of inherit to help AppInventor
ThemedActivity.appAppThemeToActivity(getTag(), this);
Assert.assertTrue(FtcRobotControllerWatchdogService.isFtcRobotControllerActivity(AppUtil.getInstance().getRootActivity()));
Assert.assertTrue(AppUtil.getInstance().isRobotController());
// a stand-alone USB-connected module?
if (LynxConstants.isRevControlHub()) {
if (LynxConstants.disableDragonboard()) {
// Double-sure check that the Lynx Module can operate over USB, etc, then get out of Dodge
RobotLog.vv(TAG, "disabling Dragonboard and exiting robot controller");
DragonboardLynxDragonboardIsPresentPin.getInstance().setState(false);
AppUtil.getInstance().finishRootActivityAndExitApp();
} else {
// Double-sure check that we can talk to the DB over the serial TTY
DragonboardLynxDragonboardIsPresentPin.getInstance().setState(true);
}
}
context = this;
utility = new Utility(this);
DeviceNameManager.getInstance().start(deviceNameManagerStartResult);
PreferenceRemoterRC.getInstance().start(prefRemoterStartResult);
receivedUsbAttachmentNotifications = new ConcurrentLinkedQueue<UsbDevice>();
eventLoop = null;
setContentView(R.layout.activity_ftc_controller);
preferencesHelper = new PreferencesHelper(TAG, context);
preferencesHelper.writeBooleanPrefIfDifferent(context.getString(R.string.pref_rc_connected), true);
preferencesHelper.getSharedPreferences().registerOnSharedPreferenceChangeListener(sharedPreferencesListener);
entireScreenLayout = (LinearLayout) findViewById(R.id.entire_screen);
buttonMenu = (ImageButton) findViewById(R.id.menu_buttons);
buttonMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AppUtil.getInstance().openOptionsMenuFor(FtcRobotControllerActivity.this);
}
});
BlocksOpMode.setActivityAndWebView(this, (WebView) findViewById(R.id.webViewBlocksRuntime));
ClassManagerFactory.registerFilters();
ClassManagerFactory.processAllClasses();
cfgFileMgr = new RobotConfigFileManager(this);
// Clean up 'dirty' status after a possible crash
RobotConfigFile configFile = cfgFileMgr.getActiveConfig();
if (configFile.isDirty()) {
configFile.markClean();
cfgFileMgr.setActiveConfig(false, configFile);
}
textDeviceName = (TextView) findViewById(R.id.textDeviceName);
textNetworkConnectionStatus = (TextView) findViewById(R.id.textNetworkConnectionStatus);
textRobotStatus = (TextView) findViewById(R.id.textRobotStatus);
textOpMode = (TextView) findViewById(R.id.textOpMode);
textErrorMessage = (TextView) findViewById(R.id.textErrorMessage);
textGamepad[0] = (TextView) findViewById(R.id.textGamepad1);
textGamepad[1] = (TextView) findViewById(R.id.textGamepad2);
immersion = new ImmersiveMode(getWindow().getDecorView());
dimmer = new Dimmer(this);
dimmer.longBright();
programmingWebHandlers = new ProgrammingWebHandlers();
programmingModeController = new ProgrammingModeControllerImpl(this, (TextView) findViewById(R.id.textRemoteProgrammingMode), programmingWebHandlers);
updateUI = createUpdateUI();
callback = createUICallback(updateUI);
PreferenceManager.setDefaultValues(this, R.xml.app_settings, false);
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "");
hittingMenuButtonBrightensScreen();
wifiLock.acquire();
callback.networkConnectionUpdate(WifiDirectAssistant.Event.DISCONNECTED);
readNetworkType();
ServiceController.startService(FtcRobotControllerWatchdogService.class);
bindToService();
logPackageVersions();
}
Aggregations