Skip to content

Commit ae2c15a

Browse files
committed
Hide subtitle message when uploading a single image (commons-app#2163)
1 parent 46db38b commit ae2c15a

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -309,19 +309,29 @@ public void setRightCardVisibility(boolean visible) {
309309
}
310310

311311
@Override
312-
public void setBottomCardVisibility(@UploadPage int page) {
312+
public void setBottomCardVisibility(@UploadPage int page, int uploadCount) {
313313
if (page == TITLE_CARD) {
314314
viewFlipper.setDisplayedChild(0);
315315
} else if (page == CATEGORIES) {
316316
viewFlipper.setDisplayedChild(1);
317+
TextView categoriesSubtitle = viewFlipper.findViewById(R.id.categories_subtitle);
318+
setSubtitleVisibility(categoriesSubtitle, uploadCount);
317319
} else if (page == LICENSE) {
318320
viewFlipper.setDisplayedChild(2);
319321
dismissKeyboard();
322+
TextView licenseSubtitle = viewFlipper.findViewById(R.id.license_subtitle);
323+
setSubtitleVisibility(licenseSubtitle, uploadCount);
320324
} else if (page == PLEASE_WAIT) {
321325
viewFlipper.setDisplayedChild(3);
322326
}
323327
}
324328

329+
private void setSubtitleVisibility(TextView subtitle, int uploadCount) {
330+
if (subtitle != null && uploadCount > 1) {
331+
subtitle.setVisibility(View.VISIBLE);
332+
}
333+
}
334+
325335
@Override
326336
public void setBottomCardState(boolean state) {
327337
updateCardState(state, bottomCardExpandButton, rvDescriptions, previous, next, bottomCardAddDescription);

app/src/main/java/fr/free/nrw/commons/upload/UploadPresenter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ private void showCorrectCards(int currentStep, int uploadCount) {
406406
view.setTopCardVisibility(false);
407407
view.setRightCardVisibility(false);
408408
}
409-
view.setBottomCardVisibility(currentPage);
409+
view.setBottomCardVisibility(currentPage, uploadCount);
410410
}
411411

412412
//endregion

app/src/main/java/fr/free/nrw/commons/upload/UploadView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public interface UploadView {
5252

5353
void setBottomCardVisibility(boolean visible);
5454

55-
void setBottomCardVisibility(@UploadPage int page);
55+
void setBottomCardVisibility(@UploadPage int page, int uploadCount);
5656

5757
void updateRightCardContent(boolean gpsPresent);
5858

app/src/main/res/layout/activity_upload_categories.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
android:textSize="@dimen/subtitle_text"
3939
android:text="@string/upload_flow_all_images_in_set"
4040
android:layout_below="@+id/categories_title"
41-
tools:text="(For all images in set)" />
41+
android:visibility="gone"
42+
tools:text="(For all images in set)"
43+
tools:visibility="gone"/>
4244

4345
<FrameLayout
4446
android:layout_width="match_parent"

app/src/main/res/layout/activity_upload_license.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
android:textSize="@dimen/subtitle_text"
3939
android:text="@string/upload_flow_all_images_in_set"
4040
android:layout_below="@+id/license_title"
41-
tools:text="(For all images in set)" />
41+
android:visibility="gone"
42+
tools:text="(For all images in set)"
43+
tools:visibility="gone"/>
4244

4345
<Spinner
4446
android:id="@+id/license_list"

0 commit comments

Comments
 (0)