forked from organicmaps/organicmaps
[android] Review fixes
This commit is contained in:
parent
a2709ed16d
commit
043240076f
2 changed files with 58 additions and 55 deletions
|
@ -1401,61 +1401,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
}
|
||||
}
|
||||
|
||||
public static class ShowAuthorizationTask implements MapTask
|
||||
{
|
||||
@Override
|
||||
public boolean run(MwmActivity target)
|
||||
{
|
||||
final DialogFragment fragment = (DialogFragment) Fragment.instantiate(target, AuthDialogFragment.class.getName());
|
||||
fragment.show(target.getSupportFragmentManager(), AuthDialogFragment.class.getName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class BaseUserMarkTask implements MapTask
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
final int mCategoryId;
|
||||
final int mId;
|
||||
|
||||
BaseUserMarkTask(int categoryId, int id)
|
||||
{
|
||||
mCategoryId = categoryId;
|
||||
mId = id;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShowBookmarkTask extends BaseUserMarkTask
|
||||
{
|
||||
public ShowBookmarkTask(int categoryId, int bookmarkId)
|
||||
{
|
||||
super(categoryId, bookmarkId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(MwmActivity target)
|
||||
{
|
||||
BookmarkManager.INSTANCE.nativeShowBookmarkOnMap(mCategoryId, mId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShowTrackTask extends BaseUserMarkTask
|
||||
{
|
||||
public ShowTrackTask(int categoryId, int trackId)
|
||||
{
|
||||
super(categoryId, trackId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(MwmActivity target)
|
||||
{
|
||||
Framework.nativeShowTrackRect(mCategoryId, mId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void adjustCompass(int offsetY)
|
||||
{
|
||||
if (mMapFragment == null || !mMapFragment.isAdded())
|
||||
|
@ -1910,4 +1855,59 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
return mMapFragment != null && !mMapFragment.isFirstStart();
|
||||
}
|
||||
|
||||
public static class ShowAuthorizationTask implements MapTask
|
||||
{
|
||||
@Override
|
||||
public boolean run(MwmActivity target)
|
||||
{
|
||||
final DialogFragment fragment = (DialogFragment) Fragment.instantiate(target, AuthDialogFragment.class.getName());
|
||||
fragment.show(target.getSupportFragmentManager(), AuthDialogFragment.class.getName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class BaseUserMarkTask implements MapTask
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
final int mCategoryId;
|
||||
final int mId;
|
||||
|
||||
BaseUserMarkTask(int categoryId, int id)
|
||||
{
|
||||
mCategoryId = categoryId;
|
||||
mId = id;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShowBookmarkTask extends BaseUserMarkTask
|
||||
{
|
||||
public ShowBookmarkTask(int categoryId, int bookmarkId)
|
||||
{
|
||||
super(categoryId, bookmarkId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(MwmActivity target)
|
||||
{
|
||||
BookmarkManager.INSTANCE.nativeShowBookmarkOnMap(mCategoryId, mId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShowTrackTask extends BaseUserMarkTask
|
||||
{
|
||||
public ShowTrackTask(int categoryId, int trackId)
|
||||
{
|
||||
super(categoryId, trackId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(MwmActivity target)
|
||||
{
|
||||
Framework.nativeShowTrackRect(mCategoryId, mId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -914,6 +914,9 @@ void Framework::ShowBookmark(BookmarkAndCategory const & bnc)
|
|||
place_page::Info info;
|
||||
FillBookmarkInfo(*mark, bnc, info);
|
||||
ActivateMapSelection(true, df::SelectionShape::OBJECT_USER_MARK, info);
|
||||
//TODO
|
||||
//We need to preserve bookmark id in the m_lastTapEvent.
|
||||
//Because in one feature can be several bokmarks.
|
||||
m_lastTapEvent = MakeTapEvent(info.GetMercator(), info.GetID(), TapEvent::Source::Other);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue