1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.android.maps; 18 19 import com.android.layoutlib.bridge.MockView; 20 21 import android.content.Context; 22 import android.os.Bundle; 23 import android.util.AttributeSet; 24 import android.view.View; 25 26 /** 27 * Mock version of the MapView. 28 * Only non override public methods from the real MapView have been added in there. 29 * Methods that take an unknown class as parameter or as return object, have been removed for now. 30 * 31 * TODO: generate automatically. 32 * 33 */ 34 public class MapView extends MockView { 35 36 /** 37 * Construct a new WebView with a Context object. 38 * @param context A Context object used to access application assets. 39 */ MapView(Context context)40 public MapView(Context context) { 41 this(context, null); 42 } 43 44 /** 45 * Construct a new WebView with layout parameters. 46 * @param context A Context object used to access application assets. 47 * @param attrs An AttributeSet passed to our parent. 48 */ MapView(Context context, AttributeSet attrs)49 public MapView(Context context, AttributeSet attrs) { 50 this(context, attrs, com.android.internal.R.attr.mapViewStyle); 51 } 52 53 /** 54 * Construct a new WebView with layout parameters and a default style. 55 * @param context A Context object used to access application assets. 56 * @param attrs An AttributeSet passed to our parent. 57 * @param defStyle The default style resource ID. 58 */ MapView(Context context, AttributeSet attrs, int defStyle)59 public MapView(Context context, AttributeSet attrs, int defStyle) { 60 super(context, attrs, defStyle); 61 } 62 63 // START FAKE PUBLIC METHODS 64 displayZoomControls(boolean takeFocus)65 public void displayZoomControls(boolean takeFocus) { 66 } 67 canCoverCenter()68 public boolean canCoverCenter() { 69 return false; 70 } 71 preLoad()72 public void preLoad() { 73 } 74 getZoomLevel()75 public int getZoomLevel() { 76 return 0; 77 } 78 setSatellite(boolean on)79 public void setSatellite(boolean on) { 80 } 81 isSatellite()82 public boolean isSatellite() { 83 return false; 84 } 85 setTraffic(boolean on)86 public void setTraffic(boolean on) { 87 } 88 isTraffic()89 public boolean isTraffic() { 90 return false; 91 } 92 setStreetView(boolean on)93 public void setStreetView(boolean on) { 94 } 95 isStreetView()96 public boolean isStreetView() { 97 return false; 98 } 99 getLatitudeSpan()100 public int getLatitudeSpan() { 101 return 0; 102 } 103 getLongitudeSpan()104 public int getLongitudeSpan() { 105 return 0; 106 } 107 getMaxZoomLevel()108 public int getMaxZoomLevel() { 109 return 0; 110 } 111 onSaveInstanceState(Bundle state)112 public void onSaveInstanceState(Bundle state) { 113 } 114 onRestoreInstanceState(Bundle state)115 public void onRestoreInstanceState(Bundle state) { 116 } 117 getZoomControls()118 public View getZoomControls() { 119 return null; 120 } 121 } 122