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

Commit 37d7fc70 authored by Jason Sams's avatar Jason Sams
Browse files

Fix selection and change icon loading from 565 to 8888.

parent b0ec1b46
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -187,16 +187,16 @@ public class RolloRS {


            b = BitmapFactory.decodeResource(mRes, R.raw.browser, opts);
            mIcons[0] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
            mIcons[0] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGBA_8888, true);

            b = BitmapFactory.decodeResource(mRes, R.raw.market, opts);
            mIcons[1] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
            mIcons[1] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGBA_8888, true);

            b = BitmapFactory.decodeResource(mRes, R.raw.photos, opts);
            mIcons[2] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
            mIcons[2] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGBA_8888, true);

            b = BitmapFactory.decodeResource(mRes, R.raw.settings, opts);
            mIcons[3] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
            mIcons[3] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGBA_8888, true);

/*
            b = BitmapFactory.decodeResource(mRes, R.raw.assasins_creed, opts);
@@ -342,8 +342,8 @@ public class RolloRS {
    }

    private void makeTextBitmap() {
        //Bitmap.createBitmap(width, height, Bitmap.Config);
        //new Canvas(theBitmap);
        //Bitmap b = Bitmap.createBitmap(128, 64, Bitmap.Config);
        //Canvas c = new Canvas(b);
        //canvas.drawText();
    }

+2 −2
Original line number Diff line number Diff line
@@ -101,11 +101,11 @@ public class RolloView extends RSSurfaceView {

    void computeSelection(float x, float y)
    {
        float col = mColumn + (x - 0.5f) * 4 + 1;
        float col = mColumn + (x - 0.5f) * 4 + 1.25f;
        int iCol = (int)(col + 0.25f);

        float row = (y / 0.8f) * mRows;
        int iRow = (int)(row - 0.25f);
        int iRow = (int)(row - 0.5f);

        mRender.setSelected(iCol * mRows + iRow);
    }