From e551884b0972280c9aee451b489832e67395c8e2 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Thu, 10 May 2012 16:20:40 -0400 Subject: Restyling action buttons. Bug: 6418617 Change-Id: I843352fbd167aeb6cc7beb0172b7416aabd5856a --- core/java/android/app/Notification.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/java') diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index edeeee263d8c..09d24e38f452 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -1490,7 +1490,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; } -- cgit v1.2.3