Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorDmitry Kunin <dkunin@mapswith.me>2013-07-02 11:38:50 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:57:29 +0300
commit0af4953a13aba43dc9cf2691142223ac5dd9034d (patch)
tree84c0522f2ec7de5a729b0d8dc06819ebbd954172 /api
parentd2279af9510f4c6f4c7e0e5d2fdebda4571e29d8 (diff)
[android, api] License text and more comments added.
Diffstat (limited to 'api')
-rw-r--r--api/android/lib/res/layout/dlg_install_mwm.xml32
-rw-r--r--api/android/lib/src/com/mapswithme/maps/api/Const.java24
-rw-r--r--api/android/lib/src/com/mapswithme/maps/api/DownloadMapsWithMeDialog.java21
-rw-r--r--api/android/lib/src/com/mapswithme/maps/api/MWMPoint.java40
-rw-r--r--api/android/lib/src/com/mapswithme/maps/api/MWMResponse.java37
-rw-r--r--api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java27
6 files changed, 169 insertions, 12 deletions
diff --git a/api/android/lib/res/layout/dlg_install_mwm.xml b/api/android/lib/res/layout/dlg_install_mwm.xml
index 1dc8905d2e..ee3843d177 100644
--- a/api/android/lib/res/layout/dlg_install_mwm.xml
+++ b/api/android/lib/res/layout/dlg_install_mwm.xml
@@ -1,5 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2013, MapsWithMe GmbH All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. Redistributions in binary form must
+reproduce the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
@@ -34,7 +57,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_mid"
- android:src="@drawable/logo" />
+ android:src="@drawable/logo"
+ tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/download"
@@ -44,7 +68,9 @@
android:layout_marginTop="@dimen/margin_mid"
android:background="@null"
android:scaleType="centerInside"
- android:src="@drawable/download_btn_selector"/>
+ android:src="@drawable/download_btn_selector"
+ tools:ignore="ContentDescription" />
+
</LinearLayout>
-</ScrollView>
+</ScrollView> \ No newline at end of file
diff --git a/api/android/lib/src/com/mapswithme/maps/api/Const.java b/api/android/lib/src/com/mapswithme/maps/api/Const.java
index 768a2dcb8d..22b3cb733c 100644
--- a/api/android/lib/src/com/mapswithme/maps/api/Const.java
+++ b/api/android/lib/src/com/mapswithme/maps/api/Const.java
@@ -1,9 +1,29 @@
+/*Copyright (c) 2013, MapsWithMe GmbH All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. Redistributions in binary form must
+reproduce the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.*/
package com.mapswithme.maps.api;
public class Const
{
-
+
/* Request extras */
static final String AUTHORITY = "com.mapswithme.maps.api";
public static final String EXTRA_URL = AUTHORITY + ".url";
@@ -22,9 +42,9 @@ public class Const
public static final String EXTRA_MWM_RESPONSE_POINT_ID = AUTHORITY + ".point_id";
+ public static final String ACTION_MWM_REQUEST = AUTHORITY + ".request";
static final int API_VERSION = 1;
static final String CALLBACK_PREFIX = "mapswithme.client.";
- public static final String ACTION_MWM_REQUEST = AUTHORITY + ".request";
private Const() {}
}
diff --git a/api/android/lib/src/com/mapswithme/maps/api/DownloadMapsWithMeDialog.java b/api/android/lib/src/com/mapswithme/maps/api/DownloadMapsWithMeDialog.java
index 78cd24fbcc..73e67b4ec0 100644
--- a/api/android/lib/src/com/mapswithme/maps/api/DownloadMapsWithMeDialog.java
+++ b/api/android/lib/src/com/mapswithme/maps/api/DownloadMapsWithMeDialog.java
@@ -1,3 +1,24 @@
+/*Copyright (c) 2013, MapsWithMe GmbH All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. Redistributions in binary form must
+reproduce the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.*/
+
package com.mapswithme.maps.api;
import android.app.Dialog;
diff --git a/api/android/lib/src/com/mapswithme/maps/api/MWMPoint.java b/api/android/lib/src/com/mapswithme/maps/api/MWMPoint.java
index 2920ee943d..1060fd8223 100644
--- a/api/android/lib/src/com/mapswithme/maps/api/MWMPoint.java
+++ b/api/android/lib/src/com/mapswithme/maps/api/MWMPoint.java
@@ -1,8 +1,33 @@
+/*Copyright (c) 2013, MapsWithMe GmbH All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. Redistributions in binary form must
+reproduce the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.*/
+
package com.mapswithme.maps.api;
import java.io.Serializable;
-// TODO add javadoc for public interface
+/**
+ * POI wrapper object.
+ * Has it's <code>equals()</code> and <code>hashCode()</code> methods overloaded
+ * so could be used in Hash(Map/Set/etc) classes.
+ */
public final class MWMPoint implements Serializable
{
private static final long serialVersionUID = 1L;
@@ -30,12 +55,17 @@ public final class MWMPoint implements Serializable
public String getName() { return mName; }
public String getId() { return mId; }
+ /**
+ * Sets string ID for this point. Internally it is not used to distinguish point,
+ * it's purpose to help clients code to associate point with domain objects of their application.
+ * @param id
+ */
public void setId(String id) { mId = id; }
@Override
public String toString()
{
- return "MWMPoint [mLat=" + mLat + ", mLon=" + mLon + ", mName=" + mName + ", mId=" + mId + "]";
+ return "MWMPoint [lat=" + mLat + ", lon=" + mLon + ", name=" + mName + ", id=" + mId + "]";
}
@Override
@@ -52,6 +82,10 @@ public final class MWMPoint implements Serializable
return result;
}
+ /**
+ * Two point are considered
+ * equal if they have they lat, lon, and name attributes equal.
+ */
@Override
public boolean equals(Object obj)
{
@@ -66,7 +100,7 @@ public final class MWMPoint implements Serializable
return false;
if (Double.doubleToLongBits(mLon) != Double.doubleToLongBits(other.mLon))
return false;
-
+
return mName == null ? other.mName == null : mName.equals(other.mName);
}
}
diff --git a/api/android/lib/src/com/mapswithme/maps/api/MWMResponse.java b/api/android/lib/src/com/mapswithme/maps/api/MWMResponse.java
index dee1707f73..828cff512c 100644
--- a/api/android/lib/src/com/mapswithme/maps/api/MWMResponse.java
+++ b/api/android/lib/src/com/mapswithme/maps/api/MWMResponse.java
@@ -1,22 +1,53 @@
+/*Copyright (c) 2013, MapsWithMe GmbH All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. Redistributions in binary form must
+reproduce the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.*/
+
package com.mapswithme.maps.api;
import android.content.Context;
import android.content.Intent;
-// TODO add javadoc for public interface
public class MWMResponse
{
private MWMPoint mPoint;
+ /**
+ *
+ * @return point, for which user requested more information in MapsWithMe application.
+ */
public MWMPoint getPoint() { return mPoint; }
public boolean hasPoint() { return mPoint != null; }
@Override
public String toString()
{
- return "MWMResponse [mSelectedPoint=" + mPoint + "]";
+ return "MWMResponse [SelectedPoint=" + mPoint + "]";
}
+ /**
+ * Factory method to extract response data from intent.
+ *
+ * @param context
+ * @param intent
+ * @return
+ */
public static MWMResponse extractFromIntent(Context context, Intent intent)
{
final MWMResponse response = new MWMResponse();
@@ -27,7 +58,7 @@ public class MWMResponse
final String name = intent.getStringExtra(Const.EXTRA_MWM_RESPONSE_POINT_NAME);
final String id = intent.getStringExtra(Const.EXTRA_MWM_RESPONSE_POINT_ID);
response.mPoint = new MWMPoint(lat, lon, name, id);
-
+
return response;
}
diff --git a/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java b/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java
index 8f379f3ad2..ca66285cf8 100644
--- a/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java
+++ b/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java
@@ -1,3 +1,23 @@
+/*Copyright (c) 2013, MapsWithMe GmbH All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. Redistributions in binary form must
+reproduce the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with the
+distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.*/
package com.mapswithme.maps.api;
@@ -11,11 +31,16 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.net.Uri;
-//TODO add javadoc for public interface
public final class MapsWithMeApi
{
+ /**
+ * Most detailed level, buildings and trees are seen.
+ */
public static final double ZOOM_MIN = 1;
+ /**
+ * Least detailed level, continents are seen.
+ */
public static final double ZOOM_MAX = 19;
/**