Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3f91712 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Update /e/ account naming in Account list.

- Add two new string value in res/values/strings.xml to allow translation
- Add if/else statement to check account's type to know what kind of naming should be used
parent b239e640
Loading
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -80,7 +80,15 @@ class AccountListFragment: ListFragment() {
            val account = getItem(position)!!

            val v = _v ?: LayoutInflater.from(context).inflate(R.layout.account_list_item, parent, false)
            v.account_name.text = account.name

            var accountNameText: String = account.name
            if (account.type.equals(context.resources.getString(R.string.account_type_eelo_address_book))) {
                accountNameText = String.format(context.resources.getString(R.string.eelo_address_book_account_name_text), account.name)
            } else if (account.type.equals(context.resources.getString(R.string.eelo_account_type))) {
                accountNameText = String.format(context.resources.getString(R.string.eelo_account_name_text), account.name)
            }

            v.account_name.text = accountNameText

            return v
        }
+3 −0
Original line number Diff line number Diff line
@@ -352,4 +352,7 @@
    <string name="google_alert_title">WARNING</string>
    <string name="google_alert_message">/e/ will report a fake device model to Google to protect your privacy.\nYou can check which one on Google\'s Device Activity after you log in.</string>

    <!-- Account List Fragment -->
    <string name="eelo_account_name_text">Settings (%s)</string>
    <string name="eelo_address_book_account_name_text">Address book settings (%s)</string>
</resources>