MWMActivity doesn't recreate itself after orientation changes.

This commit is contained in:
rachytski 2012-07-30 00:40:11 -07:00 committed by Alex Zolotarev
parent 4ecc0e4659
commit 4d56714de8
4 changed files with 20 additions and 4 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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();

View file

@ -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