Skip to content

Commit 4171cfd

Browse files
committed
Merge branch 'develop' into feature/visual-editor
Conflicts: WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java
2 parents cf71309 + 19786e0 commit 4171cfd

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

WordPressUtils/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
jcenter()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:1.3.1'
6+
classpath 'com.android.tools.build:gradle:1.5.0'
77
}
88
}
99

@@ -20,7 +20,7 @@ dependencies {
2020
exclude group: 'commons-logging'
2121
}
2222
compile 'com.mcxiaoke.volley:library:1.0.18'
23-
compile 'com.android.support:support-v13:23.0.1'
23+
compile 'com.android.support:support-v13:23.1.1'
2424
}
2525

2626
android {
@@ -29,7 +29,7 @@ android {
2929
publishNonDefault true
3030

3131
compileSdkVersion 23
32-
buildToolsVersion '23.0.1'
32+
buildToolsVersion "23.0.2"
3333

3434
defaultConfig {
3535
versionName "1.5.0"

WordPressUtils/src/main/java/org/wordpress/android/util/JSONUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public static <U> U queryJSON(JSONObject source, String query, U defaultObject)
4444
if (result.getClass().isAssignableFrom(defaultObject.getClass())) {
4545
return (U) result;
4646
} else {
47+
AppLog.w(T.UTILS, String.format("The returned object type %s is not assignable to the type %s. Using default!",
48+
result.getClass(),defaultObject.getClass()));
4749
return defaultObject;
4850
}
4951
} catch (java.lang.ClassCastException e) {

WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q
8888
return imageUrl + query;
8989
}
9090

91+
// use wordpress.com as the host if image is on wordpress.com since it supports the same
92+
// query params and, more importantly, can handle images in private blogs
93+
if (imageUrl.contains("wordpress.com")) {
94+
return imageUrl + query;
95+
}
96+
9197
// must use https for https image urls
9298
if (UrlUtils.isHttps(imageUrl)) {
9399
return "https://i0.wp.com/" + imageUrl.substring(schemePos+3, imageUrl.length()) + query;

WordPressUtils/src/main/java/org/wordpress/android/util/helpers/LocationHelper.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//This Handy-Dandy class acquired and tweaked from http://stackoverflow.com/a/3145655/309558
22
package org.wordpress.android.util.helpers;
33

4+
import android.annotation.SuppressLint;
45
import android.app.Activity;
56
import android.content.Context;
67
import android.location.Location;
@@ -18,9 +19,8 @@ public class LocationHelper {
1819
boolean mGpsEnabled = false;
1920
boolean mNetworkEnabled = false;
2021

22+
@SuppressLint("MissingPermission")
2123
public boolean getLocation(Activity activity, LocationResult result) {
22-
23-
2424
mLocationResult = result;
2525
if (mLocationManager == null) {
2626
mLocationManager = (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
@@ -55,6 +55,7 @@ public boolean getLocation(Activity activity, LocationResult result) {
5555
}
5656

5757
LocationListener locationListenerGps = new LocationListener() {
58+
@SuppressLint("MissingPermission")
5859
public void onLocationChanged(Location location) {
5960
mTimer.cancel();
6061
mLocationResult.gotLocation(location);
@@ -73,6 +74,7 @@ public void onStatusChanged(String provider, int status, Bundle extras) {
7374
};
7475

7576
LocationListener locationListenerNetwork = new LocationListener() {
77+
@SuppressLint("MissingPermission")
7678
public void onLocationChanged(Location location) {
7779
mTimer.cancel();
7880
mLocationResult.gotLocation(location);
@@ -92,6 +94,7 @@ public void onStatusChanged(String provider, int status, Bundle extras) {
9294

9395
class GetLastLocation extends TimerTask {
9496
@Override
97+
@SuppressLint("MissingPermission")
9598
public void run() {
9699
mLocationManager.removeUpdates(locationListenerGps);
97100
mLocationManager.removeUpdates(locationListenerNetwork);
@@ -130,6 +133,7 @@ public static abstract class LocationResult {
130133
public abstract void gotLocation(Location location);
131134
}
132135

136+
@SuppressLint("MissingPermission")
133137
public void cancelTimer() {
134138
if (mTimer != null) {
135139
mTimer.cancel();

0 commit comments

Comments
 (0)