Skip to content

Commit

Permalink
Fix lock icon display bug and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Jan 14, 2016
1 parent 8bfdcee commit cb4f441
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.billthefarmer.tuner"
android:versionCode="107"
android:versionName="1.07" >
android:versionCode="108"
android:versionName="1.08" >

<uses-sdk
android:minSdkVersion="11"
Expand Down
12 changes: 8 additions & 4 deletions src/org/billthefarmer/tuner/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ public Display(Context context, AttributeSet attrs)
{
super(context, attrs);

// Get lock icon

bitmap = BitmapFactory.decodeResource(resources,
android.R.drawable.ic_lock_lock);
R.drawable.ic_locked);
}

// On size changed
Expand Down Expand Up @@ -115,16 +117,18 @@ protected void onDraw(Canvas canvas)
if (audio == null)
return;

// Draw lock icon

if (audio.lock && bitmap != null)
canvas.drawBitmap(bitmap, 2, height - bitmap.getHeight() - 2, null);

// Set up paint

paint.setStrokeWidth(1);
paint.setColor(resources.getColor(android.R.color.primary_text_light));
paint.setTextAlign(Align.LEFT);
paint.setStyle(Style.FILL);

if (audio.lock)
canvas.drawBitmap(bitmap, 2, height - bitmap.getHeight() - 2, null);

// Multiple values

if (audio.multiple)
Expand Down
7 changes: 6 additions & 1 deletion src/org/billthefarmer/tuner/Meter.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public Meter(Context context, AttributeSet attrs)
// Create a matrix for scaling

matrix = new Matrix();

// Get display icon

bitmap = BitmapFactory.decodeResource(resources,
R.drawable.ic_pref_screen);
}
Expand Down Expand Up @@ -159,7 +162,9 @@ protected void onDraw(Canvas canvas)
{
super.onDraw(canvas);

if (audio != null && audio.screen)
// Draw display icon

if (audio != null && audio.screen && bitmap != null)
canvas.drawBitmap(bitmap, 2, height - bitmap.getHeight() - 2, null);

// Reset the paint to black
Expand Down

0 comments on commit cb4f441

Please sign in to comment.