forked from organicmaps/organicmaps
[android] Modified JNI method setAllCategoryVisible BookmarkManager
This commit is contained in:
parent
aa5b7c192d
commit
62a24dd77f
4 changed files with 14 additions and 7 deletions
|
@ -552,9 +552,10 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCategoriesVi
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetAllCategoriesVisibility(
|
||||
JNIEnv * env, jobject thiz, jboolean visible)
|
||||
JNIEnv * env, jobject thiz, jboolean visible, jint type)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetAllCategoriesVisibility(static_cast<bool>(visible));
|
||||
auto const filter = static_cast<BookmarkManager::CategoryFilterType>(type);
|
||||
frm()->GetBookmarkManager().SetAllCategoriesVisibility(filter, static_cast<bool>(visible));
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
|
|
|
@ -438,7 +438,6 @@ public enum BookmarkManager
|
|||
|
||||
public boolean areAllCategoriesVisible(BookmarkCategory.Type type)
|
||||
{
|
||||
|
||||
return nativeAreAllCategoriesVisible(type.ordinal());
|
||||
}
|
||||
|
||||
|
@ -459,7 +458,7 @@ public enum BookmarkManager
|
|||
|
||||
public void setAllCategoriesVisibility(boolean visible)
|
||||
{
|
||||
nativeSetAllCategoriesVisibility(visible);
|
||||
nativeSetAllCategoriesVisibility(visible, BookmarkCategory.Type.PRIVATE.ordinal());
|
||||
}
|
||||
|
||||
public int getKmlFilesCountForConversion()
|
||||
|
@ -625,7 +624,7 @@ public enum BookmarkManager
|
|||
|
||||
private static native boolean nativeAreAllCategoriesInvisible(int type);
|
||||
|
||||
private static native void nativeSetAllCategoriesVisibility(boolean visible);
|
||||
private static native void nativeSetAllCategoriesVisibility(boolean visible, int type);
|
||||
|
||||
private static native int nativeGetKmlFilesCountForConversion();
|
||||
|
||||
|
|
|
@ -1804,12 +1804,19 @@ bool BookmarkManager::CheckVisibility(BookmarkManager::CategoryFilterType const
|
|||
return true;
|
||||
}
|
||||
|
||||
void BookmarkManager::SetAllCategoriesVisibility(bool visible)
|
||||
void BookmarkManager::SetAllCategoriesVisibility(BookmarkManager::CategoryFilterType const filter,
|
||||
bool visible)
|
||||
{
|
||||
CHECK_THREAD_CHECKER(m_threadChecker, ());
|
||||
auto session = GetEditSession();
|
||||
|
||||
for (auto & c : m_categories)
|
||||
{
|
||||
auto const fromCatalog = IsCategoryFromCatalog(c.first);
|
||||
if (!IsValidFilterType(filter, fromCatalog))
|
||||
continue;
|
||||
c.second->SetIsVisible(visible);
|
||||
}
|
||||
}
|
||||
|
||||
bool BookmarkManager::CanConvert() const
|
||||
|
|
|
@ -260,7 +260,7 @@ public:
|
|||
bool IsUsedCategoryName(std::string const & name) const;
|
||||
bool AreAllCategoriesVisible(CategoryFilterType const filter) const;
|
||||
bool AreAllCategoriesInvisible(CategoryFilterType const filter) const;
|
||||
void SetAllCategoriesVisibility(bool visible);
|
||||
void SetAllCategoriesVisibility(CategoryFilterType const filter, bool visible);
|
||||
|
||||
// Return number of files for the conversion to the binary format.
|
||||
size_t GetKmlFilesCountForConversion() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue