Added rat type in gui

This commit is contained in:
Ziver Koc 2014-08-04 14:21:27 +02:00
parent 7ca05039b5
commit e020204ce5
5 changed files with 93 additions and 35 deletions

View file

@ -31,11 +31,9 @@ import de.mindpipe.android.logging.log4j.LogConfigurator;
public class MainActivity extends FragmentActivity implements OnSharedPreferenceChangeListener{
private static final Logger log = Logger.getLogger(MainActivity.class);
public static final String DEFAULT_LOG_PATH = "/sdcard/uecontrol/";
/**
* Fragment managing the behaviors, interactions and presentation of the navigation drawer.
*/
private NavigationDrawerFragment navigationDrawerFragment;
/** Fragments **/
private StatusFragment statusFragment;
private boolean backButtonPressed = false;
@ -52,17 +50,11 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
// Setup Main GUI
setContentView(R.layout.activity_main);
//navigationDrawerFragment = (NavigationDrawerFragment)
// getFragmentManager().findFragmentById(R.id.navigation_drawer);
statusFragment = (StatusFragment)
getFragmentManager().findFragmentById(R.id.status_fragment);
getFragmentManager().beginTransaction()
.replace(R.id.container, BehaviourListFragment.newInstance()).commit();
// Set up the drawer.
//navigationDrawerFragment.setUp(
// R.id.navigation_drawer,
// (DrawerLayout) findViewById(R.id.drawer_layout));
currentExecutor = new UeControlExecutor();
currentExecutor.addBehaviour(new UeBehaviourSleep());
@ -73,7 +65,7 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
public void setupDebugLogging(){
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
String path = prefs.getString("logging_path", "/sdcard/uecontrol/");
String path = prefs.getString("logging_path", DEFAULT_LOG_PATH);
if(!path.endsWith("/")) path += File.separator;
LogConfigurator logConfigurator = new LogConfigurator();
@ -105,19 +97,16 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (navigationDrawerFragment == null || !navigationDrawerFragment.isDrawerOpen()) {
// Only show items in the action bar relevant to this screen
// if the drawer is not showing. Otherwise, let the drawer
// decide what to show in the action bar.
getMenuInflater().inflate(R.menu.main, menu);
// Only show items in the action bar relevant to this screen
// if the drawer is not showing. Otherwise, let the drawer
// decide what to show in the action bar.
getMenuInflater().inflate(R.menu.main, menu);
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setDisplayShowTitleEnabled(true);
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setDisplayShowTitleEnabled(true);
return true;
}
return super.onCreateOptionsMenu(menu);
return true;
}