[core] hide place page on second click

This commit is contained in:
ExMix 2014-06-18 11:55:09 +03:00 committed by Alex Zolotarev
parent 331234daed
commit 037ac82686
7 changed files with 22 additions and 1 deletions

View file

@ -248,7 +248,10 @@ const long long LITE_IDL = 431183278L;
m2::PointD pxClicked(point.x * scaleFactor, point.y * scaleFactor);
Framework & f = GetFramework();
f.GetBalloonManager().OnShowMark(f.GetUserMark(m2::PointD(pxClicked.x, pxClicked.y), isLongClick));
if (f.HasActiveUserMark())
f.GetBalloonManager().Dismiss();
else
f.GetBalloonManager().OnShowMark(f.GetUserMark(m2::PointD(pxClicked.x, pxClicked.y), isLongClick));
}
- (void)onSingleTap:(NSValue *)point

View file

@ -313,6 +313,11 @@ void BookmarkManager::ActivateMark(UserMark const * mark, bool needAnim)
m_selection.ActivateMark(mark, needAnim);
}
bool BookmarkManager::UserMarkHasActive() const
{
return m_selection.IsActive();
}
namespace
{
class BestUserMarkFinder

View file

@ -61,6 +61,7 @@ public:
bool DeleteBmCategory(size_t index);
void ActivateMark(UserMark const * mark, bool needAnim);
bool UserMarkHasActive() const;
UserMark const * FindNearestUserMark(m2::AnyRectD const & rect) const;
/// Additional layer methods

View file

@ -1605,6 +1605,11 @@ void Framework::ActivateUserMark(UserMark const * mark, bool needAnim)
m_bmManager.ActivateMark(mark, needAnim);
}
bool Framework::HasActiveUserMark() const
{
return m_bmManager.UserMarkHasActive();
}
UserMark const * Framework::GetUserMark(m2::PointD const & pxPoint, bool isLongPress)
{
DisconnectMyPositionUpdate();

View file

@ -438,6 +438,7 @@ public:
shared_ptr<location::State> const & GetLocationState() const;
void ActivateUserMark(UserMark const * mark, bool needAnim = true);
bool HasActiveUserMark() const;
UserMark const * GetUserMark(m2::PointD const & pxPoint, bool isLongPress);
PoiMarkPoint * GetAddressMark(m2::PointD const & globalPoint) const;
BookmarkAndCategory FindBookmark(UserMark const * mark) const;

View file

@ -305,6 +305,11 @@ void SelectionContainer::Draw(const PaintOverlayEvent & e, UserMarkDLCache * cac
}
}
bool SelectionContainer::IsActive() const
{
return m_container != NULL;
}
void SelectionContainer::StartActivationAnim()
{

View file

@ -139,6 +139,7 @@ public:
void ActivateMark(UserMark const * userMark, bool needAnim);
void Draw(PaintOverlayEvent const & e, UserMarkDLCache * cache) const;
bool IsActive() const;
private:
/// animation support