diff --git a/generate-pngs.sh b/generate-pngs.sh index f974056e..e0036e72 100755 --- a/generate-pngs.sh +++ b/generate-pngs.sh @@ -4,14 +4,19 @@ # For each SVG in orig/, PNGs will be created in the drawable directories # for each DPI with the same name as the SVG. If the PNGs already exist # and are newer than the SVG, they will not be recreated. +# +# Requires: +# - inkscape +# - imagemagick +# - optipng gen() { name=`basename "$1" .svgz` png="res/drawable-$2/$name.png" if [ "$1" -nt "$png" -o ! -e "$png" ]; then inkscape --without-gui --export-area-page --export-dpi=$3 --export-png="$png" $1 - convert -strip "$png" "$png" - optipng -quiet -o7 "$png" + convert -strip "$png" "$png" # strip comments and other metadata + optipng -quiet -o7 "$png" # shrink PNG echo fi } diff --git a/orig/arrow.svgz b/orig/arrow.svgz new file mode 100644 index 00000000..c92d7f7b Binary files /dev/null and b/orig/arrow.svgz differ diff --git a/res/drawable-hdpi/arrow.png b/res/drawable-hdpi/arrow.png new file mode 100644 index 00000000..6756b0ac Binary files /dev/null and b/res/drawable-hdpi/arrow.png differ diff --git a/res/drawable-hdpi/expander_arrow.9.png b/res/drawable-hdpi/expander_arrow.9.png deleted file mode 100644 index 71692f88..00000000 Binary files a/res/drawable-hdpi/expander_arrow.9.png and /dev/null differ diff --git a/res/drawable-mdpi/arrow.png b/res/drawable-mdpi/arrow.png new file mode 100644 index 00000000..3b5e0825 Binary files /dev/null and b/res/drawable-mdpi/arrow.png differ diff --git a/res/drawable-mdpi/expander_arrow.9.png b/res/drawable-mdpi/expander_arrow.9.png deleted file mode 100644 index 19785962..00000000 Binary files a/res/drawable-mdpi/expander_arrow.9.png and /dev/null differ diff --git a/res/drawable-xhdpi/arrow.png b/res/drawable-xhdpi/arrow.png new file mode 100644 index 00000000..d1c1bd4c Binary files /dev/null and b/res/drawable-xhdpi/arrow.png differ diff --git a/src/org/kreed/vanilla/MediaView.java b/src/org/kreed/vanilla/MediaView.java index c4c8aa01..c7128955 100644 --- a/src/org/kreed/vanilla/MediaView.java +++ b/src/org/kreed/vanilla/MediaView.java @@ -30,8 +30,6 @@ import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.graphics.RadialGradient; -import android.graphics.Shader; import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; @@ -55,10 +53,6 @@ public final class MediaView extends View { * The paint object, cached for reuse. */ private static Paint sPaint; - /** - * The cached divider gradient that separates each view from other views. - */ - private static RadialGradient sDividerGradient; /** * The text size used for the text in all views. */ @@ -67,9 +61,8 @@ public final class MediaView extends View { public static void init(Context context) { Resources res = context.getResources(); - sExpander = BitmapFactory.decodeResource(res, R.drawable.expander_arrow); + sExpander = BitmapFactory.decodeResource(res, R.drawable.arrow); sTextSize = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 14, res.getDisplayMetrics()); - sDividerGradient = null; sPaint = new Paint(); sPaint.setTextSize(sTextSize); @@ -212,11 +205,7 @@ public final class MediaView extends View { canvas.restore(); width = getWidth(); - - if (sDividerGradient == null) - sDividerGradient = new RadialGradient(width / 2, 1, width / 2, Color.WHITE, Color.TRANSPARENT, Shader.TileMode.CLAMP); - - paint.setShader(sDividerGradient); + paint.setColor(Color.GRAY); canvas.drawLine(0, height - 1, width, height - 1, paint); paint.setShader(null); }