mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
* Hide subtitle message when uploading a single image (#2163) * updateSubtitleVisibility: Javadoc and replace if with ternary operator * updateSubtitleVisibility: change findViewById to BindView * Remove null checks for views Null check is not required while binding views with butterknife.
This commit is contained in:
parent
5c8a0cdd93
commit
af291a5fcc
5 changed files with 18 additions and 2 deletions
|
|
@ -93,6 +93,8 @@ public class UploadActivity extends AuthenticatedActivity implements UploadView,
|
|||
@BindView(R.id.bottom_card_next) Button next;
|
||||
@BindView(R.id.bottom_card_previous) Button previous;
|
||||
@BindView(R.id.bottom_card_add_desc) Button bottomCardAddDescription;
|
||||
@BindView(R.id.categories_subtitle) TextView categoriesSubtitle;
|
||||
@BindView(R.id.license_subtitle) TextView licenseSubtitle;
|
||||
|
||||
//Right Card
|
||||
@BindView(R.id.right_card) CardView rightCard;
|
||||
|
|
@ -322,6 +324,16 @@ public class UploadActivity extends AuthenticatedActivity implements UploadView,
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only show the subtitle ("For all images in set") if multiple images being uploaded
|
||||
* @param imageCount Number of images being uploaded
|
||||
*/
|
||||
@Override
|
||||
public void updateSubtitleVisibility(int imageCount) {
|
||||
categoriesSubtitle.setVisibility(imageCount > 1 ? View.VISIBLE : View.GONE);
|
||||
licenseSubtitle.setVisibility(imageCount > 1 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBottomCardState(boolean state) {
|
||||
updateCardState(state, bottomCardExpandButton, rvDescriptions, previous, next, bottomCardAddDescription);
|
||||
|
|
|
|||
|
|
@ -385,6 +385,8 @@ public class UploadPresenter {
|
|||
GPSExtractor gpsObj = uploadModel.getCurrentItem().gpsCoords;
|
||||
view.updateRightCardContent(gpsObj != null && gpsObj.imageCoordsExists);
|
||||
|
||||
view.updateSubtitleVisibility(uploadModel.getCount());
|
||||
|
||||
showCorrectCards(uploadModel.getCurrentStep(), uploadModel.getCount());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ public interface UploadView {
|
|||
|
||||
void updateTopCardContent();
|
||||
|
||||
void updateSubtitleVisibility(int imageCount);
|
||||
|
||||
void dismissKeyboard();
|
||||
|
||||
void showBadPicturePopup(@ImageUtils.Result int errorMessage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue