Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c53a696 authored by Amit Kumar's avatar Amit Kumar
Browse files

Add rounded overlay in timeline images

Change-Id: I1240e09a9c2e6873732bbfe6fb81fcbaebe1fb38
parent e132f204
Loading
Loading
Loading
Loading
+307 B
Loading image diff...
+414 B
Loading image diff...
+621 B
Loading image diff...
+2 −1
Original line number Original line Diff line number Diff line
@@ -190,7 +190,7 @@ class NinePatchInstance {


    // We need 22 indices for a normal nine-patch image, plus 2 for each
    // We need 22 indices for a normal nine-patch image, plus 2 for each
    // transparent region. Current there are at most 1 transparent region.
    // transparent region. Current there are at most 1 transparent region.
    private static final int INDEX_BUFFER_SIZE = 22 + 2;
    private static final int INDEX_BUFFER_SIZE = 22 + 10;


    private FloatBuffer mXyBuffer;
    private FloatBuffer mXyBuffer;
    private FloatBuffer mUvBuffer;
    private FloatBuffer mUvBuffer;
@@ -368,6 +368,7 @@ class NinePatchInstance {
                    int colorIdx = row * (nx - 1) + col;
                    int colorIdx = row * (nx - 1) + col;
                    if (isForward) colorIdx--;
                    if (isForward) colorIdx--;
                    if (color[colorIdx] == NinePatchChunk.TRANSPARENT_COLOR) {
                    if (color[colorIdx] == NinePatchChunk.TRANSPARENT_COLOR) {

                        index[idxCount] = index[idxCount - 1];
                        index[idxCount] = index[idxCount - 1];
                        ++idxCount;
                        ++idxCount;
                        index[idxCount++] = (byte) k;
                        index[idxCount++] = (byte) k;
+9 −1
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ public abstract class AbstractSlotRenderer implements SlotView.SlotRenderer {
    private final NinePatchTexture mFrameSelected;
    private final NinePatchTexture mFrameSelected;
    private final ResourceTexture mDrmIcon;
    private final ResourceTexture mDrmIcon;
    private final ResourceTexture mSelectionIcon;
    private final ResourceTexture mSelectionIcon;
    private final NinePatchTexture mRoundedOverlay;
    private FadeOutTexture mFramePressedUp;
    private FadeOutTexture mFramePressedUp;


    protected AbstractSlotRenderer(Context context) {
    protected AbstractSlotRenderer(Context context) {
@@ -46,6 +47,7 @@ public abstract class AbstractSlotRenderer implements SlotView.SlotRenderer {
        mFrameSelected = new NinePatchTexture(context, R.drawable.grid_selected);
        mFrameSelected = new NinePatchTexture(context, R.drawable.grid_selected);
        mDrmIcon = new ResourceTexture(context, R.drawable.drm_image);
        mDrmIcon = new ResourceTexture(context, R.drawable.drm_image);
        mSelectionIcon = new ResourceTexture(context, R.drawable.multiselect);
        mSelectionIcon = new ResourceTexture(context, R.drawable.multiselect);
        mRoundedOverlay = new NinePatchTexture(context, R.drawable.rounded_overlay);
    }
    }


    protected void drawContent(GLCanvas canvas,
    protected void drawContent(GLCanvas canvas,
@@ -127,7 +129,13 @@ public abstract class AbstractSlotRenderer implements SlotView.SlotRenderer {
    }
    }


    protected void drawPressedFrame(GLCanvas canvas, int width, int height) {
    protected void drawPressedFrame(GLCanvas canvas, int width, int height) {
        drawFrame(canvas, mFramePressed.getPaddings(), mFramePressed, 0, 0, width, height);
        drawFrame(canvas, mFrameSelected.getPaddings(), mFrameSelected, 0, 0, width, height);
    }

    protected void drawRoundedOverlay(GLCanvas canvas, int width, int height) {
        Rect padding = mRoundedOverlay.getPaddings();
        mRoundedOverlay.draw(canvas, 0 - padding.left, 0 - padding.top, width + padding.left + padding.right,
                 height + padding.top + padding.bottom);
    }
    }


    protected void drawSelectedFrame(GLCanvas canvas, int width, int height) {
    protected void drawSelectedFrame(GLCanvas canvas, int width, int height) {
Loading