List of usage examples for android.widget SlidingDrawer isOpened
public boolean isOpened()
From source file:net.line2soft.preambul.views.SlippyMapActivity.java
/** * Displays the sliding drawer which contains navigation instructions, and loads instructions * @param id The ID of the {@link Excursion} to display *///from ww w .ja va 2s . c o m private void showNavigationInstruction(int id) { try { //Set view pager NavigationInstructionPagerAdapter adapter = new NavigationInstructionPagerAdapter(MapController .getInstance(this).getCurrentLocation().getExcursions(this).get(id).getInstructions()); ViewPager myPager = (ViewPager) findViewById(R.id.pager_nav); myPager.setAdapter(adapter); myPager.setOnPageChangeListener(listener); MapView mv = (MapView) findViewById(R.id.mapView); //Change zoom int zoomMoyen = mv.getMapZoomControls().getZoomLevelMin() + (int) ((mv.getMapZoomControls().getZoomLevelMax() - mv.getMapZoomControls().getZoomLevelMin()) / 2); mv.getController().setZoom(zoomMoyen); //Display sliding drawer SlidingDrawer slide = (SlidingDrawer) findViewById(R.id.drawer); slide.setVisibility(View.VISIBLE); setNavigationInstructionToDisplay(0); if (!slide.isOpened()) { slide.animateOpen(); } } catch (Exception e) { displayInfo(getString(R.string.message_map_navigation_error)); e.printStackTrace(); hideNavigationInstruction(); } }