diff options
| author | Daniel Sandler <dsandler@android.com> | 2012-05-10 15:44:16 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-10 15:44:16 -0700 |
| commit | f54bfcf5a3594d7d8423391be68d9b982ea6c4fa (patch) | |
| tree | 493fe42b0350c5b7d05dccb0f981a48571416782 /core/java/android/app/Notification.java | |
| parent | 4e90bb536ae7430978eeef5c287b11a72ea4c023 (diff) | |
| parent | e551884b0972280c9aee451b489832e67395c8e2 (diff) | |
Merge "Restyling action buttons." into jb-dev
Diffstat (limited to 'core/java/android/app/Notification.java')
| -rw-r--r-- | core/java/android/app/Notification.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index ed9babfd3037..0c470692bf6f 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -1503,7 +1503,16 @@ public class Notification implements Parcelable RemoteViews button = new RemoteViews(mContext.getPackageName(), R.layout.notification_action); button.setTextViewCompoundDrawables(R.id.action0, action.icon, 0, 0, 0); button.setTextViewText(R.id.action0, action.title); - button.setOnClickPendingIntent(R.id.action0, action.actionIntent); + if (action.actionIntent != null) { + button.setOnClickPendingIntent(R.id.action0, action.actionIntent); + //button.setBoolean(R.id.action0, "setEnabled", true); + button.setFloat(R.id.button0, "setAlpha", 1.0f); + button.setBoolean(R.id.button0, "setClickable", true); + } else { + //button.setBoolean(R.id.action0, "setEnabled", false); + button.setFloat(R.id.button0, "setAlpha", 0.5f); + button.setBoolean(R.id.button0, "setClickable", false); + } button.setContentDescription(R.id.action0, action.title); return button; } |
