List of usage examples for android.widget TextView setElevation
public void setElevation(float elevation)
From source file:com.example.angelina.travelapp.map.MapFragment.java
/** * Show a special header when routes are displayed */// w w w . j a va 2s .c o m private void showRouteHeader(double travelTime) { final LayoutInflater inflater = (LayoutInflater) getActivity() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); final LinearLayout.LayoutParams layout = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); mRouteHeaderView = inflater.inflate(R.layout.route_header, null); final TextView tv = (TextView) mRouteHeaderView.findViewById(R.id.route_bar_title); tv.setElevation(6f); tv.setText(mCenteredPlace != null ? mCenteredPlace.getName() : null); tv.setTextColor(Color.WHITE); final TextView time = (TextView) mRouteHeaderView.findViewById(R.id.routeTime); time.setText(Math.round(travelTime) + " min"); final ImageView btnClose = (ImageView) mRouteHeaderView.findViewById(R.id.btnClose); final ImageView btnDirections = (ImageView) mRouteHeaderView.findViewById(R.id.btnDirections); final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar(); if (ab != null) { ab.hide(); } mMapView.addView(mRouteHeaderView, layout); btnClose.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { mMapView.removeView(mRouteHeaderView); if (ab != null) { ab.show(); } // Clear route if (mRouteOverlay != null) { mRouteOverlay.getGraphics().clear(); } if (mViewpoint != null) { mMapView.setViewpoint(mViewpoint); } mPresenter.start(); } }); btnDirections.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { // show directions ((MapActivity) getActivity()).showDirections(mRouteDirections); } }); }