Fix line break in Opening links app list summary.
- the installed app list is using the app preference layout, which has the appendix field to the right of the app title and summary. The appendix and title/summary each has weight 1 to take up half of the screen width. However, the appendix field is not used in the Opening links page at all, so that field should be set to GONE to let the title/summary takes up the whole available width. Change-Id: Ia066a60dcd0a4c1d8562bd47e173378b49912d18 Fixes: 77954267 Test: visual and make RunSettingsRoboTests
This commit is contained in:
@@ -268,6 +268,7 @@ public class ManageDomainUrls extends SettingsPreferenceFragment
|
||||
});
|
||||
}
|
||||
super.onBindViewHolder(holder);
|
||||
holder.itemView.findViewById(R.id.appendix).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private CharSequence getDomainsSummary(String packageName) {
|
||||
|
@@ -17,9 +17,16 @@
|
||||
package com.android.settings.applications;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
@@ -54,4 +61,22 @@ public class ManageDomainUrlsTest {
|
||||
|
||||
assertThat(pref.getLayoutResource()).isEqualTo(R.layout.preference_app);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onBindViewHolder_shouldSetAppendixViewToGone() {
|
||||
mAppEntry.info = new ApplicationInfo();
|
||||
mAppEntry.info.packageName = "com.android.settings.test";
|
||||
mAppEntry.icon = mock(Drawable.class);
|
||||
final ManageDomainUrls.DomainAppPreference pref =
|
||||
new ManageDomainUrls.DomainAppPreference(mContext, null, mAppEntry);
|
||||
final View holderView = mock(View.class);
|
||||
final View appendixView = mock(View.class);
|
||||
when(holderView.findViewById(R.id.summary_container)).thenReturn(mock(View.class));
|
||||
when(holderView.findViewById(android.R.id.progress)).thenReturn(mock(ProgressBar.class));
|
||||
when(holderView.findViewById(R.id.appendix)).thenReturn(appendixView);
|
||||
|
||||
pref.onBindViewHolder(PreferenceViewHolder.createInstanceForTests(holderView));
|
||||
|
||||
verify(appendixView).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user