[app] Don't show summary if null

Originally, we were showing "Unknown application" in English, no matter the user's locale. Then here we were actually showing "null". Both isn't good, so best to not show anything.
This commit is contained in:
Torsten Grote
2022-07-26 15:29:45 -03:00
parent 795025acb5
commit 2b9d7ea8a0

View File

@@ -565,8 +565,9 @@ public final class Utils {
* "sans-serif-light". Doesn't mandate any font sizes or any other styles, that is up to the
* {@link android.widget.TextView} which it ends up being displayed in.
*/
public static CharSequence formatAppNameAndSummary(String appName, String summary) {
String toFormat = appName + ' ' + summary;
public static CharSequence formatAppNameAndSummary(String appName, @Nullable String summary) {
String toFormat = appName;
if (summary != null) toFormat += ' ' + summary;
CharacterStyle normal = new TypefaceSpan("sans-serif");
CharacterStyle light = new TypefaceSpan("sans-serif-light");