From c7882b7225bc9615aa69066c3182014992ad24d1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 29 Apr 2016 13:48:30 +0200 Subject: [PATCH] port all android drop down list items to our own --- .../siacs/conversations/ui/EditAccountActivity.java | 2 +- .../eu/siacs/conversations/ui/EnterJidDialog.java | 6 +++--- .../conversations/ui/StartConversationActivity.java | 11 +++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index b63412752..3d7eb1ccc 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -593,7 +593,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate } if (Config.DOMAIN_LOCK == null) { final KnownHostsAdapter mKnownHostsAdapter = new KnownHostsAdapter(this, - android.R.layout.simple_list_item_1, + R.layout.simple_list_item, xmppConnectionService.getKnownHosts()); this.mAccountJid.setAdapter(mKnownHostsAdapter); } diff --git a/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java b/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java index 89000a685..f77d9c0a8 100644 --- a/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java @@ -50,7 +50,7 @@ public class EnterJidDialog { jabberIdDesc.setText(R.string.account_settings_jabber_id); final Spinner spinner = (Spinner) dialogView.findViewById(R.id.account); final AutoCompleteTextView jid = (AutoCompleteTextView) dialogView.findViewById(R.id.jid); - jid.setAdapter(new KnownHostsAdapter(context, android.R.layout.simple_list_item_1, knownHosts)); + jid.setAdapter(new KnownHostsAdapter(context, R.layout.simple_list_item, knownHosts)); if (prefilledJid != null) { jid.append(prefilledJid); if (!allowEditJid) { @@ -67,10 +67,10 @@ public class EnterJidDialog { StartConversationActivity.populateAccountSpinner(context, activatedAccounts, spinner); } else { ArrayAdapter adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item, + R.layout.simple_list_item, new String[] { account }); spinner.setEnabled(false); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + adapter.setDropDownViewResource(R.layout.simple_list_item); spinner.setAdapter(adapter); } diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 558a96727..78c05e41d 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -393,7 +393,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU final TextView jabberIdDesc = (TextView) dialogView.findViewById(R.id.jabber_id); jabberIdDesc.setText(R.string.conference_address); jid.setHint(R.string.conference_address_example); - jid.setAdapter(new KnownHostsAdapter(this, android.R.layout.simple_list_item_1, mKnownConferenceHosts)); + jid.setAdapter(new KnownHostsAdapter(this, R.layout.simple_list_item, mKnownConferenceHosts)); if (prefilledJid != null) { jid.append(prefilledJid); } @@ -487,16 +487,15 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU public static void populateAccountSpinner(Context context, List accounts, Spinner spinner) { if (accounts.size() > 0) { - ArrayAdapter adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item, accounts); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + ArrayAdapter adapter = new ArrayAdapter<>(context, R.layout.simple_list_item, accounts); + adapter.setDropDownViewResource(R.layout.simple_list_item); spinner.setAdapter(adapter); spinner.setEnabled(true); } else { ArrayAdapter adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item, + R.layout.simple_list_item, Arrays.asList(new String[]{context.getString(R.string.no_accounts)})); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + adapter.setDropDownViewResource(R.layout.simple_list_item); spinner.setAdapter(adapter); spinner.setEnabled(false); }