Add descriptive text to tell people how to skip categorization

This commit is contained in:
YuviPanda 2013-03-30 05:18:45 +05:30
parent 0176995612
commit 264483838c
3 changed files with 28 additions and 0 deletions

View file

@ -37,6 +37,16 @@
android:gravity="center"
/>
<TextView
android:id="@+id/categoriesExplanation"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginTop="48dp"
android:gravity="center"
android:focusable="true"
android:text="@string/categories_skip_explanation"
/>
<ListView
android:id="@+id/categoriesListBox"
android:layout_height="wrap_content"

View file

@ -70,4 +70,9 @@
</plurals>
<string name="categories_not_found">No categories matching %1$s found</string>
<string name="categories_skip_explanation">
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.
</string>
</resources>

View file

@ -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<CategoryItem> items;
if(savedInstanceState == null) {