diff --git a/commons/res/layout/fragment_categorization.xml b/commons/res/layout/fragment_categorization.xml index 893a8a198..aabbc9473 100644 --- a/commons/res/layout/fragment_categorization.xml +++ b/commons/res/layout/fragment_categorization.xml @@ -37,6 +37,16 @@ android:gravity="center" /> + + No categories matching %1$s found + + Add categories to make the image more discoverable on Wikimedia Commons.\n\n + Start typing to add categories.\n + Tap this message (or hit back) to skip this step. + diff --git a/commons/src/main/java/org/wikimedia/commons/CategorizationFragment.java b/commons/src/main/java/org/wikimedia/commons/CategorizationFragment.java index 0fa311b5b..3ce4e499d 100644 --- a/commons/src/main/java/org/wikimedia/commons/CategorizationFragment.java +++ b/commons/src/main/java/org/wikimedia/commons/CategorizationFragment.java @@ -35,6 +35,7 @@ public class CategorizationFragment extends SherlockFragment{ EditText categoriesFilter; ProgressBar categoriesSearchInProgress; TextView categoriesNotFoundView; + TextView categoriesSkip; CategoriesAdapter categoriesAdapter; CategoriesUpdater lastUpdater = null; @@ -87,6 +88,11 @@ public class CategorizationFragment extends SherlockFragment{ filter = categoriesFilter.getText().toString(); categoriesSearchInProgress.setVisibility(View.VISIBLE); categoriesNotFoundView.setVisibility(View.GONE); + + if(!TextUtils.isEmpty(filter)) { + // Only hide this on first count of non-empty filter + categoriesSkip.setVisibility(View.GONE); + } } @Override @@ -202,6 +208,13 @@ public class CategorizationFragment extends SherlockFragment{ categoriesFilter = (EditText) rootView.findViewById(R.id.categoriesSearchBox); categoriesSearchInProgress = (ProgressBar) rootView.findViewById(R.id.categoriesSearchInProgress); categoriesNotFoundView = (TextView) rootView.findViewById(R.id.categoriesNotFound); + categoriesSkip = (TextView) rootView.findViewById(R.id.categoriesExplanation); + + categoriesSkip.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + getActivity().finish(); + } + }); ArrayList items; if(savedInstanceState == null) {