diff --git a/library/Common/src/main/java/cn/qqtheme/framework/util/CompatUtils.java b/library/Common/src/main/java/cn/qqtheme/framework/util/CompatUtils.java index 9a2a5f0d..828e375e 100755 --- a/library/Common/src/main/java/cn/qqtheme/framework/util/CompatUtils.java +++ b/library/Common/src/main/java/cn/qqtheme/framework/util/CompatUtils.java @@ -4,13 +4,8 @@ import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Build; -import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; import android.support.annotation.DrawableRes; -import android.support.annotation.StringRes; -import android.support.annotation.StyleRes; import android.view.View; -import android.widget.TextView; /** * 兼容旧版&新版 @@ -30,16 +25,6 @@ public static void setBackground(View view, Drawable drawable) { } } - @TargetApi(Build.VERSION_CODES.M) - public static void setTextAppearance(TextView view, @StyleRes int appearanceRes) { - if (Build.VERSION.SDK_INT < 23) { - //noinspection deprecation - view.setTextAppearance(view.getContext(), appearanceRes); - } else { - view.setTextAppearance(appearanceRes); - } - } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) public static Drawable getDrawable(Context context, @DrawableRes int drawableRes) { if (Build.VERSION.SDK_INT < 21) { @@ -50,25 +35,4 @@ public static Drawable getDrawable(Context context, @DrawableRes int drawableRes } } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public static String getString(Context context, @StringRes int stringRes) { - if (Build.VERSION.SDK_INT < 21) { - //noinspection deprecation - return context.getResources().getString(stringRes); - } else { - return context.getString(stringRes); - } - } - - @TargetApi(Build.VERSION_CODES.M) - @ColorInt - public static int getColor(Context context, @ColorRes int colorRes) { - if (Build.VERSION.SDK_INT < 23) { - //noinspection deprecation - return context.getResources().getColor(colorRes); - } else { - return context.getResources().getColor(colorRes, null); - } - } - }