2 * Copyright © 2013 Mike Beattie <mike@ethernal.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 package org.altusmetrum.AltosDroid;
20 import org.altusmetrum.altoslib_1.AltosState;
22 import com.google.android.gms.maps.GoogleMap;
24 import android.app.Activity;
25 import android.os.Bundle;
26 import android.support.v4.app.Fragment;
27 import android.support.v4.app.FragmentTransaction;
28 import android.view.LayoutInflater;
29 import android.view.View;
30 import android.view.ViewGroup;
32 public class TabMap extends Fragment implements AltosDroidTab {
33 AltosDroid mAltosDroid;
35 private GoogleMap mMap;
39 public void onAttach(Activity activity) {
40 super.onAttach(activity);
41 mAltosDroid = (AltosDroid) activity;
42 mAltosDroid.registerTab(this);
46 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
47 View v = inflater.inflate(R.layout.tab_map, container, false);
52 public void onDestroyView() {
53 super.onDestroyView();
55 mAltosDroid.unregisterTab(this);
58 //Fragment fragment = (getFragmentManager().findFragmentById(R.id.map));
59 //FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
60 //ft.remove(fragment);
64 public void update_ui(AltosState state) {
65 // mRangeView.setText(String.format("%6.0f m", state.range));
66 // if (state.from_pad != null)
67 // mBearingView.setText(String.format("%3.0f°", state.from_pad.bearing));
68 // mLatitudeView.setText(pos(state.gps.lat, "N", "S"));
69 // mLongitudeView.setText(pos(state.gps.lon, "W", "E"));