diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index cd32dcb626..df38b08387 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -2402,7 +2402,4 @@ wheelchair-limited wheelchair-no wheelchair-yes - Please, select tags to help other travelers find your guide. This is mandatory. - Loading tags… - Select tags diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 32dccc758d..c444e08b87 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -1169,7 +1169,7 @@ public class MwmActivity extends BaseMwmFragmentActivity @Override public void onCustomPropertiesReceived(boolean successful, - @NonNull CatalogCustomProperty[] properties) + @NonNull List properties) { //TODO(@alexzatsepin): Implement me if necessary } diff --git a/android/src/com/mapswithme/maps/adapter/RecyclerCompositeAdapter.java b/android/src/com/mapswithme/maps/adapter/RecyclerCompositeAdapter.java index 53f547cbce..8138bf7827 100644 --- a/android/src/com/mapswithme/maps/adapter/RecyclerCompositeAdapter.java +++ b/android/src/com/mapswithme/maps/adapter/RecyclerCompositeAdapter.java @@ -96,12 +96,12 @@ public class RecyclerCompositeAdapter extends RecyclerView.Adapter items = getIndexAndViewTypeItems(); - int indexOf = items.indexOf(type); + int indexOf = items.indexOf(indexAndViewType); if (indexOf < 0) { - throw new IllegalArgumentException("Item " + relViewType + " not found in list : " + + throw new IllegalArgumentException("Item " + indexAndViewType + " not found in list : " + Arrays.toString(items.toArray())); } return indexOf; diff --git a/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java b/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java index 8242238b95..bd60b7cd77 100644 --- a/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java +++ b/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java @@ -222,7 +222,7 @@ public class CachedBookmarkCategoriesFragment extends BaseBookmarkCategoriesFrag @Override public void onCustomPropertiesReceived(boolean successful, - @NonNull CatalogCustomProperty[] properties) + @NonNull List properties) { //TODO(@alexzatsepin): Implement me if necessary } diff --git a/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java b/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java index 7c57506fad..16afe5830c 100644 --- a/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java +++ b/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java @@ -303,8 +303,9 @@ public enum BookmarkManager public void onCustomPropertiesReceived(boolean successful, @NonNull CatalogCustomProperty[] properties) { + List unmodifiableProperties = Collections.unmodifiableList(Arrays.asList(properties)); for (BookmarksCatalogListener listener : mCatalogListeners) - listener.onCustomPropertiesReceived(successful, properties); + listener.onCustomPropertiesReceived(successful, unmodifiableProperties); } // Called from JNI. @@ -832,12 +833,11 @@ public enum BookmarkManager /** * The method is called when the custom properties were received from the server. - * - * @param successful is the result of the receiving. + * @param successful is the result of the receiving. * @param properties is the properties collection. */ void onCustomPropertiesReceived(boolean successful, - @NonNull CatalogCustomProperty[] properties); + @NonNull List properties); /** * The method is called when the uploading to the catalog is started. @@ -882,7 +882,7 @@ public enum BookmarkManager @Override public void onCustomPropertiesReceived(boolean successful, - @NonNull CatalogCustomProperty[] properties) + @NonNull List properties) { /* do noting by default */ } diff --git a/android/src/com/mapswithme/maps/bookmarks/data/CatalogCustomProperty.java b/android/src/com/mapswithme/maps/bookmarks/data/CatalogCustomProperty.java index 2292b08ea0..9760b969ba 100644 --- a/android/src/com/mapswithme/maps/bookmarks/data/CatalogCustomProperty.java +++ b/android/src/com/mapswithme/maps/bookmarks/data/CatalogCustomProperty.java @@ -2,6 +2,10 @@ package com.mapswithme.maps.bookmarks.data; import android.support.annotation.NonNull; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + public class CatalogCustomProperty { @NonNull @@ -13,7 +17,7 @@ public class CatalogCustomProperty private final boolean mRequired; @NonNull - private final CatalogCustomPropertyOption[] mOptions; + private final List mOptions; public CatalogCustomProperty(@NonNull String key, @NonNull String localizedName, boolean required, @NonNull CatalogCustomPropertyOption[] options) @@ -21,7 +25,7 @@ public class CatalogCustomProperty mKey = key; mLocalizedName = localizedName; mRequired = required; - mOptions = options; + mOptions = Collections.unmodifiableList(Arrays.asList(options)); } @NonNull @@ -33,5 +37,5 @@ public class CatalogCustomProperty public boolean isRequired() { return mRequired; } @NonNull - public CatalogCustomPropertyOption[] getOptions() { return mOptions; } + public List getOptions() { return mOptions; } } diff --git a/android/src/com/mapswithme/maps/ugc/routes/UgcRoutesFragment.java b/android/src/com/mapswithme/maps/ugc/routes/UgcRoutesFragment.java index d7ae0bd249..b78be95591 100644 --- a/android/src/com/mapswithme/maps/ugc/routes/UgcRoutesFragment.java +++ b/android/src/com/mapswithme/maps/ugc/routes/UgcRoutesFragment.java @@ -26,13 +26,13 @@ import com.mapswithme.maps.adapter.TagsCompositeAdapter; import com.mapswithme.maps.base.BaseMwmFragment; import com.mapswithme.maps.adapter.OnItemClickListener; import com.mapswithme.maps.bookmarks.data.BookmarkManager; +import com.mapswithme.maps.bookmarks.data.CatalogCustomProperty; import com.mapswithme.maps.bookmarks.data.CatalogTag; import com.mapswithme.maps.bookmarks.data.CatalogTagsGroup; import com.mapswithme.maps.widget.recycler.ItemDecoratorFactory; import com.mapswithme.util.UiUtils; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -175,6 +175,13 @@ public class UgcRoutesFragment extends BaseMwmFragment implements BookmarkManage installTags(tagsGroups); } + @Override + public void onCustomPropertiesReceived(boolean successful, + @NonNull List properties) + { + /* Not ready yet */ + } + private void installTags(@NonNull List tagsGroups) { List savedStateTags = validateSavedState(mSavedInstanceState); diff --git a/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java b/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java index 146540f8fb..eb60e78e68 100644 --- a/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java +++ b/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java @@ -28,6 +28,8 @@ import com.mapswithme.maps.widget.ToolbarController; import com.mapswithme.util.ConnectionState; import com.mapswithme.util.UiUtils; +import java.util.List; + public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment implements BookmarkManager.BookmarksCatalogListener { private static final String NO_NETWORK_CONNECTION_DIALOG_TAG = "no_network_connection_dialog"; @@ -244,14 +246,14 @@ public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment impl } @Override - public void onTagsReceived(boolean successful, @NonNull CatalogTagsGroup[] tagsGroups) + public void onTagsReceived(boolean successful, @NonNull List tagsGroups) { } @Override public void onCustomPropertiesReceived(boolean successful, - @NonNull CatalogCustomProperty[] properties) + @NonNull List properties) { }