forked from organicmaps/organicmaps
[bookmarks][android] Added sorting progress bar.
This commit is contained in:
parent
4d7e91fa3d
commit
c467b7a40c
2 changed files with 22 additions and 0 deletions
8
android/res/layout/toolbar_menu_progressbar.xml
Normal file
8
android/res/layout/toolbar_menu_progressbar.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ProgressBar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="@dimen/height_block_base"
|
||||
android:layout_height="@dimen/height_block_base"
|
||||
android:padding="@dimen/margin_half"
|
||||
android:background="@null"/>
|
|
@ -342,6 +342,8 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
BookmarkListAdapter adapter = getAdapter();
|
||||
adapter.setSortedResults(sortedBlocks);
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
updateSortingProgressBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -354,6 +356,8 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
BookmarkListAdapter adapter = getAdapter();
|
||||
adapter.setSortedResults(null);
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
updateSortingProgressBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -373,6 +377,8 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
BookmarkManager.INSTANCE.setLastSortingType(catId, sortingType);
|
||||
BookmarkManager.INSTANCE.getSortedCategory(catId, sortingType, hasMyPosition, lat, lon,
|
||||
mLastSortTimestamp);
|
||||
|
||||
updateSortingProgressBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -481,6 +487,11 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
return !isDownloadedCategory() && BookmarkManager.INSTANCE.isSearchAllowed(category.getId());
|
||||
}
|
||||
|
||||
private void updateSortingProgressBar()
|
||||
{
|
||||
requireActivity().invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
public void onItemClick(int position)
|
||||
{
|
||||
final Intent i = new Intent(requireActivity(), MwmActivity.class);
|
||||
|
@ -655,6 +666,9 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
|
||||
MenuItem itemMore = menu.findItem(R.id.bookmarks_more);
|
||||
itemMore.setVisible(visible);
|
||||
|
||||
if (mLastSortTimestamp != 0)
|
||||
itemMore.setActionView(R.layout.toolbar_menu_progressbar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue