Skip to content

Commit

Permalink
Merge branch 'develop' into feature/site-settings-review
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyr59h committed Dec 7, 2015
2 parents ad9ee4e + 0504208 commit 650e224
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions WordPressUtils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.android.tools.build:gradle:1.5.0'
}
}

Expand All @@ -20,7 +20,7 @@ dependencies {
exclude group: 'commons-logging'
}
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.android.support:support-v13:23.0.1'
compile 'com.android.support:support-v13:23.1.1'
}

android {
Expand All @@ -29,7 +29,7 @@ android {
publishNonDefault true

compileSdkVersion 23
buildToolsVersion '23.0.1'
buildToolsVersion "23.0.2"

defaultConfig {
versionName "1.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static boolean isVideo(String url) {
}
return url.endsWith(".ogv") || url.endsWith(".mp4") || url.endsWith(".m4v") || url.endsWith(".mov") ||
url.endsWith(".wmv") || url.endsWith(".avi") || url.endsWith(".mpg") || url.endsWith(".3gp") ||
url.endsWith(".3g2");
url.endsWith(".3g2") || url.contains("video");
}

public static boolean isAudio(String url) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public static boolean dropAllTables(SQLiteDatabase db) throws SQLiteException {
return true;
} finally {
db.endTransaction();
closeCursor(cursor);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//This Handy-Dandy class acquired and tweaked from http://stackoverflow.com/a/3145655/309558
package org.wordpress.android.util.helpers;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
Expand All @@ -18,9 +19,8 @@ public class LocationHelper {
boolean mGpsEnabled = false;
boolean mNetworkEnabled = false;

@SuppressLint("MissingPermission")
public boolean getLocation(Activity activity, LocationResult result) {


mLocationResult = result;
if (mLocationManager == null) {
mLocationManager = (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
Expand Down Expand Up @@ -55,6 +55,7 @@ public boolean getLocation(Activity activity, LocationResult result) {
}

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

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

class GetLastLocation extends TimerTask {
@Override
@SuppressLint("MissingPermission")
public void run() {
mLocationManager.removeUpdates(locationListenerGps);
mLocationManager.removeUpdates(locationListenerNetwork);
Expand Down Expand Up @@ -130,6 +133,7 @@ public static abstract class LocationResult {
public abstract void gotLocation(Location location);
}

@SuppressLint("MissingPermission")
public void cancelTimer() {
if (mTimer != null) {
mTimer.cancel();
Expand Down

0 comments on commit 650e224

Please sign in to comment.