Settings: Add a hook for operator or vendor specific settings.
The Settings application now provides a hook that can be used by an operator or a vendor specific application to add an activity of choice in the settings menu. Change-Id: Id55da9fd4262bbfc6a5abf863799c747b0d75b24
This commit is contained in:
committed by
Johan Redestig
parent
3514cdc3b0
commit
b2dd90383b
@@ -22,6 +22,7 @@ import android.graphics.drawable.Drawable;
|
||||
import android.preference.Preference;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
public class IconPreferenceScreen extends Preference {
|
||||
@@ -48,4 +49,26 @@ public class IconPreferenceScreen extends Preference {
|
||||
imageView.setImageDrawable(mIcon);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the icon for this Preference with a Drawable.
|
||||
*
|
||||
* @param icon The icon for this Preference
|
||||
*/
|
||||
public void setIcon(Drawable icon) {
|
||||
if ((icon == null && mIcon != null) || (icon != null && !icon.equals(mIcon))) {
|
||||
mIcon = icon;
|
||||
notifyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the icon of this Preference.
|
||||
*
|
||||
* @return The icon.
|
||||
* @see #setIcon(Drawable)
|
||||
*/
|
||||
public Drawable getIcon() {
|
||||
return mIcon;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user