Interface ResourceFinder
-
- All Known Implementing Classes:
ActivityResourceFinder,DialogResourceFinder,SupportFragmentResourceFinder
public interface ResourceFinderInterface used to find resources required byMaterialTapTargetPrompt.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description android.view.ViewfindViewById(int resId)Finds a child view with the given identifier.android.content.ContextgetContext()Retrieve the Context that the prompt is running in.android.graphics.drawable.DrawablegetDrawable(int resId)Returns a drawable object associated with a particular resource ID and styled for the current theme.android.view.ViewGroupgetPromptParentView()Get the view to add the prompt to.android.content.res.ResourcesgetResources()Returns a Resources instance for the application's package.java.lang.StringgetString(int resId)Returns a localized string from the application's package's default string table.android.content.res.Resources.ThemegetTheme()Return the Theme object associated withgetContext().android.content.res.TypedArrayobtainStyledAttributes(int resId, int[] attrs)Retrieve styled attribute information ingetContext()theme.
-
-
-
Method Detail
-
findViewById
@Nullable android.view.View findViewById(@IdRes int resId)Finds a child view with the given identifier. Returns null if the specified child view does not exist.- Parameters:
resId- the identifier of the view to find- Returns:
- The view with the given id or null.
-
getPromptParentView
@NonNull android.view.ViewGroup getPromptParentView()
Get the view to add the prompt to.- Returns:
- The view to add the prompt to.
-
getContext
@NonNull android.content.Context getContext()
Retrieve the Context that the prompt is running in.- Returns:
- Context The Context used by the prompt.
-
getResources
@NonNull android.content.res.Resources getResources()
Returns a Resources instance for the application's package.- Returns:
- a Resources instance for the application's package
-
getTheme
@NonNull android.content.res.Resources.Theme getTheme()
Return the Theme object associated withgetContext().
-
getString
@NonNull java.lang.String getString(@StringRes int resId)Returns a localized string from the application's package's default string table.- Parameters:
resId- Resource id for the string- Returns:
- The string data associated with the resource, stripped of styled text information.
-
obtainStyledAttributes
@NonNull android.content.res.TypedArray obtainStyledAttributes(@StyleRes int resId, @StyleableRes int[] attrs)Retrieve styled attribute information ingetContext()theme. SeeResources.Theme.obtainStyledAttributes(int, int[])for more information.- See Also:
Resources.Theme.obtainStyledAttributes(int, int[])
-
getDrawable
@Nullable android.graphics.drawable.Drawable getDrawable(@DrawableRes int resId)Returns a drawable object associated with a particular resource ID and styled for the current theme.- Parameters:
resId- 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.- Returns:
- An object that can be used to draw this resource, or
nullif the resource could not be resolved.
-
-