forked from organicmaps/organicmaps
[android] Correct "Map" button behaviour in downloader.
This commit is contained in:
parent
30373d6d26
commit
7096acad1b
2 changed files with 16 additions and 7 deletions
|
@ -36,7 +36,8 @@ namespace android
|
|||
m_hasSecond(false),
|
||||
m_mask(0),
|
||||
m_isInsideDoubleClick(false),
|
||||
m_isCleanSingleClick(false)
|
||||
m_isCleanSingleClick(false),
|
||||
m_doLoadState(true)
|
||||
{
|
||||
ASSERT(g_framework == 0, ());
|
||||
g_framework = this;
|
||||
|
@ -73,7 +74,7 @@ namespace android
|
|||
m_work.OnGpsUpdate(info);
|
||||
}
|
||||
|
||||
void Framework::OnCompassUpdated(uint64_t timestamp, double magneticNorth, double trueNorth, float accuracy)
|
||||
void Framework::OnCompassUpdated(uint64_t timestamp, double magneticNorth, double trueNorth, double accuracy)
|
||||
{
|
||||
location::CompassInfo info;
|
||||
info.m_timestamp = static_cast<double>(timestamp);
|
||||
|
@ -142,7 +143,10 @@ namespace android
|
|||
try
|
||||
{
|
||||
m_work.SetRenderPolicy(CreateRenderPolicy(rpParams));
|
||||
LoadState();
|
||||
if (m_doLoadState)
|
||||
LoadState();
|
||||
else
|
||||
m_doLoadState = true;
|
||||
}
|
||||
catch (yg::gl::platform_unsupported const & e)
|
||||
{
|
||||
|
@ -357,8 +361,8 @@ namespace android
|
|||
|
||||
void Framework::ShowCountry(m2::RectD const & r)
|
||||
{
|
||||
// TODO: due to activity recreation, we need to set rect in saved state here
|
||||
//m_work.ShowRect(r);
|
||||
m_doLoadState = false;
|
||||
m_work.ShowRect(r);
|
||||
}
|
||||
|
||||
void Framework::LoadState()
|
||||
|
|
|
@ -40,13 +40,16 @@ namespace android
|
|||
bool m_hasSecond;
|
||||
int m_mask;
|
||||
|
||||
/// single click processing parameters
|
||||
bool m_doLoadState;
|
||||
|
||||
/// @name Single click processing parameters.
|
||||
//@{
|
||||
my::Timer m_doubleClickTimer;
|
||||
bool m_isInsideDoubleClick;
|
||||
bool m_isCleanSingleClick;
|
||||
double m_lastX1;
|
||||
double m_lastY1;
|
||||
//@}
|
||||
|
||||
math::AvgVector<float, 3> m_sensors[2];
|
||||
|
||||
|
@ -60,7 +63,7 @@ namespace android
|
|||
|
||||
void OnLocationStatusChanged(int/* == location::TLocationStatus*/ newStatus);
|
||||
void OnLocationUpdated(uint64_t time, double lat, double lon, float accuracy);
|
||||
void OnCompassUpdated(uint64_t time, double magneticNorth, double trueNorth, float accuracy);
|
||||
void OnCompassUpdated(uint64_t time, double magneticNorth, double trueNorth, double accuracy);
|
||||
void UpdateCompassSensor(int ind, float * arr);
|
||||
|
||||
void Invalidate();
|
||||
|
@ -76,6 +79,8 @@ namespace android
|
|||
void Zoom(int mode, double x1, double y1, double x2, double y2);
|
||||
void Touch(int action, int mask, double x1, double y1, double x2, double y2);
|
||||
|
||||
/// Show rect from another activity. Ensure that no LoadState will be called,
|
||||
/// when maim map activity will become active.
|
||||
void ShowCountry(m2::RectD const & r);
|
||||
|
||||
void LoadState();
|
||||
|
|
Loading…
Add table
Reference in a new issue