jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/347976 )

Change subject: Add link to OSM License
......................................................................


Add link to OSM License

App needs to show a link to OSM copyright on the map.

Bug: T161340
Change-Id: Icf642abadcd7eb9fb627e62806b702cb1d9be614
---
M app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
M app/src/main/res/layout/fragment_nearby.xml
M app/src/main/res/values-qq/strings.xml
M app/src/main/res/values/strings.xml
4 files changed, 34 insertions(+), 6 deletions(-)

Approvals:
  Dbrant: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java 
b/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
index 01147be..415d162 100644
--- a/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
+++ b/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
@@ -12,9 +12,11 @@
 import android.support.design.widget.Snackbar;
 import android.support.v4.app.Fragment;
 import android.support.v4.content.ContextCompat;
+import android.text.method.LinkMovementMethod;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.TextView;
 import android.widget.Toast;
 
 import com.mapbox.mapboxsdk.Mapbox;
@@ -43,10 +45,12 @@
 import org.wikipedia.json.GsonMarshaller;
 import org.wikipedia.json.GsonUnmarshaller;
 import org.wikipedia.page.PageTitle;
+import org.wikipedia.richtext.RichTextUtil;
 import org.wikipedia.util.DeviceUtil;
 import org.wikipedia.util.FeedbackUtil;
 import org.wikipedia.util.PermissionUtil;
 import org.wikipedia.util.ResourceUtil;
+import org.wikipedia.util.StringUtil;
 import org.wikipedia.util.ThrowableUtil;
 import org.wikipedia.util.log.L;
 
@@ -75,6 +79,7 @@
     private static final int GO_TO_LOCATION_PERMISSION_REQUEST = 50;
 
     @BindView(R.id.mapview) MapView mapView;
+    @BindView(R.id.osm_license) TextView osmLicenseTextView;
     private Unbinder unbinder;
 
     @Nullable private MapboxMap mapboxMap;
@@ -110,6 +115,10 @@
                 .fromBitmap(ResourceUtil.bitmapFromVectorDrawable(getContext(),
                         R.drawable.ic_map_marker));
 
+        
osmLicenseTextView.setText(StringUtil.fromHtml(getString(R.string.nearby_osm_license)));
+        osmLicenseTextView.setMovementMethod(LinkMovementMethod.getInstance());
+        RichTextUtil.removeUnderlinesFromLinks(osmLicenseTextView);
+
         mapView.onCreate(savedInstanceState);
 
         setHasOptionsMenu(true);
diff --git a/app/src/main/res/layout/fragment_nearby.xml 
b/app/src/main/res/layout/fragment_nearby.xml
index 5c89586..259465b 100644
--- a/app/src/main/res/layout/fragment_nearby.xml
+++ b/app/src/main/res/layout/fragment_nearby.xml
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!-- todo: replace FrameLayout with Behavior. this is a hack to move the FAB 
up and isn't good practice -->
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android";
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android";
     xmlns:app="http://schemas.android.com/apk/res-auto";
     android:layout_width="match_parent"
     android:layout_height="match_parent">
@@ -17,16 +16,33 @@
         app:mapbox_uiLogo="false">
     </com.mapbox.mapboxsdk.maps.MapView>
 
+    <TextView
+        android:id="@+id/osm_license"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom|start"
+        android:layout_marginBottom="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:textColor="@color/base20"
+        android:textColorLink="?attr/link_color"
+        android:alpha="0.6"
+        android:shadowColor="@android:color/white"
+        android:shadowDx="2"
+        android:shadowDy="2"
+        android:shadowRadius="10"
+        android:textSize="12sp" />
+
     <android.support.design.widget.FloatingActionButton
-        style="@style/FloatingActionButton"
         android:id="@+id/user_location_button"
+        style="@style/FloatingActionButton"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="bottom|end"
-        app:srcCompat="@drawable/ic_my_location_white_24dp"
         android:contentDescription="@string/nearby_zoom_to_location"
-        app:elevation="4dp"
+        app:backgroundTint="@color/foundation_blue"
         app:borderWidth="0dp"
-        app:backgroundTint="@color/foundation_blue" />
+        app:elevation="4dp"
+        app:srcCompat="@drawable/ic_my_location_white_24dp" />
 
 </FrameLayout>
diff --git a/app/src/main/res/values-qq/strings.xml 
b/app/src/main/res/values-qq/strings.xml
index 92d644f..acc55f0 100644
--- a/app/src/main/res/values-qq/strings.xml
+++ b/app/src/main/res/values-qq/strings.xml
@@ -60,6 +60,7 @@
   <string name="nearby_distance_in_meters">Distance to the place mentioned in 
the nearby page in meters. Please leave the %d as is. It represents an integer 
decimal number up to 999.</string>
   <string name="nearby_distance_in_kilometers">Distance to the place mentioned 
in the nearby page in kilometers. Please leave the %.2f as is. It represents a 
floating point number with 2 digits after the decimal point.</string>
   <string name="nearby_zoom_to_location">Small toast (popup) message on Nearby 
screen saying that the current location of the device was not 
available.</string>
+  <string name="nearby_osm_license">Copyright message with a link to the 
OpenStreetMap Copyright and License. (Please preserve the anchor tag in its 
exact form.)</string>
   <string name="last_updated_text">Message in footer of article indicating 
when the article was last updated. \'%s\' is substituted with the appropriately 
formatted human-readable timestamp, such as \"seven days ago\".</string>
   <string name="talk_page_link_text">Link text for accessing Talk pages. Use 
the same word in your language as is done on the web site. Some use the term 
discussions.
 {{Identical|Talk}}</string>
@@ -526,4 +527,5 @@
   <string name="description_edit_revert_reason1">Reason for an edit being 
reverted, because it did not follow the guidelines for descriptions. (Please 
preserve the anchor tag in its exact form)</string>
   <string name="description_edit_revert_reason2">Reason for an edit being 
reverted, because it looks like vandalism.</string>
   <string name="description_edit_revert_history">Message that allows the user 
to go to the edit history associated with the article. (Please preserve the 
anchor tag in its exact form)</string>
+
 </resources>
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index a9662b7..10beabd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -52,6 +52,7 @@
     <string name="nearby_distance_in_meters">%d m</string>
     <string name="nearby_distance_in_kilometers">%.2f km</string>
     <string name="nearby_zoom_to_location">Zoom to a location on the 
map</string>
+    <string name="nearby_osm_license"><![CDATA[&copy; &nbsp;<a 
href=\"https://www.openstreetmap.org/copyright/\";>OpenStreetMap</a> 
contributors]]></string>
 
     <string name="last_updated_text">Last updated %s</string>
     <string name="talk_page_link_text">Talk</string>

-- 
To view, visit https://gerrit.wikimedia.org/r/347976
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf642abadcd7eb9fb627e62806b702cb1d9be614
Gerrit-PatchSet: 6
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Jcasariego <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to