Skip to content

Commit

Permalink
Merge branch 'master' of github.com:donnfelker/android-bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
donnfelker committed May 13, 2013
2 parents e82a0fb + af6c978 commit 98f5013
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.donnfelker.android.bootstrap.core.Constants;

class BootstrapAccountAuthenticator extends AbstractAccountAuthenticator {
Expand Down Expand Up @@ -73,7 +71,7 @@ public Bundle editProperties(AccountAuthenticatorResponse response, String accou
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType,
Bundle options) throws NetworkErrorException {

Log.d("AccountAuthenticator", "Attempting to get authToken");
Ln.d("Attempting to get authToken");

String authToken = AccountManager.get(context).peekAuthToken(account, authTokenType);
Bundle bundle = new Bundle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public Boolean call() throws Exception {
.header(HEADER_PARSE_REST_API_KEY, PARSE_REST_API_KEY);


Log.d("Auth", "response=" + request.code());
Ln.d("Authentication response=%s", request.code());

if(request.ok()) {
final User model = new Gson().fromJson(Strings.toString(request.buffer()), User.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import android.accounts.AccountManager;
import android.accounts.AccountManagerFuture;
import android.content.Context;
import android.util.Log;

import com.donnfelker.android.bootstrap.core.Constants;
import com.donnfelker.android.bootstrap.util.Ln;
import com.donnfelker.android.bootstrap.util.SafeAsyncTask;

import javax.inject.Inject;
Expand Down Expand Up @@ -62,15 +61,15 @@ public Boolean call() throws Exception {
protected void onSuccess(Boolean accountWasRemoved) throws Exception {
super.onSuccess(accountWasRemoved);

Log.d("LOGOUT_SERVICE", "Logout succeeded:" + accountWasRemoved);
Ln.d("Logout succeeded: %s", accountWasRemoved);
onSuccess.run();

}

@Override
protected void onException(Exception e) throws RuntimeException {
super.onException(e);
Log.e("LOGOUT_SERVICE", "Logout failed.", e.getCause());
Ln.e(e.getCause(), "Logout failed.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Log;
import android.widget.ImageView;

import com.actionbarsherlock.app.ActionBar;
import com.donnfelker.android.bootstrap.R;
import com.donnfelker.android.bootstrap.util.Ln;
import com.donnfelker.android.bootstrap.util.SafeAsyncTask;
import com.github.kevinsawicki.http.HttpRequest;
import javax.inject.Inject;
Expand All @@ -33,8 +32,6 @@
*/
public class AvatarLoader {

private static final String TAG = "AvatarLoader";

private static final float CORNER_RADIUS_IN_DIP = 3;

private static final int CACHE_SIZE = 75;
Expand All @@ -51,7 +48,7 @@ private FetchAvatarTask(Context context) {

@Override
protected void onException(Exception e) throws RuntimeException {
Log.d(TAG, "Avatar load failed", e);
Ln.d(e, "Avatar load failed");
}
}

Expand Down Expand Up @@ -189,7 +186,7 @@ protected BitmapDrawable fetchAvatar(final String url, final String userId) {
else
return null;
} catch (IOException e) {
Log.d(TAG, "Exception writing rounded avatar", e);
Ln.d(e, "Exception writing rounded avatar");
return null;
} finally {
if (output != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import android.graphics.Point;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.util.Log;
import android.widget.ImageView;
import com.donnfelker.android.bootstrap.util.Ln;

import java.io.File;
import java.io.IOException;
Expand All @@ -24,8 +24,6 @@
*/
public class ImageUtils {

private static final String TAG = "ImageUtils";

/**
* Get a bitmap from the image path
*
Expand Down Expand Up @@ -54,14 +52,14 @@ public static Bitmap getBitmap(final String imagePath, int sampleSize) {
return BitmapFactory.decodeFileDescriptor(file.getFD(), null,
options);
} catch (IOException e) {
Log.d(TAG, e.getMessage(), e);
Ln.d(e, "Could not get cached bitmap.");
return null;
} finally {
if (file != null)
try {
file.close();
} catch (IOException e) {
Log.d(TAG, e.getMessage(), e);
Ln.d(e, "Could not get cached bitmap.");
}
}
}
Expand All @@ -82,14 +80,14 @@ public static Point getSize(final String imagePath) {
BitmapFactory.decodeFileDescriptor(file.getFD(), null, options);
return new Point(options.outWidth, options.outHeight);
} catch (IOException e) {
Log.d(TAG, e.getMessage(), e);
Ln.d(e, "Could not get size.");
return null;
} finally {
if (file != null)
try {
file.close();
} catch (IOException e) {
Log.d(TAG, e.getMessage(), e);
Ln.d(e, "Could not get size.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.*;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

/**
* Originally from RoboGuice: https://github.com/roboguice/roboguice/blob/master/roboguice/src/main/java/roboguice/util/SafeAsyncTask.java
Expand Down Expand Up @@ -143,7 +146,7 @@ protected void onException( Exception e ) throws RuntimeException {
}

protected void onThrowable( Throwable t ) throws RuntimeException {
Log.e("roboguice", "Throwable caught during background processing", t);
Ln.e(t, "Throwable caught during background processing");
}

/**
Expand Down

0 comments on commit 98f5013

Please sign in to comment.