/** refresh the list of controllers */ @Override protected void onResume() { super.onResume(); Log.i(this.getClass().getName(), "calling onResume"); startControllerAutomatically(); controllerAdapter.notifyDataSetChanged(); }
/** * This is mostly used to get the size of the screen to be able to get a good layout for the * buttons on the controller screen */ @Override protected void onPause() { super.onPause(); // We get the coordinate of the screen if (CurrentConfiguration.heightInPixel == -1) { RelativeLayout parent = ((RelativeLayout) controllerList.getParent()); CurrentConfiguration.heightInPixel = parent.getHeight(); CurrentConfiguration.widthInPixel = parent.getWidth(); } }
@Override public void onBackPressed() { super.onBackPressed(); SshControllerUtils.setAutoConnect(autoConnect.isChecked()); SshControllerUtils.setLockScreen(lockScreen.isChecked()); SshControllerUtils.setLookForHiddenFiles(lookForHiddenFiles.isChecked()); SshControllerUtils.saveGlobalConfiguration(); overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out); finish(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_global_configuration); autoConnect = (CheckBox) findViewById(R.id.autoConnectCheckBox); autoConnect.setChecked(SshControllerUtils.isAutoConnectEnabled()); lockScreen = (CheckBox) findViewById(R.id.lockScreenCheckBox); lockScreen.setChecked(SshControllerUtils.isLockScreenEnabled()); lookForHiddenFiles = (CheckBox) findViewById(R.id.lookForHiddenFilesCheckBox); lookForHiddenFiles.setChecked(SshControllerUtils.islookForHiddenFilesEnabled()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); CurrentConfiguration.instance = this; controllerList = (ListView) findViewById(R.id.controllerList); controllerAdapter = new ControllerAdapter(this); controllerList.setAdapter(controllerAdapter); controllerAdapter.notifyDataSetChanged(); controllerList.setOnItemLongClickListener(this); controllerList.setOnItemClickListener(this); }