forked from organicmaps/organicmaps
[android] Fixed review notes - change formatting
This commit is contained in:
parent
7e3545f77b
commit
8ea499d872
2 changed files with 33 additions and 41 deletions
|
@ -1,30 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<com.cocosw.bottomsheet.ClosableSlidingLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bs_main"
|
||||
<com.cocosw.bottomsheet.ClosableSlidingLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/bs_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?bs_dialogBackground"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="Overdraw">
|
||||
<!--<include layout="?bs_headerLayout" />-->
|
||||
<com.cocosw.bottomsheet.PinnedSectionGridView
|
||||
android:id="@+id/bottom_sheet_gridview"
|
||||
style="?bs_listStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?bs_dialogBackground"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="Overdraw">
|
||||
|
||||
<!--<include layout="?bs_headerLayout" />-->
|
||||
|
||||
<com.cocosw.bottomsheet.PinnedSectionGridView
|
||||
android:id="@+id/bottom_sheet_gridview"
|
||||
style="?bs_listStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fadingEdge="none"
|
||||
android:numColumns="?bs_numColumns"
|
||||
tools:listitem="@layout/bs_grid_entry" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
android:fadingEdge="none"
|
||||
android:numColumns="?bs_numColumns"
|
||||
tools:listitem="@layout/bs_grid_entry"/>
|
||||
</LinearLayout>
|
||||
</com.cocosw.bottomsheet.ClosableSlidingLayout>
|
||||
|
|
|
@ -211,21 +211,11 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
|
||||
case BookmarkListAdapter.TYPE_TRACK:
|
||||
final Track track = (Track) adapter.getItem(mSelectedPosition);
|
||||
BottomSheet bottomSheet = BottomSheetHelper.create(getActivity(), track.getName())
|
||||
.sheet(Menu.NONE, R.drawable.ic_delete,
|
||||
R.string.delete)
|
||||
.listener(new MenuItem.OnMenuItemClickListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem
|
||||
menuItem)
|
||||
{
|
||||
BookmarkManager.INSTANCE.deleteTrack(track
|
||||
.getTrackId());
|
||||
adapter.notifyDataSetChanged();
|
||||
return false;
|
||||
}
|
||||
}).build();
|
||||
BottomSheet bottomSheet = BottomSheetHelper
|
||||
.create(getActivity(), track.getName())
|
||||
.sheet(Menu.NONE, R.drawable.ic_delete, R.string.delete)
|
||||
.listener(menuItem -> onMenuItemClicked(adapter, track))
|
||||
.build();
|
||||
|
||||
BottomSheetHelper.tint(bottomSheet);
|
||||
bottomSheet.show();
|
||||
|
@ -233,6 +223,13 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
}
|
||||
}
|
||||
|
||||
private boolean onMenuItemClicked(@NonNull BookmarkListAdapter adapter, @NonNull Track track)
|
||||
{
|
||||
BookmarkManager.INSTANCE.deleteTrack(track.getTrackId());
|
||||
adapter.notifyDataSetChanged();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreparedFileForSharing(@NonNull BookmarkSharingResult result)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue