diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-03-08 14:41:25 +0100 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-03-08 14:52:29 +0100 |
commit | be558944b52ac038c40bdf84a3d52c9ae2e7a218 (patch) | |
tree | 07a3ce8905394345013d94bf39cb2fb86cdabdaa /OpenPGP-Keychain/src/main/java | |
parent | de6daf5c30c66e1152f06560e0030fb514d5f68f (diff) | |
download | open-keychain-be558944b52ac038c40bdf84a3d52c9ae2e7a218.tar.gz open-keychain-be558944b52ac038c40bdf84a3d52c9ae2e7a218.tar.bz2 open-keychain-be558944b52ac038c40bdf84a3d52c9ae2e7a218.zip |
add contact count to My Keys header
Diffstat (limited to 'OpenPGP-Keychain/src/main/java')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 941abdd6d..96b75cf11 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -19,7 +19,6 @@ package org.sufficientlysecure.keychain.ui; import java.util.HashMap; import java.util.ArrayList; -import java.util.Set; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; @@ -473,6 +472,7 @@ public class KeyListFragment extends Fragment implements AdapterView.OnItemClick holder = new HeaderViewHolder(); convertView = mInflater.inflate(R.layout.key_list_header, parent, false); holder.text = (TextView) convertView.findViewById(R.id.stickylist_header_text); + holder.count = (TextView) convertView.findViewById(R.id.contacts_num); convertView.setTag(holder); } else { holder = (HeaderViewHolder) convertView.getTag(); @@ -489,6 +489,13 @@ public class KeyListFragment extends Fragment implements AdapterView.OnItemClick } if(mCursor.getInt(KeyListFragment.INDEX_TYPE) == KeyTypes.SECRET) { + { // set contact count + int num = mCursor.getCount(); + String contactsTotal = getResources().getQuantityString(R.plurals.n_contacts, num, num); + holder.count.setText(contactsTotal); + holder.count.setVisibility(View.VISIBLE); + } + holder.text.setText(convertView.getResources().getString(R.string.my_keys)); return convertView; } @@ -500,6 +507,7 @@ public class KeyListFragment extends Fragment implements AdapterView.OnItemClick headerText = "" + mCursor.getString(KeyListFragment.INDEX_UID).subSequence(0, 1).charAt(0); } holder.text.setText(headerText); + holder.count.setVisibility(View.GONE); return convertView; } @@ -533,6 +541,7 @@ public class KeyListFragment extends Fragment implements AdapterView.OnItemClick class HeaderViewHolder { TextView text; + TextView count; } /** |