Loading core/java/android/app/Notification.java +10 −1 Original line number Diff line number Diff line Loading @@ -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); 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; } Loading core/res/res/layout/notification_action.xml +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ --> <Button xmlns:android="http://schemas.android.com/apk/res/android" style="?android:attr/borderlessButtonStyle" android:id="@+id/action0" android:layout_width="match_parent" android:layout_height="48dp" Loading Loading
core/java/android/app/Notification.java +10 −1 Original line number Diff line number Diff line Loading @@ -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); 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; } Loading
core/res/res/layout/notification_action.xml +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ --> <Button xmlns:android="http://schemas.android.com/apk/res/android" style="?android:attr/borderlessButtonStyle" android:id="@+id/action0" android:layout_width="match_parent" android:layout_height="48dp" Loading