Dbrant has uploaded a new change for review. https://gerrit.wikimedia.org/r/191073
Change subject: Fix "other" edit summary in 2.3 ...................................................................... Fix "other" edit summary in 2.3 - Fix text color (was white on white) - Fix showing of persisted suggestions, and their background color Change-Id: Ie30a6be537f55e1c69a09cb2acd5540768b991fb --- M wikipedia/res/layout/fragment_preview_summary.xml M wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummaryHandler.java 2 files changed, 29 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/73/191073/1 diff --git a/wikipedia/res/layout/fragment_preview_summary.xml b/wikipedia/res/layout/fragment_preview_summary.xml index 2ef7b5d..8e4ef3a 100644 --- a/wikipedia/res/layout/fragment_preview_summary.xml +++ b/wikipedia/res/layout/fragment_preview_summary.xml @@ -18,6 +18,7 @@ android:paddingRight="16dp" android:singleLine="true" android:maxLength="255" + android:textColor="?attr/edit_text_color" android:hint="@string/edit_summary_tag_other_hint"/> </LinearLayout> diff --git a/wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummaryHandler.java b/wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummaryHandler.java index 4f942bc..43c9786 100644 --- a/wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummaryHandler.java +++ b/wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummaryHandler.java @@ -26,7 +26,7 @@ public EditSummaryHandler(final Activity activity, final View parent, PageTitle title) { this.activity = activity; container = parent.findViewById(R.id.edit_summary_container); - summaryEdit = (AutoCompleteTextView)parent.findViewById(R.id.edit_summary_edit); + summaryEdit = (AutoCompleteTextView) parent.findViewById(R.id.edit_summary_edit); container.setOnClickListener(new View.OnClickListener() { @Override @@ -35,39 +35,27 @@ } }); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - // For some reason the autocomplete popup view crashes on - // Gingerbread. This seems to be related to styles but I - // can't quite figure out why. - // - // This call in AutoCompleteTextView.buildDropDown ends up failing: - // - // mDropDownList.setSelector(mDropDownListHighlight); - // - // because mDropDownListHighlight seems to be null instead - // of an expected drawable, and that ends up failing when used. - - final EditSummaryAdapter adapter = new EditSummaryAdapter(activity, null, true); - summaryEdit.setAdapter(adapter); - - adapter.setFilterQueryProvider(new FilterQueryProvider() { - @Override - public Cursor runQuery(CharSequence charSequence) { - ContentProviderClient client = activity.getContentResolver().acquireContentProviderClient(EditSummary.PERSISTANCE_HELPER.getBaseContentURI()); - try { - return client.query( - EditSummary.PERSISTANCE_HELPER.getBaseContentURI(), - null, - "summary LIKE ?", - new String[] {charSequence + "%"}, - "lastUsed DESC"); - } catch (RemoteException e) { - // This shouldn't really be happening - throw new RuntimeException(e); - } + EditSummaryAdapter adapter = new EditSummaryAdapter(activity, null, true); + summaryEdit.setAdapter(adapter); + adapter.setFilterQueryProvider(new FilterQueryProvider() { + @Override + public Cursor runQuery(CharSequence charSequence) { + ContentProviderClient client = activity.getContentResolver() + .acquireContentProviderClient(EditSummary.PERSISTANCE_HELPER + .getBaseContentURI()); + try { + return client.query( + EditSummary.PERSISTANCE_HELPER.getBaseContentURI(), + null, + "summary LIKE ?", + new String[] {charSequence + "%"}, + "lastUsed DESC"); + } catch (RemoteException e) { + // This shouldn't really be happening + throw new RuntimeException(e); } - }); - } + } + }); Utils.setTextDirection(summaryEdit, title.getSite().getLanguage()); } @@ -97,7 +85,13 @@ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { - return activity.getLayoutInflater().inflate(android.R.layout.simple_list_item_1, parent, false); + View rootView = activity.getLayoutInflater().inflate(android.R.layout.simple_list_item_1, parent, false); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + // explicitly set background color of the list item + rootView.setBackgroundColor(activity.getResources().getColor( + Utils.getThemedAttributeId(activity, R.attr.window_background_color))); + } + return rootView; } @Override -- To view, visit https://gerrit.wikimedia.org/r/191073 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie30a6be537f55e1c69a09cb2acd5540768b991fb Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant <dbr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits