mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-24 00:50:32 +00:00
Remove ThemeHelper.resolveResourceIdFromAttr
This commit is contained in:
parent
df52a6ea6b
commit
a9e8b3e06b
@ -23,7 +23,6 @@ import android.app.Activity;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
|
||||||
import androidx.annotation.AttrRes;
|
import androidx.annotation.AttrRes;
|
||||||
@ -204,20 +203,6 @@ public final class ThemeHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a resource id from a resource styled according to the context's theme.
|
|
||||||
*
|
|
||||||
* @param context Android app context
|
|
||||||
* @param attr attribute reference of the resource
|
|
||||||
* @return resource ID
|
|
||||||
*/
|
|
||||||
public static int resolveResourceIdFromAttr(final Context context, @AttrRes final int attr) {
|
|
||||||
final TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
|
|
||||||
final int attributeResourceId = a.getResourceId(0, 0);
|
|
||||||
a.recycle();
|
|
||||||
return attributeResourceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a color from an attr styled according to the context's theme.
|
* Get a color from an attr styled according to the context's theme.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user