Draw the gradient line for the list dividers too
This commit is contained in:
parent
b659888479
commit
99896331f5
@ -26,16 +26,19 @@
|
|||||||
android:id="@+id/artist_list"
|
android:id="@+id/artist_list"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:divider="@null"
|
||||||
android:fastScrollEnabled="true" />
|
android:fastScrollEnabled="true" />
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/album_list"
|
android:id="@+id/album_list"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:divider="@null"
|
||||||
android:fastScrollEnabled="true" />
|
android:fastScrollEnabled="true" />
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/song_list"
|
android:id="@+id/song_list"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:divider="@null"
|
||||||
android:fastScrollEnabled="true" />
|
android:fastScrollEnabled="true" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -212,6 +212,7 @@ public class MediaAdapter extends CursorAdapter implements FilterQueryProvider {
|
|||||||
|
|
||||||
int mViewHeight = -1;
|
int mViewHeight = -1;
|
||||||
RadialGradient mSeparatorGradient;
|
RadialGradient mSeparatorGradient;
|
||||||
|
RadialGradient mDividerGradient;
|
||||||
|
|
||||||
public class MediaView extends View {
|
public class MediaView extends View {
|
||||||
private long mId;
|
private long mId;
|
||||||
@ -276,6 +277,7 @@ public class MediaAdapter extends CursorAdapter implements FilterQueryProvider {
|
|||||||
canvas.drawBitmap(expander, width + padding * 2, (height - expander.getHeight()) / 2, paint);
|
canvas.drawBitmap(expander, width + padding * 2, (height - expander.getHeight()) / 2, paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canvas.save();
|
||||||
canvas.clipRect(padding, 0, width - padding, height);
|
canvas.clipRect(padding, 0, width - padding, height);
|
||||||
|
|
||||||
int allocatedHeight;
|
int allocatedHeight;
|
||||||
@ -291,6 +293,16 @@ public class MediaAdapter extends CursorAdapter implements FilterQueryProvider {
|
|||||||
|
|
||||||
paint.setColor(Color.WHITE);
|
paint.setColor(Color.WHITE);
|
||||||
canvas.drawText(mTitle, padding, padding + (allocatedHeight - mTextSize) / 2 - paint.ascent(), paint);
|
canvas.drawText(mTitle, padding, padding + (allocatedHeight - mTextSize) / 2 - paint.ascent(), paint);
|
||||||
|
|
||||||
|
width = getWidth();
|
||||||
|
|
||||||
|
if (mDividerGradient == null)
|
||||||
|
mDividerGradient = new RadialGradient(width / 2, height, width / 2, Color.WHITE, Color.BLACK, Shader.TileMode.CLAMP);
|
||||||
|
|
||||||
|
paint.setShader(mDividerGradient);
|
||||||
|
canvas.restore();
|
||||||
|
canvas.drawLine(0, height, width, height, paint);
|
||||||
|
paint.setShader(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getFieldCount()
|
public final int getFieldCount()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user