mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add descriptive text to tell people how to skip categorization
This commit is contained in:
parent
0176995612
commit
264483838c
3 changed files with 28 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue