Remove loading spinner from Premium SMS access

The loading spinner in the page is displayed by default, regardless of
whether or not how many apps are in the page. This change is trying to
remove the loading spinner from the page since this page doesn't have
many apps in it.

Bug: 222441974
Test: visual verify
Change-Id: I9b2b031122e6b6d521466ccf53e39185cfcab687
This commit is contained in:
Mill Chen
2022-04-22 13:05:23 +08:00
parent 0aa436da2b
commit 5d33ca9120
3 changed files with 5 additions and 4 deletions

View File

@@ -443,6 +443,7 @@
<!-- Text padding for EmptyTextSettings -->
<dimen name="empty_text_padding">24dp</dimen>
<dimen name="empty_text_layout_height">450dp</dimen>
<!-- Choose SIM Activity dimens -->
<dimen name="subtitle_bottom_padding">24dp</dimen>

View File

@@ -68,7 +68,7 @@ public class PremiumSmsAccess extends EmptyTextSettings
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
setLoading(true, false);
setEmptyText(R.string.premium_sms_none);
}
@Override
@@ -138,8 +138,6 @@ public class PremiumSmsAccess extends EmptyTextSettings
private void updatePrefs(ArrayList<AppEntry> apps) {
if (apps == null) return;
setEmptyText(R.string.premium_sms_none);
setLoading(false, true);
final PreferenceScreen screen = getPreferenceScreen();
screen.removeAll();
screen.setOrderingAsAdded(true);

View File

@@ -43,8 +43,10 @@ public abstract class EmptyTextSettings extends SettingsPreferenceFragment {
TypedValue value = new TypedValue();
getContext().getTheme().resolveAttribute(android.R.attr.textAppearanceMedium, value, true);
mEmpty.setTextAppearance(value.resourceId);
final int layoutHeight = getContext().getResources()
.getDimensionPixelSize(R.dimen.empty_text_layout_height);
((ViewGroup) view.findViewById(android.R.id.list_container)).addView(mEmpty,
new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
new LayoutParams(LayoutParams.MATCH_PARENT, layoutHeight));
setEmptyView(mEmpty);
}