rhodes 3.3.2.beta.1 → 3.3.2.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +5 -5
- data/Rakefile +1 -1
- data/doc/build.txt +27 -1
- data/doc/device-caps.txt +65 -18
- data/doc/install.txt +5 -3
- data/lib/extensions/barcode/ext/barcode/platform/wm/Barcode.sln +30 -0
- data/lib/extensions/barcode/ext/barcode/platform/wm/Barcode.vcproj +159 -5
- data/lib/extensions/barcode/ext/barcode/platform/wm/Rakefile +1 -1
- data/lib/extensions/digest-md5/ext/Rakefile +2 -2
- data/lib/extensions/digest-md5/ext/digest-md5.sln +44 -0
- data/lib/extensions/digest-sha1/ext/Rakefile +2 -2
- data/lib/extensions/digest-sha1/ext/digest-sha1.sln +44 -0
- data/lib/framework/rho/rhofsconnector.rb +9 -6
- data/lib/framework/rhom/rhom_db_adapter.rb +10 -0
- data/platform/android/Rhodes/jni/src/logconf.cpp +5 -0
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +7 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +82 -37
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoLogConf.java +2 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +8 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +87 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +77 -159
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +4 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +6 -31
- data/platform/iphone/Classes/AppManager/AppManager.m +106 -29
- data/platform/iphone/Classes/Rhodes.m +27 -0
- data/platform/iphone/rbuild/iphone.rake +1 -1
- data/platform/shared/common/RhodesApp.cpp +10 -2
- data/platform/shared/common/RhodesAppBase.cpp +20 -4
- data/platform/shared/common/RhodesAppBase.h +4 -0
- data/platform/shared/db/DBAdapter.cpp +4 -6
- data/platform/shared/logging/RhoLogConf.cpp +2 -7
- data/platform/shared/logging/RhoLogConf.h +4 -0
- data/platform/shared/net/HttpServer.cpp +2 -2
- data/platform/shared/net/RawSocket.cpp +3 -0
- data/platform/shared/ruby/ext/rho/rhoruby.c +7 -3
- data/platform/shared/ruby/ext/rho/rhoruby.h +2 -1
- data/platform/shared/ruby/ext/rho/rhosupport.c +9 -3
- data/platform/shared/ruby/ext/system/system.i +4 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +40 -1
- data/platform/wm/build/wm.rake +15 -5
- data/platform/wm/rhodes/LogView.cpp +25 -1
- data/platform/wm/rhodes/LogView.h +13 -0
- data/platform/wm/rhodes/MainWindow.cpp +4 -0
- data/platform/wm/rhodes/Rhodes.cpp +1 -1
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +240 -145
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +24 -5
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +8 -1
- data/platform/wm/tools/detool/detool.cpp +88 -7
- data/platform/wm/tools/detool/detool.vcproj +2 -2
- data/platform/wm/tools/detool/stdafx.h +1 -0
- data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +2 -2
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +4 -4
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +8 -3
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +25 -6
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +23 -13
- data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +6 -1
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +33 -2
- data/platform/wp7/build/wp.rake +52 -0
- data/rakefile.rb +1 -1
- data/res/build-tools/detool.exe +0 -0
- data/res/generators/rhogen.rb +5 -0
- data/res/generators/templates/application/app/Settings/controller.rb +1 -1
- data/res/generators/templates/application/app/Settings/err_sync.erb +11 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/wm/Montana.sln +22 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/wm/Rakefile +2 -2
- data/spec/phone_spec/app/SpecRunner/index.erb +0 -1
- data/spec/phone_spec/app/spec/asynchttp_spec.rb +1 -11
- data/spec/phone_spec/app/spec/blobsync_spec.rb +7 -2
- data/spec/phone_spec/app/spec/date_spec.rb +1 -1
- data/spec/phone_spec/app/spec/json_spec.rb +0 -3
- data/spec/phone_spec/app/spec/syncengine_spec.rb +6 -2
- data/spec/phone_spec/app/spec_runner.rb +10 -7
- data/version +1 -1
- metadata +9 -9
- data/platform/wm/tools/wmdc_connect/stdafx.cpp +0 -27
- data/platform/wm/tools/wmdc_connect/stdafx.h +0 -35
- data/platform/wm/tools/wmdc_connect/wmdc_connect.cpp +0 -119
- data/platform/wm/tools/wmdc_connect/wmdc_connect.vcproj +0 -205
- data/platform/wm/tools/wmdc_connect.sln +0 -20
@@ -66,8 +66,6 @@ import com.rhomobile.rhodes.util.ContextFactory;
|
|
66
66
|
import com.rhomobile.rhodes.util.PerformOnUiThread;
|
67
67
|
import com.rhomobile.rhodes.util.PhoneId;
|
68
68
|
import com.rhomobile.rhodes.util.Utils;
|
69
|
-
import com.rhomobile.rhodes.util.Utils.AssetsSource;
|
70
|
-
import com.rhomobile.rhodes.util.Utils.FileSource;
|
71
69
|
|
72
70
|
import android.app.AlertDialog;
|
73
71
|
import android.app.Notification;
|
@@ -81,10 +79,10 @@ import android.content.DialogInterface;
|
|
81
79
|
import android.content.Intent;
|
82
80
|
import android.content.IntentFilter;
|
83
81
|
import android.content.pm.ActivityInfo;
|
84
|
-
import android.content.pm.ApplicationInfo;
|
85
82
|
import android.content.pm.PackageInfo;
|
86
83
|
import android.content.pm.PackageManager;
|
87
84
|
import android.content.pm.PackageManager.NameNotFoundException;
|
85
|
+
import android.content.res.Configuration;
|
88
86
|
import android.net.ConnectivityManager;
|
89
87
|
import android.net.NetworkInfo;
|
90
88
|
import android.net.Uri;
|
@@ -95,9 +93,7 @@ import android.os.Handler;
|
|
95
93
|
import android.os.IBinder;
|
96
94
|
import android.os.PowerManager;
|
97
95
|
import android.telephony.TelephonyManager;
|
98
|
-
import android.util.DisplayMetrics;
|
99
96
|
import android.util.Log;
|
100
|
-
import android.view.Display;
|
101
97
|
import android.view.WindowManager;
|
102
98
|
import android.webkit.WebSettings;
|
103
99
|
import android.webkit.WebView;
|
@@ -143,13 +139,6 @@ public class RhodesService extends Service {
|
|
143
139
|
|
144
140
|
private NotificationManager mNM;
|
145
141
|
|
146
|
-
private static int mScreenWidth;
|
147
|
-
private static int mScreenHeight;
|
148
|
-
private static int mScreenOrientation;
|
149
|
-
|
150
|
-
private static float mScreenPpiX;
|
151
|
-
private static float mScreenPpiY;
|
152
|
-
|
153
142
|
private static boolean mCameraAvailable;
|
154
143
|
|
155
144
|
private static int sActivitiesActive;
|
@@ -233,8 +222,6 @@ public class RhodesService extends Service {
|
|
233
222
|
|
234
223
|
Handler mHandler = null;
|
235
224
|
|
236
|
-
private native void initClassLoader(ClassLoader c);
|
237
|
-
|
238
225
|
public native void doSyncAllSources(boolean v);
|
239
226
|
public native void doSyncSource(String source);
|
240
227
|
|
@@ -247,8 +234,6 @@ public class RhodesService extends Service {
|
|
247
234
|
|
248
235
|
public static native void navigateBack();
|
249
236
|
|
250
|
-
private String mRootPath;
|
251
|
-
|
252
237
|
public static native void onScreenOrientationChanged(int width, int height, int angle);
|
253
238
|
|
254
239
|
public static native void callUiCreatedCallback();
|
@@ -277,36 +262,6 @@ public class RhodesService extends Service {
|
|
277
262
|
return phoneId;
|
278
263
|
}
|
279
264
|
|
280
|
-
public String getRootPath() {
|
281
|
-
return mRootPath;
|
282
|
-
}
|
283
|
-
|
284
|
-
// TODO: Move these methods to RhodesApplication class
|
285
|
-
private ApplicationInfo getAppInfo() {
|
286
|
-
Context context = this;
|
287
|
-
String pkgName = context.getPackageName();
|
288
|
-
try {
|
289
|
-
ApplicationInfo info = context.getPackageManager().getApplicationInfo(pkgName, 0);
|
290
|
-
return info;
|
291
|
-
} catch (NameNotFoundException e) {
|
292
|
-
throw new RuntimeException("Internal error: package " + pkgName + " not found: " + e.getMessage());
|
293
|
-
}
|
294
|
-
}
|
295
|
-
|
296
|
-
private boolean isAppHashChanged() {
|
297
|
-
try {
|
298
|
-
File hash = new File(this.getRootPath(), "hash");
|
299
|
-
if (!hash.exists())
|
300
|
-
return true;
|
301
|
-
|
302
|
-
FileSource as = new AssetsSource(this.getResources().getAssets());
|
303
|
-
FileSource fs = new FileSource();
|
304
|
-
return !Utils.isContentsEquals(as, "hash", fs, hash.getPath());
|
305
|
-
}
|
306
|
-
catch (IOException e) {
|
307
|
-
return true;
|
308
|
-
}
|
309
|
-
}
|
310
265
|
public class LocalBinder extends Binder {
|
311
266
|
RhodesService getService() {
|
312
267
|
return RhodesService.this;
|
@@ -315,99 +270,43 @@ public class RhodesService extends Service {
|
|
315
270
|
|
316
271
|
@Override
|
317
272
|
public IBinder onBind(Intent intent) {
|
318
|
-
|
319
|
-
Log.d(TAG, "+++ onBind");
|
273
|
+
Logger.D(TAG, "onBind");
|
320
274
|
return mBinder;
|
321
275
|
}
|
322
|
-
|
276
|
+
|
323
277
|
@Override
|
324
278
|
public void onCreate() {
|
325
|
-
|
326
|
-
|
327
|
-
Log.d(TAG, "+++ onCreate");
|
328
|
-
|
279
|
+
Logger.D(TAG, "onCreate");
|
280
|
+
|
329
281
|
sInstance = this;
|
330
|
-
|
282
|
+
|
331
283
|
Context context = this;
|
332
|
-
|
284
|
+
|
333
285
|
mNM = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
334
|
-
|
335
|
-
initClassLoader(context.getClassLoader());
|
336
|
-
|
337
|
-
ApplicationInfo appInfo = getAppInfo();
|
338
286
|
|
339
|
-
|
287
|
+
LocalFileProvider.revokeUriPermissions(this);
|
340
288
|
|
341
|
-
|
342
|
-
|
343
|
-
RhoFileApi.init(this);
|
344
|
-
} catch (IOException e) {
|
345
|
-
Log.e(TAG, e.getMessage());
|
346
|
-
exit();
|
347
|
-
return;
|
348
|
-
}
|
349
|
-
|
350
|
-
if (this.isAppHashChanged()) {
|
351
|
-
try {
|
352
|
-
Log.i(TAG, "Application hash was changed");
|
353
|
-
|
354
|
-
File libDir = new File(getRootPath(), "lib");
|
355
|
-
File testLib = new File(libDir.getPath(), "rhoframework.iseq");
|
356
|
-
if(libDir.isDirectory() && testLib.isFile())
|
357
|
-
{
|
358
|
-
Log.i(TAG, "Updating from very old rhodes version, clean filesystem.");
|
359
|
-
Utils.deleteChildrenIgnoreFirstLevel(new File(getRootPath(), "apps"), "rhoconfig.txt");
|
360
|
-
Utils.deleteRecursively(libDir);
|
361
|
-
}
|
362
|
-
|
363
|
-
LocalFileProvider.revokeUriPermissions(context);
|
289
|
+
Logger.I("Rhodes", "Loading...");
|
290
|
+
RhodesApplication.create();
|
364
291
|
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
exit();
|
371
|
-
return;
|
372
|
-
}
|
373
|
-
}
|
374
|
-
|
375
|
-
RhodesApplication.create();
|
376
|
-
//Logger is initialized from this point
|
292
|
+
RhodesActivity ra = RhodesActivity.getInstance();
|
293
|
+
if (ra != null) {
|
294
|
+
// Show splash screen only if we have active activity
|
295
|
+
SplashScreen splashScreen = ra.getSplashScreen();
|
296
|
+
splashScreen.start();
|
377
297
|
|
378
|
-
|
298
|
+
// Increase WebView rendering priority
|
299
|
+
WebView w = new WebView(context);
|
300
|
+
WebSettings webSettings = w.getSettings();
|
301
|
+
webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
|
302
|
+
}
|
379
303
|
|
380
|
-
RhodesActivity ra = RhodesActivity.getInstance();
|
381
|
-
if (ra != null) {
|
382
|
-
// Show splash screen only if we have active activity
|
383
|
-
SplashScreen splashScreen = ra.getSplashScreen();
|
384
|
-
splashScreen.start();
|
385
|
-
}
|
386
|
-
|
387
304
|
initForegroundServiceApi();
|
388
|
-
|
389
305
|
setFullscreenParameters();
|
390
|
-
|
391
|
-
// Increase WebView rendering priority
|
392
|
-
WebView w = new WebView(context);
|
393
|
-
WebSettings webSettings = w.getSettings();
|
394
|
-
webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
|
395
|
-
|
396
|
-
// Get screen width/height
|
397
|
-
WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
|
398
|
-
Display d = wm.getDefaultDisplay();
|
399
|
-
mScreenHeight = d.getHeight();
|
400
|
-
mScreenWidth = d.getWidth();
|
401
|
-
mScreenOrientation = d.getOrientation();
|
402
|
-
|
403
|
-
DisplayMetrics metrics = new DisplayMetrics();
|
404
|
-
d.getMetrics(metrics);
|
405
|
-
mScreenPpiX = metrics.xdpi;
|
406
|
-
mScreenPpiY = metrics.ydpi;
|
407
|
-
|
306
|
+
|
408
307
|
// TODO: detect camera availability
|
409
308
|
mCameraAvailable = true;
|
410
|
-
|
309
|
+
|
411
310
|
// Register custom uri handlers here
|
412
311
|
mUriHandlers.addElement(new ExternalHttpHandler(context));
|
413
312
|
mUriHandlers.addElement(new LocalFileHandler(context));
|
@@ -415,7 +314,7 @@ public class RhodesService extends Service {
|
|
415
314
|
mUriHandlers.addElement(new TelUriHandler(context));
|
416
315
|
mUriHandlers.addElement(new SmsUriHandler(context));
|
417
316
|
mUriHandlers.addElement(new VideoUriHandler(context));
|
418
|
-
|
317
|
+
|
419
318
|
if (Capabilities.PUSH_ENABLED) {
|
420
319
|
Logger.D(TAG, "Push is enabled");
|
421
320
|
try {
|
@@ -638,20 +537,6 @@ public class RhodesService extends Service {
|
|
638
537
|
});
|
639
538
|
}
|
640
539
|
|
641
|
-
public void rereadScreenProperties() {
|
642
|
-
// check for orientarion changed
|
643
|
-
// Get screen width/height
|
644
|
-
WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
|
645
|
-
Display d = wm.getDefaultDisplay();
|
646
|
-
mScreenHeight = d.getHeight();
|
647
|
-
mScreenWidth = d.getWidth();
|
648
|
-
int newScreenOrientation = d.getOrientation();
|
649
|
-
if (newScreenOrientation != mScreenOrientation) {
|
650
|
-
onScreenOrientationChanged(mScreenWidth, mScreenHeight, 90);
|
651
|
-
mScreenOrientation = newScreenOrientation;
|
652
|
-
}
|
653
|
-
}
|
654
|
-
|
655
540
|
public static void showAboutDialog() {
|
656
541
|
PerformOnUiThread.exec(new Runnable() {
|
657
542
|
public void run() {
|
@@ -782,16 +667,43 @@ public class RhodesService extends Service {
|
|
782
667
|
String cl = Locale.getDefault().getCountry();
|
783
668
|
return cl;
|
784
669
|
}
|
670
|
+
|
671
|
+
public static int getScreenWidth() {
|
672
|
+
if (BaseActivity.getScreenProperties() != null)
|
673
|
+
return BaseActivity.getScreenProperties().getWidth();
|
674
|
+
else
|
675
|
+
return 0;
|
676
|
+
}
|
785
677
|
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
678
|
+
public static int getScreenHeight() {
|
679
|
+
if (BaseActivity.getScreenProperties() != null)
|
680
|
+
return BaseActivity.getScreenProperties().getHeight();
|
681
|
+
else
|
682
|
+
return 0;
|
683
|
+
}
|
684
|
+
|
685
|
+
public static float getScreenPpiX() {
|
686
|
+
if (BaseActivity.getScreenProperties() != null)
|
687
|
+
return BaseActivity.getScreenProperties().getPpiX();
|
688
|
+
else
|
689
|
+
return 0;
|
690
|
+
}
|
691
|
+
|
692
|
+
public static float getScreenPpiY() {
|
693
|
+
if (BaseActivity.getScreenProperties() != null)
|
694
|
+
return BaseActivity.getScreenProperties().getPpiY();
|
695
|
+
else
|
696
|
+
return 0;
|
697
|
+
}
|
698
|
+
|
699
|
+
public static int getScreenOrientation() {
|
700
|
+
if (BaseActivity.getScreenProperties() != null)
|
701
|
+
return BaseActivity.getScreenProperties().getOrientation();
|
702
|
+
else
|
703
|
+
return Configuration.ORIENTATION_UNDEFINED;
|
704
|
+
}
|
705
|
+
|
706
|
+
public static Object getProperty(String name) {
|
795
707
|
try {
|
796
708
|
if (name.equalsIgnoreCase("platform"))
|
797
709
|
return "ANDROID";
|
@@ -804,25 +716,26 @@ public class RhodesService extends Service {
|
|
804
716
|
else if (name.equalsIgnoreCase("screen_height"))
|
805
717
|
return new Integer(getScreenHeight());
|
806
718
|
else if (name.equalsIgnoreCase("screen_orientation")) {
|
807
|
-
if (
|
808
|
-
return "portrait";
|
809
|
-
}
|
810
|
-
else {
|
719
|
+
if (getScreenOrientation() == Configuration.ORIENTATION_LANDSCAPE)
|
811
720
|
return "landscape";
|
812
|
-
|
721
|
+
else
|
722
|
+
return "portrait";
|
813
723
|
}
|
814
724
|
else if (name.equalsIgnoreCase("has_camera"))
|
815
725
|
return new Boolean(mCameraAvailable);
|
816
726
|
else if (name.equalsIgnoreCase("has_network"))
|
817
727
|
return hasNetwork();
|
818
728
|
else if (name.equalsIgnoreCase("ppi_x"))
|
819
|
-
return new Float(
|
729
|
+
return new Float(getScreenPpiX());
|
820
730
|
else if (name.equalsIgnoreCase("ppi_y"))
|
821
|
-
return new Float(
|
731
|
+
return new Float(getScreenPpiY());
|
822
732
|
else if (name.equalsIgnoreCase("phone_number")) {
|
823
|
-
|
824
|
-
|
825
|
-
|
733
|
+
Context context = ContextFactory.getContext();
|
734
|
+
String number = "";
|
735
|
+
if (context != null) {
|
736
|
+
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
|
737
|
+
number = manager.getLine1Number();
|
738
|
+
}
|
826
739
|
return number;
|
827
740
|
}
|
828
741
|
else if (name.equalsIgnoreCase("device_owner_name")) {
|
@@ -845,8 +758,13 @@ public class RhodesService extends Service {
|
|
845
758
|
return new Boolean(EventStore.hasCalendar());
|
846
759
|
}
|
847
760
|
else if (name.equalsIgnoreCase("phone_id")) {
|
848
|
-
|
849
|
-
|
761
|
+
RhodesService service = RhodesService.getInstance();
|
762
|
+
if (service != null) {
|
763
|
+
PhoneId phoneId = service.getPhoneId();
|
764
|
+
return phoneId.toString();
|
765
|
+
} else {
|
766
|
+
return "";
|
767
|
+
}
|
850
768
|
}
|
851
769
|
else if (name.equalsIgnoreCase("webview_framework")) {
|
852
770
|
return "WEBKIT/" + Build.VERSION.RELEASE;
|
@@ -51,7 +51,7 @@ public class SplashScreen implements MainView {
|
|
51
51
|
|
52
52
|
private static final String TAG = SplashScreen.class.getSimpleName();
|
53
53
|
|
54
|
-
private static final boolean DEBUG =
|
54
|
+
private static final boolean DEBUG = false;
|
55
55
|
|
56
56
|
private static final String LOADING_ANDROID_PNG = "apps/app/loading.android.png";
|
57
57
|
private static final String LOADING_PNG = "apps/app/loading.png";
|
@@ -91,7 +91,7 @@ public class SplashScreen implements MainView {
|
|
91
91
|
}
|
92
92
|
catch (IOException e) {
|
93
93
|
if (DEBUG)
|
94
|
-
|
94
|
+
Logger.D(TAG, "Can't load " + url + ": " + e.getMessage());
|
95
95
|
continue;
|
96
96
|
}
|
97
97
|
finally {
|
@@ -163,15 +163,14 @@ public class SplashScreen implements MainView {
|
|
163
163
|
@Override
|
164
164
|
public void navigate(final String url, final int index) {
|
165
165
|
|
166
|
-
|
167
|
-
Log.d(TAG, "navigate: url=" + url);
|
166
|
+
Logger.D(TAG, "navigate: url=" + url);
|
168
167
|
|
169
168
|
int delay = howLongWaitMs();
|
170
169
|
if (delay < 0) {
|
171
170
|
delay = 0;
|
172
171
|
}
|
173
172
|
|
174
|
-
|
173
|
+
Logger.D(TAG, "DELAY for SplashScreen = " + String.valueOf(delay));
|
175
174
|
final SplashScreen curView = this;
|
176
175
|
|
177
176
|
PerformOnUiThread.exec(new Runnable() {
|
@@ -43,7 +43,6 @@ import android.location.Address;
|
|
43
43
|
import android.location.Geocoder;
|
44
44
|
import android.os.Bundle;
|
45
45
|
import android.os.IBinder;
|
46
|
-
import android.view.Display;
|
47
46
|
import android.view.ViewGroup.LayoutParams;
|
48
47
|
import android.widget.RelativeLayout;
|
49
48
|
|
@@ -52,6 +51,7 @@ import com.google.android.maps.MapActivity;
|
|
52
51
|
import com.google.android.maps.MapController;
|
53
52
|
import com.google.android.maps.MyLocationOverlay;
|
54
53
|
import com.rhomobile.rhodes.AndroidR;
|
54
|
+
import com.rhomobile.rhodes.BaseActivity;
|
55
55
|
import com.rhomobile.rhodes.Logger;
|
56
56
|
import com.rhomobile.rhodes.RhoConf;
|
57
57
|
import com.rhomobile.rhodes.RhodesActivity;
|
@@ -81,8 +81,6 @@ public class GoogleMapView extends MapActivity {
|
|
81
81
|
|
82
82
|
private Vector<Annotation> annotations;
|
83
83
|
|
84
|
-
private int mRuntimeOrientation;
|
85
|
-
|
86
84
|
static private ExtrasHolder mHolder = null;
|
87
85
|
|
88
86
|
private static class Coordinates {
|
@@ -119,29 +117,7 @@ public class GoogleMapView extends MapActivity {
|
|
119
117
|
}
|
120
118
|
}, false);
|
121
119
|
}
|
122
|
-
|
123
|
-
protected int getScreenOrientation() {
|
124
|
-
Display display = getWindowManager().getDefaultDisplay();
|
125
|
-
int orientation = display.getOrientation();
|
126
|
-
|
127
|
-
if (orientation == Configuration.ORIENTATION_UNDEFINED)
|
128
|
-
{
|
129
|
-
orientation = getResources().getConfiguration().orientation;
|
130
120
|
|
131
|
-
if (orientation == Configuration.ORIENTATION_UNDEFINED) {
|
132
|
-
if (display.getWidth() == display.getHeight())
|
133
|
-
orientation = Configuration.ORIENTATION_SQUARE;
|
134
|
-
else if(display.getWidth() < display.getHeight())
|
135
|
-
orientation = Configuration.ORIENTATION_PORTRAIT;
|
136
|
-
else
|
137
|
-
orientation = Configuration.ORIENTATION_LANDSCAPE;
|
138
|
-
}
|
139
|
-
}
|
140
|
-
return orientation;
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
|
145
121
|
@Override
|
146
122
|
public void onCreate(Bundle icicle) {
|
147
123
|
super.onCreate(icicle);
|
@@ -306,9 +282,9 @@ public class GoogleMapView extends MapActivity {
|
|
306
282
|
}
|
307
283
|
});
|
308
284
|
geocoding.start();
|
309
|
-
|
310
|
-
mRuntimeOrientation = this.getScreenOrientation();
|
311
285
|
|
286
|
+
if (RhoConf.getBool("disable_screen_rotation"))
|
287
|
+
setRequestedOrientation(BaseActivity.getScreenProperties().getOrientation());
|
312
288
|
}
|
313
289
|
|
314
290
|
@Override
|
@@ -317,13 +293,12 @@ public class GoogleMapView extends MapActivity {
|
|
317
293
|
if (RhoConf.getBool("disable_screen_rotation"))
|
318
294
|
{
|
319
295
|
super.onConfigurationChanged(newConfig);
|
320
|
-
|
296
|
+
setRequestedOrientation(BaseActivity.getScreenProperties().getOrientation());
|
321
297
|
}
|
322
298
|
else
|
323
299
|
{
|
324
|
-
|
325
|
-
|
326
|
-
RhodesService.getInstance().rereadScreenProperties();
|
300
|
+
super.onConfigurationChanged(newConfig);
|
301
|
+
BaseActivity.getScreenProperties().reread(this);
|
327
302
|
}
|
328
303
|
}
|
329
304
|
|