List of usage examples for android.widget SlidingDrawer setVisibility
@RemotableViewMethod public void setVisibility(@Visibility int visibility)
From source file:net.line2soft.preambul.views.SlippyMapActivity.java
/** * Hides the sliding drawer which contains navigation instructions *//*from w w w. j av a 2 s. co m*/ private void hideNavigationInstruction() { SlidingDrawer slide = (SlidingDrawer) findViewById(R.id.drawer); slide.setVisibility(View.GONE); }
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 w w w . j a v a 2 s .co 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(); } }