Methods Summary |
---|
public int | compareTo(android.preference.Preference another)
if (!(another instanceof ShortcutPreference)) return super.compareTo(another);
// Letters before digits
char other = ((ShortcutPreference) another).mShortcut;
if (Character.isDigit(mShortcut) && Character.isLetter(other)) return 1;
else if (Character.isDigit(other) && Character.isLetter(mShortcut)) return -1;
else return mShortcut - other;
|
public char | getShortcut()
return mShortcut;
|
public java.lang.CharSequence | getSummary()
return mHasBookmark ? super.getSummary() : STRING_NO_SHORTCUT;
|
public java.lang.CharSequence | getTitle()
return mHasBookmark ? super.getTitle() : STRING_ASSIGN_APPLICATION;
|
public boolean | hasBookmark()
return mHasBookmark;
|
protected void | onBindView(android.view.View view)
super.onBindView(view);
TextView shortcutView = (TextView) view.findViewById(R.id.shortcut);
if (shortcutView != null) {
shortcutView.setText(String.valueOf(mShortcut));
}
TextView titleView = (TextView) view.findViewById(android.R.id.title);
synchronized (sStaticVarsLock) {
if (sRegularTitleColor == null) {
sRegularTitleColor = titleView.getTextColors();
sDimTitleColor = sRegularTitleColor.withAlpha(sDimAlpha);
}
}
ColorStateList color = mHasBookmark ? sRegularTitleColor : sDimTitleColor;
if (color != null) {
titleView.setTextColor(color);
}
TextView summaryView = (TextView) view.findViewById(android.R.id.summary);
synchronized (sStaticVarsLock) {
if (sRegularSummaryColor == null) {
sRegularSummaryColor = summaryView.getTextColors();
sDimSummaryColor = sRegularSummaryColor.withAlpha(sDimAlpha);
}
}
color = mHasBookmark ? sRegularSummaryColor : sDimSummaryColor;
if (color != null) {
summaryView.setTextColor(color);
}
|
public void | setHasBookmark(boolean hasBookmark)
if (hasBookmark != mHasBookmark) {
mHasBookmark = hasBookmark;
notifyChanged();
}
|
public void | setShortcut(char shortcut)
if (shortcut != mShortcut) {
mShortcut = shortcut;
notifyChanged();
}
|