Merge "Link partial convo controls to Settings" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
629ebb174b
@@ -144,25 +144,36 @@
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<com.android.systemui.statusbar.notification.row.ButtonLinearLayout
|
||||
android:id="@+id/settings_link"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_info"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:layout_marginEnd="8dp"/>
|
||||
<TextView
|
||||
android:id="@+id/non_configurable_text"
|
||||
android:padding="@dimen/notification_importance_button_padding"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/notification_guts_priority_button_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextAppearance.NotificationImportanceChannelGroup" />
|
||||
</LinearLayout>
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_info"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:layout_marginEnd="8dp"/>
|
||||
<TextView
|
||||
android:id="@+id/non_configurable_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextAppearance.NotificationImportanceChannelGroup" />
|
||||
</LinearLayout>
|
||||
</com.android.systemui.statusbar.notification.row.ButtonLinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/bottom_buttons"
|
||||
|
||||
@@ -135,10 +135,13 @@ public class PartialConversationInfo extends LinearLayout implements
|
||||
}
|
||||
|
||||
private void bindActions() {
|
||||
final OnClickListener settingsOnClickListener = getSettingsOnClickListener();
|
||||
final View settingsButton = findViewById(R.id.info);
|
||||
settingsButton.setOnClickListener(getSettingsOnClickListener());
|
||||
settingsButton.setOnClickListener(settingsOnClickListener);
|
||||
settingsButton.setVisibility(settingsButton.hasOnClickListeners() ? VISIBLE : GONE);
|
||||
|
||||
findViewById(R.id.settings_link).setOnClickListener(settingsOnClickListener);
|
||||
|
||||
TextView msg = findViewById(R.id.non_configurable_text);
|
||||
msg.setText(getResources().getString(R.string.no_shortcut, mAppName));
|
||||
}
|
||||
|
||||
@@ -355,6 +355,30 @@ public class PartialConversationInfoTest extends SysuiTestCase {
|
||||
assertEquals(0, latch.getCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBindNotification_SetsOnClickListenerForSettings_mainText() {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mInfo.bindNotification(
|
||||
mMockPackageManager,
|
||||
mMockINotificationManager,
|
||||
mChannelEditorDialogController,
|
||||
TEST_PACKAGE_NAME,
|
||||
mNotificationChannel,
|
||||
mNotificationChannelSet,
|
||||
mEntry,
|
||||
(View v, NotificationChannel c, int appUid) -> {
|
||||
assertEquals(mNotificationChannel, c);
|
||||
latch.countDown();
|
||||
},
|
||||
true,
|
||||
false);
|
||||
|
||||
final View settingsButton = mInfo.findViewById(R.id.settings_link);
|
||||
settingsButton.performClick();
|
||||
// Verify that listener was triggered.
|
||||
assertEquals(0, latch.getCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBindNotification_SettingsButtonInvisibleWhenNoClickListener() {
|
||||
mInfo.bindNotification(
|
||||
|
||||
Reference in New Issue
Block a user