diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailSettingsActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailSettingsActivity.kt index 757745a..e6df89b 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/DetailSettingsActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/DetailSettingsActivity.kt @@ -4,6 +4,7 @@ import android.content.ContentResolver import android.graphics.BitmapFactory import android.net.Uri import android.os.Bundle +import android.text.TextUtils import android.widget.Toast import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts @@ -298,8 +299,15 @@ class DetailSettingsActivity : AppCompatActivity() { return subscription.displayName ?: "" } } - pref?.summaryProvider = Preference.SummaryProvider { _ -> - getString(R.string.detail_settings_appearance_display_name_summary, displayName(subscription), topicShortUrl(subscription.baseUrl, subscription.topic)) + pref?.summaryProvider = Preference.SummaryProvider { provider -> + if (TextUtils.isEmpty(provider.text)) { + getString( + R.string.detail_settings_appearance_display_name_default_summary, + displayName(subscription) + ) + } else { + provider.text + } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ea80adb..1691d49 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -354,7 +354,8 @@ Icon displayed in notifications for this topic Unable to save icon: %1$s Display name - Set a custom display name for this subscription. Leave empty for default\nCurrent: %1$s\nDefault: %2$s + Set a custom display name for this subscription. Leave empty for default + %1$s (default) Use global setting using global setting diff --git a/app/src/main/res/xml/detail_preferences.xml b/app/src/main/res/xml/detail_preferences.xml index b398170..184bdb4 100644 --- a/app/src/main/res/xml/detail_preferences.xml +++ b/app/src/main/res/xml/detail_preferences.xml @@ -41,7 +41,8 @@