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

Commit 260beafc authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Add color parsing method.

Bug: 181110703
Test: manual
Change-Id: I5ffecf861d4b2c7be0949780c6d0faf486a7daab
parent 578444e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ android_app {
    optimize: {
        enabled: false,
    },

    kotlincflags: ["-Xjvm-default=enable"],
    certificate: "",

    privileged: true,
+9 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Log;

import androidx.annotation.ColorInt;

public abstract class ResourcesApkProvider {
    private static final String TAG = "ResourcesApkProvider";

@@ -55,6 +57,13 @@ public abstract class ResourcesApkProvider {
        return mStubApkResources.getDrawable(resourceId, null);
    }

    @ColorInt
    protected int getItemColorFromStub(String prefix, String itemName) {
        int resourceId = mStubApkResources.getIdentifier(String.format("%s%s", prefix, itemName),
                "color", mStubPackageName);
        return mStubApkResources.getColor(resourceId, null);
    }

    public boolean isAvailable() {
        return mStubApkResources != null;
    }