Render an additional icon to the tappable tiles with pending intents

Test: robotest, manual
Bug: 281517110
Change-Id: Ia5fbae63d56a6f1e6ee8fb3ee58ae912d14b6c75
This commit is contained in:
Peter Zhang
2023-05-08 12:13:11 +02:00
parent ddb65e569b
commit 3e498ad30d
3 changed files with 40 additions and 1 deletions

View File

@@ -573,6 +573,10 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
return (tile instanceof ActivityTile || tile.hasPendingIntent())
? new PrimarySwitchPreference(getPrefContext())
: new SwitchPreference(getPrefContext());
} else if (tile.hasPendingIntent()) {
Preference preference = new Preference(getPrefContext());
preference.setWidgetLayoutResource(R.layout.preference_external_action_icon);
return preference;
} else {
return new Preference(getPrefContext());
}