forked from organicmaps/organicmaps
[android] Removed redundant 'open bookmark list' fragment argument
This commit is contained in:
parent
d9e00c0723
commit
c2a8894b5f
3 changed files with 7 additions and 10 deletions
|
@ -2774,7 +2774,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
mPlacePageToolbar.setTitle(name);
|
||||
mPlacePageToolbar.setNavigationOnClickListener(v -> {
|
||||
BookmarkCategory category = BookmarkManager.INSTANCE.getCategoryById(categoryId);
|
||||
BookmarkCategoriesActivity.startForResult(this, category, true);
|
||||
BookmarkCategoriesActivity.startForResult(this, category);
|
||||
closePlacePage();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -68,13 +68,12 @@ public class BookmarkCategoriesActivity extends BaseToolbarActivity
|
|||
}
|
||||
|
||||
public static void startForResult(@NonNull Activity context, int initialPage,
|
||||
@Nullable String catalogDeeplink, boolean openBookmarkList,
|
||||
@Nullable String catalogDeeplink,
|
||||
@Nullable BookmarkCategory category)
|
||||
{
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(BookmarkCategoriesPagerFragment.ARG_CATEGORIES_PAGE, initialPage);
|
||||
args.putString(BookmarkCategoriesPagerFragment.ARG_CATALOG_DEEPLINK, catalogDeeplink);
|
||||
args.putBoolean(BookmarkCategoriesPagerFragment.ARG_OPEN_BOOKMARK_LIST, openBookmarkList);
|
||||
args.putParcelable(BookmarksListFragment.EXTRA_CATEGORY, category);
|
||||
Intent intent = new Intent(context, BookmarkCategoriesActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).putExtras(args);
|
||||
|
@ -84,19 +83,18 @@ public class BookmarkCategoriesActivity extends BaseToolbarActivity
|
|||
public static void startForResult(@NonNull Activity context, int initialPage,
|
||||
@Nullable String catalogDeeplink)
|
||||
{
|
||||
startForResult(context, initialPage, catalogDeeplink, false, null);
|
||||
startForResult(context, initialPage, catalogDeeplink, null);
|
||||
}
|
||||
|
||||
public static void startForResult(@NonNull Activity context)
|
||||
{
|
||||
int initialPage = SharedPropertiesUtils.getLastVisibleBookmarkCategoriesPage(context);
|
||||
startForResult(context, initialPage, null, false, null);
|
||||
startForResult(context, initialPage, null, null);
|
||||
}
|
||||
|
||||
public static void startForResult(@NonNull Activity context, @Nullable BookmarkCategory category,
|
||||
boolean openBookmarkList)
|
||||
public static void startForResult(@NonNull Activity context, @Nullable BookmarkCategory category)
|
||||
{
|
||||
int initialPage = SharedPropertiesUtils.getLastVisibleBookmarkCategoriesPage(context);
|
||||
startForResult(context, initialPage, null, true, category);
|
||||
startForResult(context, initialPage, null, category);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
|
|||
{
|
||||
final static String ARG_CATEGORIES_PAGE = "arg_categories_page";
|
||||
final static String ARG_CATALOG_DEEPLINK = "arg_catalog_deeplink";
|
||||
final static String ARG_OPEN_BOOKMARK_LIST = "arg_open_bookmark_list";
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
|
@ -103,7 +102,7 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
|
|||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
Bundle args = getArguments();
|
||||
if (args != null && args.getBoolean(ARG_OPEN_BOOKMARK_LIST))
|
||||
if (args != null)
|
||||
{
|
||||
BookmarkCategory category = args.getParcelable(BookmarksListFragment.EXTRA_CATEGORY);
|
||||
if (category == null)
|
||||
|
|
Loading…
Add table
Reference in a new issue