public class SapaActionInfo
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<SapaActionInfo> |
CREATOR |
Constructor and Description |
---|
SapaActionInfo(android.os.Parcel in)
Creates SapaActionInfo based on a parcel.
|
SapaActionInfo(java.lang.String id,
int iconResId,
java.lang.String packageName)
Creates SapaActionInfo based on id, id of resource representing an action and
packageName of the application where the resource is stored and defines the
package name assuming that action is enabled and visible.
|
SapaActionInfo(java.lang.String id,
int iconResId,
java.lang.String packageName,
boolean enabled,
boolean visible)
Creates SapaActionInfo basing on id, id of resource representing action and
packageName of the application where the resource is stored and defines, the package
name and information whether action is enabled.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
boolean |
equals(java.lang.Object obj) |
android.graphics.drawable.Drawable |
getIcon(android.content.Context context)
This method returns a drawable object of the icon representing the action.
|
java.lang.String |
getId()
This method returns identifier of the action.
|
java.lang.String |
getName(android.content.Context context)
Gets the resource in its application that represents name of action.
|
int |
hashCode() |
boolean |
isEnabled()
Checks whether this action should be enabled.
|
boolean |
isVisible()
Checks whether this action shall be visible.
|
void |
setEnabled(boolean value)
Sets whether this action is enabled.
|
void |
setIcon(int iconResId)
Sets the resource in its application that represents action.
|
void |
setName(int nameResId)
Sets the resource in its application that represents name of action.
|
void |
setVisible(boolean value)
Sets whether this action shall be visible.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<SapaActionInfo> CREATOR
public SapaActionInfo(java.lang.String id, int iconResId, java.lang.String packageName)
id
- Id of the action.iconResId
- Id of the resource in given package that represents the
action.packageName
- Package name of the application of the action.public SapaActionInfo(java.lang.String id, int iconResId, java.lang.String packageName, boolean enabled, boolean visible)
id
- Id of the action.iconResId
- Id of the resource in given package that represents the
action.packageName
- Package name of the application of the action.enabled
- Information whether action shall be enabled.visible
- Information whether action shall be visible.public SapaActionInfo(android.os.Parcel in)
in
- Parcel containing data of SapaActionInfo.public final java.lang.String getId()
public final void setEnabled(boolean value)
value
- Set true to enable it.public final boolean isEnabled()
public final void setVisible(boolean value)
value
- Set true to mark action as visible, false otherwise.public final boolean isVisible()
public final void setIcon(int iconResId)
iconResId
- Id of the resource in given package that represents the
action.public final void setName(int nameResId)
nameResId
- Id of the resource in given package that represents the name
action.public final java.lang.String getName(android.content.Context context) throws android.content.res.Resources.NotFoundException, android.content.pm.PackageManager.NameNotFoundException
context
- Context of your application.android.content.pm.PackageManager.NameNotFoundException
- Thrown if the resources for the given application could not
be loaded.android.content.res.Resources.NotFoundException
- Thrown if the given ID does not exist.public final android.graphics.drawable.Drawable getIcon(android.content.Context context) throws android.content.res.Resources.NotFoundException, android.content.pm.PackageManager.NameNotFoundException
context
- Context of your application.android.content.pm.PackageManager.NameNotFoundException
- Thrown if the resources for the given application could not
be loaded.android.content.res.Resources.NotFoundException
- Thrown if the given ID does not exist.public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object