You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
806 B
28 lines
806 B
package com.project.survey.util;
|
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
|
import androidx.annotation.ColorRes;
|
|
import androidx.annotation.DrawableRes;
|
|
import androidx.annotation.StringRes;
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
import blankj.utilcode.util.Utils;
|
|
|
|
public class Tools {
|
|
public static int getColor(@ColorRes int color) {
|
|
return ContextCompat.getColor(Utils.getApp(), color);
|
|
}
|
|
|
|
public static Drawable getDrawable(@DrawableRes int res) {
|
|
return ContextCompat.getDrawable(Utils.getApp(), res);
|
|
}
|
|
|
|
public static String getString(@StringRes int res) {
|
|
return Utils.getApp().getString(res);
|
|
}
|
|
|
|
public static String getString(@StringRes int res, Object... formatArgs) {
|
|
return Utils.getApp().getString(res, formatArgs);
|
|
}
|
|
}
|
|
|