Tag color fix

This commit is contained in:
tarsin committed 2022-05-26 23:00:45 +08:00
1 parent 2f3f3d6480
commit a92fa304f1
2 files changed
+14 -2

No files matched your search

@@ -18,7 +18,11 @@ package com.hippo.ehviewer.ui;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.content.res.TypedArray;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.core.content.ContextCompat;
import com.hippo.app.ListCheckBoxDialogBuilder;
@@ -267,4 +271,12 @@ public final class CommonOperations {
delegate.onCancel();
}
}
public static @ColorInt
int resolveColor(Resources.Theme theme, @AttrRes int attrId) {
TypedArray a = theme.obtainStyledAttributes(new int[]{attrId});
int res = a.getColor(0, 0);
a.recycle();
return res;
}
}