public class ActivityResourceFinder extends java.lang.Object implements ResourceFinder
ResourceFinder implementation for Activity.| Constructor and Description |
|---|
ActivityResourceFinder(android.app.Activity activity) |
| Modifier and Type | Method and Description |
|---|---|
android.view.View |
findViewById(int resId)
Finds a child view with the given identifier.
|
android.content.Context |
getContext()
Retrieve the Context that the prompt is running in.
|
android.graphics.drawable.Drawable |
getDrawable(int resId)
Returns a drawable object associated with a particular resource ID and
styled for the current theme.
|
android.view.ViewGroup |
getPromptParentView()
Get the view to add the prompt to.
|
android.content.res.Resources |
getResources()
Returns a Resources instance for the application's package.
|
java.lang.String |
getString(int resId)
Returns a localized string from the application's package's
default string table.
|
android.content.res.Resources.Theme |
getTheme()
Return the Theme object associated with
ResourceFinder.getContext(). |
android.content.res.TypedArray |
obtainStyledAttributes(int resId,
int[] attrs)
Retrieve styled attribute information in
ResourceFinder.getContext() theme. |
public ActivityResourceFinder(@NonNull
android.app.Activity activity)
@Nullable
public android.view.View findViewById(@IdRes
int resId)
ResourceFinderfindViewById in interface ResourceFinderresId - the identifier of the view to find@NonNull public android.view.ViewGroup getPromptParentView()
ResourceFindergetPromptParentView in interface ResourceFinder@NonNull public android.content.Context getContext()
ResourceFindergetContext in interface ResourceFinder@NonNull public android.content.res.Resources getResources()
ResourceFindergetResources in interface ResourceFinder@NonNull public android.content.res.Resources.Theme getTheme()
ResourceFinderResourceFinder.getContext().getTheme in interface ResourceFinder@NonNull
public java.lang.String getString(@StringRes
int resId)
ResourceFindergetString in interface ResourceFinderresId - Resource id for the string@NonNull
public android.content.res.TypedArray obtainStyledAttributes(@StyleRes
int resId,
@StyleableRes
int[] attrs)
ResourceFinderResourceFinder.getContext() theme. See
Resources.Theme.obtainStyledAttributes(int, int[])
for more information.obtainStyledAttributes in interface ResourceFinderResources.Theme.obtainStyledAttributes(int, int[])@Nullable
public android.graphics.drawable.Drawable getDrawable(@DrawableRes
int resId)
ResourceFindergetDrawable in interface ResourceFinderresId - The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.null if the resource could not be resolved.