Skip to content

Commit

Permalink
fix some waringing
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgroot committed Mar 6, 2017
1 parent 5658e8c commit a2f57f2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
package nl.sogeti.android.gpstracker.ng.trackedit

import android.net.Uri
import android.support.v7.content.res.AppCompatResources
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -61,6 +62,7 @@ class TrackEditPresenter(val model: TrackEditModel, val listener: TrackEditModel
val trackType = model.trackTypes[position]
viewHolder.textView.text = context?.getString(trackType.stringId)
viewHolder.imageView.setImageDrawable(context?.getDrawable(trackType.drawableId))
context?.let { viewHolder.imageView.setImageDrawable(AppCompatResources.getDrawable(it, trackType.drawableId)) }

return itemView
}
Expand Down
2 changes: 1 addition & 1 deletion studio/integration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {

defaultConfig {
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
*/
public class ServiceManager implements ServiceManagerInterface {

private static final String REMOTE_EXCEPTION = "REMOTE_EXCEPTION";
private final Object mStartLock = new Object();
private IGPSLoggerServiceRemote mGPSLoggerRemote;
private boolean mBound;
Expand Down Expand Up @@ -89,13 +88,13 @@ public void startGPSLogging(Context context, int precision, int customInterval,
startGPSLogging(context, trackName);
}

public void pauseGPSLogging(Context context) {
public void pauseGPSLogging(Context context) {
Intent intent = createServiceIntent();
intent.putExtra(ServiceConstants.Commands.COMMAND, ServiceConstants.Commands.EXTRA_COMMAND_PAUSE);
context.startService(intent);
}

public void resumeGPSLogging(Context context) {
public void resumeGPSLogging(Context context) {
Intent intent = createServiceIntent();
intent.putExtra(ServiceConstants.Commands.COMMAND, ServiceConstants.Commands.EXTRA_COMMAND_RESUME);
context.startService(intent);
Expand All @@ -119,7 +118,7 @@ public void setLoggingPrecision(Context context, int mode) {
context.startService(intent);
}

public void setCustomLoggingPrecision(Context context, long seconds, float meters) {
public void setCustomLoggingPrecision(Context context, long seconds, float meters) {
Intent intent = createServiceIntent();
intent.putExtra(ServiceConstants.Commands.CONFIG_INTERVAL_TIME, seconds);
intent.putExtra(ServiceConstants.Commands.CONFIG_INTERVAL_DISTANCE, meters);
Expand Down Expand Up @@ -166,7 +165,7 @@ public Location getLastWaypoint() {
Timber.w("Remote interface to logging service not found. Started: " + mBound);
}
} catch (RemoteException e) {
Timber.e("Could get lastWaypoint GPSLoggerService.", e);
Timber.e(e, "Could get lastWaypoint GPSLoggerService.");
}
return lastWaypoint;
}
Expand All @@ -182,7 +181,7 @@ public float getTrackedDistance() {
Timber.w("Remote interface to logging service not found. Started: " + mBound);
}
} catch (RemoteException e) {
Timber.e("Could get tracked distance from GPSLoggerService.", e);
Timber.e(e, "Could get tracked distance from GPSLoggerService.");
}
return distance;
}
Expand All @@ -198,7 +197,7 @@ public long getTrackId() {
Timber.w("Remote interface to logging service not found. Started: " + mBound);
}
} catch (RemoteException e) {
Timber.e("Could stat GPSLoggerService.", e);
Timber.e(e, "Could stat GPSLoggerService.");
}
return trackId;
}
Expand All @@ -215,7 +214,7 @@ public int getLoggingState() {
Timber.w("Remote interface to logging service not found. Started: " + mBound);
}
} catch (RemoteException e) {
Timber.e("Could stat GPSLoggerService.", e);
Timber.e(e, "Could stat GPSLoggerService.");
}
return logging;
}
Expand All @@ -231,7 +230,7 @@ public boolean isMediaPrepared() {
Timber.w("Remote interface to logging service not found. Started: " + mBound);
}
} catch (RemoteException e) {
Timber.e("Could stat GPSLoggerService.", e);
Timber.e(e, "Could stat GPSLoggerService.");
}
return prepared;
}
Expand All @@ -243,7 +242,7 @@ public void storeMetaData(String key, String value) {
try {
this.mGPSLoggerRemote.storeMetaData(key, value);
} catch (RemoteException e) {
Timber.e(ServiceManager.REMOTE_EXCEPTION, "Could not send data source to GPSLoggerService.", e);
Timber.e(e, "Could not send data source to GPSLoggerService.");
}
} else {
Timber.e("No GPSLoggerRemote service connected to this manager");
Expand All @@ -257,7 +256,7 @@ public void storeMediaUri(Uri mediaUri) {
try {
this.mGPSLoggerRemote.storeMediaUri(mediaUri);
} catch (RemoteException e) {
Timber.e(ServiceManager.REMOTE_EXCEPTION, "Could not send media to GPSLoggerService.", e);
Timber.e(e, "Could not send media to GPSLoggerService.");
}
} else {
Timber.e("No GPSLoggerRemote service connected to this manager");
Expand Down Expand Up @@ -322,7 +321,7 @@ public void shutdown(Context context) {
mBound = false;
}
} catch (IllegalArgumentException e) {
Timber.w("Failed to unbind a service, perhaps the service disappeared?", e);
Timber.w(e, "Failed to unbind a service, perhaps the service disappeared?");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion studio/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ext {
supportLibraryVersion = '25.2.0'
kotlinVersion = '1.1.0'
wearableVersion = '1.4.0'
constraintsLibraryVersion = '1.0.0'
constraintsLibraryVersion = '1.0.1'
timberVersion = '4.1.2'
daggerVersion = '2.8'
playServicesVersion = '10.2.0'
Expand Down

0 comments on commit a2f57f2

Please sign in to comment.