diff options
author | Joe Onorato <joeo@google.com> | 2010-10-31 11:41:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-31 11:41:47 -0700 |
commit | 6b21cdeb5f0127862d82f24a4b6001f495e3c8cd (patch) | |
tree | 757e4448ac0b26d066c99ed29be25754bfe3b76b | |
parent | 9c3a80b236b389f9e7640298beee3bb6f89c9c4e (diff) | |
parent | 4058ba052682129f2d1055116aaffb2e91c2013d (diff) | |
download | frameworks_base-6b21cdeb5f0127862d82f24a4b6001f495e3c8cd.zip frameworks_base-6b21cdeb5f0127862d82f24a4b6001f495e3c8cd.tar.gz frameworks_base-6b21cdeb5f0127862d82f24a4b6001f495e3c8cd.tar.bz2 |
Merge "Allow both contentIntent and setOnClickPendingIntent in notifications"
3 files changed, 34 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java index 2f94af6..64ec063 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java @@ -23,22 +23,11 @@ import android.view.MotionEvent; import android.widget.FrameLayout; public class LatestItemView extends FrameLayout { - private boolean mDispatchTorches; - public LatestItemView(Context context, AttributeSet attrs) { super(context, attrs); } - public boolean dispatchTouchEvent(MotionEvent ev) { - if (mDispatchTorches) { - return super.dispatchTouchEvent(ev); - } else { - return onTouchEvent(ev); - } - } - public void setOnClickListener(OnClickListener l) { - mDispatchTorches = l == null; super.setOnClickListener(l); } } diff --git a/tests/StatusBar/res/layout/button_notification.xml b/tests/StatusBar/res/layout/button_notification.xml new file mode 100644 index 0000000..822e8cd --- /dev/null +++ b/tests/StatusBar/res/layout/button_notification.xml @@ -0,0 +1,21 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="80sp" + android:orientation="horizontal" + > + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@drawable/icon1" + /> + + <Button android:id="@+id/button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="button" + /> + +</LinearLayout> + diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 38ee1b8..2df97dc 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -100,6 +100,19 @@ public class NotificationTestList extends TestActivity } }, + new Test("Button") { + public void run() { + Notification n = new Notification(R.drawable.icon1, null, + mActivityCreateTime); + n.contentView = new RemoteViews(getPackageName(), R.layout.button_notification); + n.flags |= Notification.FLAG_ONGOING_EVENT; + n.contentIntent = makeIntent(); + n.contentView.setOnClickPendingIntent(R.id.button, makeIntent2()); + + mNM.notify(1, n); + } + }, + new Test("custom intent on text view") { public void run() { Notification n = new Notification(R.drawable.icon1, null, |