[android] Added tags limit

This commit is contained in:
Dmitry Donskoy 2019-02-05 13:27:34 +03:00 committed by Aleksandr Zatsepin
parent 8729a31c75
commit fa2f6aeae6
7 changed files with 18 additions and 12 deletions

View file

@ -1183,7 +1183,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
//TODO(@alexzatsepin): Implement me if necessary
}

View file

@ -215,7 +215,8 @@ public class CachedBookmarkCategoriesFragment extends BaseBookmarkCategoriesFrag
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
//TODO(@alexzatsepin): Implement me if necessary
}

View file

@ -277,7 +277,7 @@ public enum BookmarkManager
List<CatalogTagsGroup> unmodifiableData = Collections.unmodifiableList(Arrays.asList(tagsGroups));
for (BookmarksCatalogListener listener : mCatalogListeners)
{
listener.onTagsReceived(successful, unmodifiableData);
listener.onTagsReceived(successful, unmodifiableData, maxTagsCount);
}
}
@ -860,10 +860,10 @@ public enum BookmarkManager
/**
* The method is called when the tags were received from the server.
* @param successful is the result of the receiving.
* @param successful is the result of the receiving.
* @param tagsGroups is the tags collection.
*/
void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups);
void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups, int tagsLimit);
/**
* The method is called when the custom properties were received from the server.
@ -907,7 +907,8 @@ public enum BookmarkManager
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
/* do noting by default */
}

View file

@ -150,7 +150,8 @@ public class SendLinkPlaceholderFragment extends BaseAuthFragment implements Boo
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
/* do noting by default */
}

View file

@ -161,7 +161,8 @@ public class UgcRoutePropertiesFragment extends BaseMwmFragment implements Bookm
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
/* Do noting by default */
}

View file

@ -47,7 +47,6 @@ public class UgcRouteTagsFragment extends BaseMwmFragment implements BookmarkMan
private static final String BUNDLE_SELECTED_TAGS = "bundle_saved_tags";
private static final String ERROR_LOADING_DIALOG_TAG = "error_loading_dialog";
private static final int ERROR_LOADING_DIALOG_REQ_CODE = 205;
private static final int TAGS_LIMIT = 1;
@SuppressWarnings("NullableProblems")
@NonNull
@ -192,7 +191,8 @@ public class UgcRouteTagsFragment extends BaseMwmFragment implements BookmarkMan
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
UiUtils.showIf(successful && tagsGroups.size() != 0, mTagsContainer);
UiUtils.hide(mProgress);
@ -202,7 +202,7 @@ public class UgcRouteTagsFragment extends BaseMwmFragment implements BookmarkMan
showErrorLoadingDialog();
return;
}
installTags(tagsGroups, TAGS_LIMIT);
installTags(tagsGroups, tagsLimit);
}
@Override

View file

@ -427,7 +427,8 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
}
@Override
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups)
public void onTagsReceived(boolean successful, @NonNull List<CatalogTagsGroup> tagsGroups,
int tagsLimit)
{
}