forked from organicmaps/organicmaps
MWMActivity doesn't recreate itself after orientation changes.
This commit is contained in:
parent
4ecc0e4659
commit
4d56714de8
4 changed files with 20 additions and 4 deletions
|
@ -42,7 +42,8 @@
|
|||
<activity android:name="com.mapswithme.maps.MWMActivity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/MWMNoTitle">
|
||||
android:theme="@style/MWMNoTitle"
|
||||
android:configChanges="orientation|screenLayout|screenSize">
|
||||
</activity>
|
||||
<activity android:name="com.mapswithme.maps.DownloadUI"
|
||||
android:label="@string/download_maps"
|
||||
|
|
|
@ -42,7 +42,8 @@
|
|||
<activity android:name="com.mapswithme.maps.MWMActivity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/MWMNoTitle">
|
||||
android:theme="@style/MWMNoTitle"
|
||||
android:configChanges="orientation|screenLayout|screenSize">
|
||||
</activity>
|
||||
<activity android:name="com.mapswithme.maps.DownloadUI"
|
||||
android:label="@string/download_maps"
|
||||
|
|
|
@ -254,6 +254,7 @@ int32_t NVEventAppMain(int32_t argc, char** argv)
|
|||
s_densityDpi = ev->m_data.m_size.m_density;
|
||||
|
||||
g_framework->Resize(s_winWidth, s_winHeight);
|
||||
g_framework->NativeFramework()->Invalidate(true);
|
||||
/* if (shouldLoadState)
|
||||
{
|
||||
g_framework->LoadState();
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
|
@ -234,6 +235,13 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig)
|
||||
{
|
||||
super.onConfigurationChanged(newConfig);
|
||||
alignZoomButtons();
|
||||
}
|
||||
|
||||
private void showFacebookPage()
|
||||
{
|
||||
Intent intent = null;
|
||||
|
@ -401,6 +409,13 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
|
||||
nativeConnectDownloadButton();
|
||||
|
||||
alignZoomButtons();
|
||||
|
||||
//m_timer = new VideoTimer();
|
||||
}
|
||||
|
||||
private void alignZoomButtons()
|
||||
{
|
||||
// Get screen density
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
|
@ -413,8 +428,6 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
lp.setMargins(margin, (metrics.heightPixels / 4) - offs, margin, margin);
|
||||
findViewById(R.id.map_button_plus).setLayoutParams(lp);
|
||||
|
||||
//m_timer = new VideoTimer();
|
||||
}
|
||||
|
||||
/// @name From Location interface
|
||||
|
|
Loading…
Add table
Reference in a new issue