Skip to content

Commit

Permalink
Added padding between avatar and titles in toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
spatnjak committed Feb 28, 2016
1 parent abbd8c7 commit 33eb6b8
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -19,9 +19,11 @@
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.InsetDrawable;
import android.support.v7.app.ActionBar;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.MenuItem;
import android.widget.ImageView;

Expand Down Expand Up @@ -145,7 +147,9 @@ public BitmapDrawable call() throws Exception {

@Override
protected void onSuccess(BitmapDrawable image) throws Exception {
actionBar.setLogo(image);
// compute inset in pixels
int insetPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, context.getResources().getDisplayMetrics());
actionBar.setLogo(new InsetDrawable(image, 0, 0, insetPx, 0));
}
}.execute();
}
Expand Down

0 comments on commit 33eb6b8

Please sign in to comment.