rhodes 2.0.0.beta7 → 2.0.0.beta8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. data/CHANGELOG +20 -1
  2. data/bin/rhodes-setup +6 -2
  3. data/lib/extensions/digest/ext/Rakefile +2 -2
  4. data/lib/framework/rho/render.rb +2 -0
  5. data/lib/framework/rho/rho.rb +159 -95
  6. data/lib/framework/rho/rhoapplication.rb +24 -5
  7. data/lib/framework/rhodes.rb +1 -1
  8. data/lib/framework/rhom/rhom_model.rb +32 -23
  9. data/lib/framework/rhom/rhom_object_factory.rb +2 -2
  10. data/lib/rhodes.rb +1 -1
  11. data/platform/android/Rhodes/jni/src/callbacks.cpp +8 -1
  12. data/platform/android/Rhodes/jni/src/mapview.cpp +4 -1
  13. data/platform/android/Rhodes/jni/src/sslimpl.cpp +5 -1
  14. data/platform/android/Rhodes/jni/src/webview.cpp +3 -1
  15. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +3 -2
  16. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +2 -2
  17. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +1 -2
  18. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +1 -1
  19. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +3 -1
  20. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +0 -1
  21. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +4 -1
  22. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +24 -6
  23. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +7 -2
  24. data/platform/android/build/android.rake +11 -38
  25. data/platform/android/build/androidcommon.rb +50 -2
  26. data/platform/android/build/librhocommon_build.files +1 -0
  27. data/platform/android/build/libsqlite_build.files +1 -0
  28. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +2 -1
  29. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -5
  30. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +3 -6
  31. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +4 -2
  32. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +12 -35
  33. data/platform/bb/rhodes/src/rhomobile/Utilities.java +2 -1
  34. data/platform/iphone/Classes/DateTimePickerDelegate.m +4 -4
  35. data/platform/iphone/Classes/NativeBar.m +12 -6
  36. data/platform/iphone/Classes/NavBar.m +1 -1
  37. data/platform/iphone/Classes/RhoMainView.h +4 -1
  38. data/platform/iphone/Classes/Rhodes.h +6 -2
  39. data/platform/iphone/Classes/Rhodes.m +23 -3
  40. data/platform/iphone/Classes/SimpleMainView.h +3 -7
  41. data/platform/iphone/Classes/SimpleMainView.m +108 -54
  42. data/platform/iphone/Classes/TabbedMainView.h +3 -2
  43. data/platform/iphone/Classes/TabbedMainView.m +21 -10
  44. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +8 -0
  45. data/platform/shared/common/IRhoClassFactory.h +1 -0
  46. data/platform/shared/common/RhodesApp.cpp +7 -2
  47. data/platform/shared/common/ThreadQueue.cpp +110 -0
  48. data/platform/shared/common/ThreadQueue.h +75 -0
  49. data/platform/shared/logging/RhoLogCat.h +4 -0
  50. data/platform/shared/net/AsyncHttp.cpp +134 -135
  51. data/platform/shared/net/AsyncHttp.h +74 -33
  52. data/platform/shared/net/HttpServer.cpp +7 -1
  53. data/platform/shared/ruby/thread.c +4 -0
  54. data/platform/shared/ruby/thread_win32.c +9 -8
  55. data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +26 -5
  56. data/platform/shared/rubyJVM/src/com/rho/net/INetworkAccess.java +0 -2
  57. data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +4 -13
  58. data/platform/shared/rubyJVM/src/com/rho/net/URI.java +2 -2
  59. data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +3 -3
  60. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/ObjectFactory.java +12 -2
  61. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyString.java +6 -3
  62. data/platform/shared/rubyJVM/src/javolution/util/FastTable.java +12 -2
  63. data/platform/shared/sync/SyncEngine.cpp +15 -3
  64. data/platform/shared/sync/SyncEngine.h +1 -1
  65. data/platform/shared/sync/SyncThread.cpp +18 -101
  66. data/platform/shared/sync/SyncThread.h +30 -22
  67. data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
  68. data/platform/wm/rhodes/Rhodes.cpp +143 -1
  69. data/platform/wm/rhodes/memory_helper.cpp +273 -0
  70. data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +1 -0
  71. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +46 -3
  72. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +29 -1
  73. data/res/build-tools/db/syncdb.schema +1 -0
  74. data/res/generators/rhogen.rb +1 -1
  75. data/rhodes.gemspec +2 -2
  76. metadata +23 -6
  77. data/Manifest.txt +0 -5289
  78. data/rhobuild.yml +0 -37
@@ -34,19 +34,38 @@ module Rho
34
34
  NativeBar.create(TOOLBAR_TYPE, @@toolbar)
35
35
  else
36
36
  NativeBar.create(NOBAR_TYPE, [])
37
- end
37
+ end
38
+
39
+ uniq_sources = Rho::RhoConfig::sources.values
40
+ uniq_sources.each do |source|
41
+ next unless source['migrate_version']
42
+
43
+ db = ::Rho::RHO.get_src_db(source['name'])
44
+
45
+ if !on_migrate_source(source['migrate_version'], source)
46
+ db.execute_batch_sql(source['schema']['sql'])
47
+ end
48
+
49
+ db.update_into_table('sources', {"schema_version"=>source['schema_version']},{"name"=>source['name']})
50
+ end
51
+
38
52
  end
39
53
 
40
54
  def on_activate_app
41
55
  end
42
56
 
43
- # works for schema sources
57
+ # works for schema sources
58
+ #return true to run script creating table
44
59
  def on_migrate_source(old_version, new_src)
45
60
  puts "on_migrate_source; old_version :#{old_version}; new_src : #{new_src}"
46
- db = ::Rho::RHO.get_src_db(new_src['name'])
47
- if new_src['schema']
61
+ if new_src['model_type'] == 'fixed_schema'
62
+ db = ::Rho::RHO.get_src_db(new_src['name'])
48
63
  db.delete_table(new_src['name'])
49
- end
64
+
65
+ return false #create new table
66
+ end
67
+
68
+ return true
50
69
  end
51
70
 
52
71
  def set_menu(menu=nil,back_action=nil)
@@ -3,7 +3,7 @@ module Rhodes
3
3
  VERSION = '2.0.0'
4
4
  end
5
5
  unless defined? Rhodes::DBVERSION
6
- DBVERSION = '2.0.2'
6
+ DBVERSION = '2.0.3'
7
7
  end
8
8
 
9
9
  end
@@ -16,30 +16,36 @@ module Rhom
16
16
  end
17
17
 
18
18
  def fixed_schema?
19
+ BaseModel.model_params ||= {}
20
+ BaseModel.model_params["model_type"] = "property_bag" unless BaseModel.model_params["model_type"]
21
+
19
22
  false
20
23
  end
21
24
 
22
25
  def property(name,type=:string)
26
+ fixed_schema?()
27
+
23
28
  BaseModel.model_params ||= {}
24
-
25
- if type == :blob
26
- BaseModel.model_params['blob_attribs'] ||= []
27
- BaseModel.model_params['blob_attribs'] << name.to_s
28
- end
29
-
30
- if fixed_schema?
31
- BaseModel.model_params['schema'] ||= {}
32
- BaseModel.model_params['schema']['columns'] ||= []
33
-
34
- BaseModel.model_params['schema']['columns'] << name.to_s
35
- #TODO: type support
36
- end
37
-
29
+
30
+ BaseModel.model_params['schema'] ||= {}
31
+ BaseModel.model_params['schema']['property'] ||= {}
32
+ BaseModel.model_params['schema']['property'][name.to_s] = type
33
+
34
+
38
35
  end
39
36
 
40
37
  def set(name,value)
41
38
  BaseModel.model_params ||= {}
42
- BaseModel.model_params[name.to_s] = value
39
+
40
+ if ( name == :sync )
41
+ if ( value )
42
+ BaseModel.model_params['sync_type'] = 'incremental' unless BaseModel.model_params['sync_type']
43
+ else
44
+ BaseModel.model_params.delete('sync_type')
45
+ end
46
+ else
47
+ BaseModel.model_params[name.to_s] = value
48
+ end
43
49
  end
44
50
 
45
51
  def enable(name)
@@ -48,27 +54,27 @@ module Rhom
48
54
 
49
55
  def belongs_to(name, owner)
50
56
  BaseModel.model_params ||= {}
51
- BaseModel.model_params['associations'] ||= {}
57
+ BaseModel.model_params['belongs_to'] ||= {}
52
58
 
53
- BaseModel.model_params['associations'][owner.to_s] = name.to_s
59
+ BaseModel.model_params['belongs_to'][name.to_s] = owner.to_s
54
60
  end
55
61
 
56
- def index(*args)
62
+ def index(name,cols)
57
63
  return unless fixed_schema?
58
64
 
59
65
  BaseModel.model_params['schema'] ||= {}
60
- BaseModel.model_params['schema']['indexes'] ||= []
66
+ BaseModel.model_params['schema']['index'] ||= []
61
67
 
62
- BaseModel.model_params['schema']['indexes'] << args
68
+ BaseModel.model_params['schema']['index'] << {name.to_s=>cols}
63
69
  end
64
70
 
65
- def unique_index(*args)
71
+ def unique_index(name,cols)
66
72
  return unless fixed_schema?
67
73
 
68
74
  BaseModel.model_params['schema'] ||= {}
69
- BaseModel.model_params['schema']['unique_indexes'] ||= []
75
+ BaseModel.model_params['schema']['unique_index'] ||= []
70
76
 
71
- BaseModel.model_params['schema']['unique_indexes'] << args
77
+ BaseModel.model_params['schema']['unique_index'] << {name.to_s=>cols}
72
78
  end
73
79
 
74
80
  end
@@ -81,6 +87,9 @@ module Rhom
81
87
  end
82
88
 
83
89
  def fixed_schema?
90
+ BaseModel.model_params ||= {}
91
+ BaseModel.model_params["model_type"] = "fixed_schema" unless BaseModel.model_params["model_type"]
92
+
84
93
  true
85
94
  end
86
95
 
@@ -119,7 +119,7 @@ module Rhom
119
119
  end
120
120
 
121
121
  def is_schema_source
122
- Rho::RhoConfig.sources[get_source_name]['schema'] != nil
122
+ Rho::RhoConfig.sources[get_source_name]['model_type'] == 'fixed_schema'
123
123
  end
124
124
  def get_schema_table_name
125
125
  get_source_name()
@@ -1059,7 +1059,7 @@ module Rhom
1059
1059
  end
1060
1060
 
1061
1061
  def is_inst_schema_source
1062
- Rho::RhoConfig.sources[get_inst_source_name]['schema'] != nil
1062
+ Rho::RhoConfig.sources[get_inst_source_name]['model_type'] == 'fixed_schema'
1063
1063
  end
1064
1064
  def get_inst_schema_table_name
1065
1065
  get_inst_source_name()
data/lib/rhodes.rb CHANGED
@@ -3,7 +3,7 @@ module Rhodes
3
3
  VERSION = '2.0.0'
4
4
  end
5
5
  unless defined? Rhodes::DBVERSION
6
- DBVERSION = '2.0.2'
6
+ DBVERSION = '2.0.3'
7
7
  end
8
8
 
9
9
  end
@@ -90,7 +90,9 @@ RHO_GLOBAL int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
90
90
  jmethodID mid = getJNIClassStaticMethod(env, cls, "getProperty", "(Ljava/lang/String;)Ljava/lang/Object;");
91
91
  if (!mid) return 0;
92
92
 
93
- jobject result = env->CallStaticObjectMethod(cls, mid, rho_cast<jstring>(szPropName));
93
+ jstring propNameObj = rho_cast<jstring>(szPropName);
94
+ jobject result = env->CallStaticObjectMethod(cls, mid, propNameObj);
95
+ env->DeleteLocalRef(propNameObj);
94
96
  if (!result) return 0;
95
97
 
96
98
  jclass clsBoolean = getJNIClass(RHODES_JAVA_CLASS_BOOLEAN);
@@ -102,26 +104,31 @@ RHO_GLOBAL int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
102
104
  if (env->IsInstanceOf(result, clsBoolean)) {
103
105
  jmethodID midValue = getJNIClassMethod(env, clsBoolean, "booleanValue", "()Z");
104
106
  *resValue = rho_ruby_create_boolean((int)env->CallBooleanMethod(result, midValue));
107
+ env->DeleteLocalRef(result);
105
108
  return 1;
106
109
  }
107
110
  else if (env->IsInstanceOf(result, clsInteger)) {
108
111
  jmethodID midValue = getJNIClassMethod(env, clsInteger, "intValue", "()I");
109
112
  *resValue = rho_ruby_create_integer((int)env->CallIntMethod(result, midValue));
113
+ env->DeleteLocalRef(result);
110
114
  return 1;
111
115
  }
112
116
  else if (env->IsInstanceOf(result, clsFloat)) {
113
117
  jmethodID midValue = getJNIClassMethod(env, clsFloat, "floatValue", "()F");
114
118
  *resValue = rho_ruby_create_double((double)env->CallFloatMethod(result, midValue));
119
+ env->DeleteLocalRef(result);
115
120
  return 1;
116
121
  }
117
122
  else if (env->IsInstanceOf(result, clsDouble)) {
118
123
  jmethodID midValue = getJNIClassMethod(env, clsDouble, "doubleValue", "()D");
119
124
  *resValue = rho_ruby_create_double((double)env->CallDoubleMethod(result, midValue));
125
+ env->DeleteLocalRef(result);
120
126
  return 1;
121
127
  }
122
128
  else if (env->IsInstanceOf(result, clsString)) {
123
129
  jstring resStrObj = (jstring)result;
124
130
  *resValue = rho_ruby_create_string(rho_cast<std::string>(resStrObj).c_str());
131
+ env->DeleteLocalRef(result);
125
132
  return 1;
126
133
  }
127
134
 
@@ -20,7 +20,10 @@ RHO_GLOBAL void mapview_create(rho_param *p)
20
20
  }
21
21
 
22
22
  jobject paramsObj = RhoValueConverter(env).createObject(p);
23
- env->CallStaticVoidMethod(clsMapView, midCreate, rho_cast<jstring>(RHO_GOOGLE_API_KEY), paramsObj);
23
+ jstring keyObj = rho_cast<jstring>(RHO_GOOGLE_API_KEY);
24
+ env->CallStaticVoidMethod(clsMapView, midCreate, keyObj, paramsObj);
25
+ env->DeleteLocalRef(keyObj);
26
+ env->DeleteLocalRef(paramsObj);
24
27
  #else
25
28
  RAWLOG_ERROR("MapView disabled at build time");
26
29
  #endif
@@ -46,7 +46,9 @@ RHO_GLOBAL jobject JNICALL Java_com_rhomobile_rhodes_socket_SSLImpl_getRemoteSoc
46
46
  arr[0] = (jbyte)(addr & 0xFF);
47
47
  env->ReleaseByteArrayElements(array, arr, 0);
48
48
 
49
- jobject inetaddrObj = env->NewObject(clsInetAddr, midInetAddr, array, rho_cast<jstring>(::inet_ntoa(sa.sin_addr)));
49
+ jstring ipaddrObj = rho_cast<jstring>(::inet_ntoa(sa.sin_addr));
50
+ jobject inetaddrObj = env->NewObject(clsInetAddr, midInetAddr, array, ipaddrObj);
51
+ env->DeleteLocalRef(ipaddrObj);
50
52
  if (!inetaddrObj) return NULL;
51
53
 
52
54
  jobject sockaddrObj = env->NewObject(clsSockAddr, midSockAddr);
@@ -55,6 +57,8 @@ RHO_GLOBAL jobject JNICALL Java_com_rhomobile_rhodes_socket_SSLImpl_getRemoteSoc
55
57
  env->SetObjectField(sockaddrObj, fidInetAddr, inetaddrObj);
56
58
  env->SetIntField(sockaddrObj, fidPort, ntohs(sa.sin_port));
57
59
 
60
+ env->DeleteLocalRef(inetaddrObj);
61
+
58
62
  return sockaddrObj;
59
63
  }
60
64
 
@@ -69,7 +69,7 @@ RHO_GLOBAL const char* rho_webview_execute_js(const char* js, int index)
69
69
  if (!mid) return NULL;
70
70
 
71
71
  jstring objJs = rho_cast<jstring>(env, js);
72
- env->CallStaticObjectMethod(cls, mid, objJs, index);
72
+ env->CallStaticVoidMethod(cls, mid, objJs, index);
73
73
  env->DeleteLocalRef(objJs);
74
74
  return "";
75
75
  }
@@ -90,4 +90,6 @@ RHO_GLOBAL void rho_webview_set_cookie(const char *url, const char *cookie)
90
90
  jstring urlObj = rho_cast<jstring>(url);
91
91
  jstring cookieObj = rho_cast<jstring>(cookie);
92
92
  env->CallStaticVoidMethod(cls, mid, urlObj, cookieObj);
93
+ env->DeleteLocalRef(urlObj);
94
+ env->DeleteLocalRef(cookieObj);
93
95
  }
@@ -47,14 +47,15 @@ public class NativeBar {
47
47
  public void run() {
48
48
  try {
49
49
  Rhodes r = RhodesInstance.getInstance();
50
+ MainView mainView = r.getMainView();
50
51
  MainView v = null;
51
52
 
52
53
  switch (type) {
53
54
  case NOBAR_TYPE:
54
- v = new SimpleMainView();
55
+ v = new SimpleMainView(mainView);
55
56
  break;
56
57
  case TOOLBAR_TYPE:
57
- v = new SimpleMainView(params);
58
+ v = new SimpleMainView(mainView, params);
58
59
  break;
59
60
  case TABBAR_TYPE:
60
61
  v = new TabbedMainView(params);
@@ -3,9 +3,9 @@ package com.rhomobile.rhodes;
3
3
  public class NativeLibraries {
4
4
 
5
5
  public static void load() {
6
- // Load native implementation of rhodes
7
- System.loadLibrary("rhodes");
8
6
  // Load native .so libraries
7
+ // Load native implementation of rhodes
8
+ System.loadLibrary("rhodes");
9
9
  }
10
10
 
11
11
  }
@@ -1,7 +1,6 @@
1
1
  package com.rhomobile.rhodes;
2
2
 
3
3
  import java.util.Map;
4
- import java.util.Vector;
5
4
 
6
5
  public class NavBar {
7
6
 
@@ -33,7 +32,7 @@ public class NavBar {
33
32
 
34
33
  public void run() {
35
34
  Rhodes r = RhodesInstance.getInstance();
36
- r.getMainView().setNavBar(title, left, right);
35
+ r.getMainView().addNavBar(title, left, right);
37
36
  }
38
37
  };
39
38
 
@@ -199,7 +199,7 @@ public class Rhodes extends Activity {
199
199
  */
200
200
 
201
201
  private void copyFromBundle(String file) throws IOException {
202
- File target = new File(sdcardRootPath(), file);
202
+ File target = new File(getRootPath(), file);
203
203
  if (target.exists())
204
204
  return;
205
205
  FileSource as = new AssetsSource(getResources().getAssets());
@@ -49,8 +49,10 @@ public class GeoLocation {
49
49
 
50
50
  public static boolean isAvailable() {
51
51
  try {
52
- checkState();
53
52
  Logger.T(TAG, "isAvailable");
53
+ if (locImpl == null)
54
+ return false;
55
+ checkState();
54
56
  init();
55
57
  return locImpl.isAvailable();
56
58
  }
@@ -98,7 +98,6 @@ public class GeoLocationImpl implements LocationListener {
98
98
  public void onProviderDisabled(String provider) {
99
99
  Logger.T(TAG, "onProviderDisabled");
100
100
  setCurrentGpsLocation(null);
101
-
102
101
  }
103
102
 
104
103
  public void onProviderEnabled(String provider) {
@@ -23,11 +23,14 @@ package com.rhomobile.rhodes.mainview;
23
23
  import java.util.Map;
24
24
 
25
25
  import android.view.View;
26
+ import android.webkit.WebView;
26
27
 
27
28
  public interface MainView {
28
29
 
29
30
  public View getView();
30
31
 
32
+ public WebView detachWebView();
33
+
31
34
  public void back(int index);
32
35
  public void forward(int index);
33
36
 
@@ -44,6 +47,6 @@ public interface MainView {
44
47
 
45
48
  public void loadData(String data, int index);
46
49
 
47
- public void setNavBar(String title, Map<Object,Object> left, Map<Object,Object> right);
50
+ public void addNavBar(String title, Map<Object,Object> left, Map<Object,Object> right);
48
51
  public void removeNavBar();
49
52
  }
@@ -115,6 +115,16 @@ public class SimpleMainView implements MainView {
115
115
  return view;
116
116
  }
117
117
 
118
+ public WebView detachWebView() {
119
+ WebView v = null;
120
+ if (webView != null) {
121
+ view.removeView(webView);
122
+ v = webView;
123
+ webView = null;
124
+ }
125
+ return v;
126
+ }
127
+
118
128
  private View createButton(Map<Object,Object> hash) {
119
129
  Rhodes r = RhodesInstance.getInstance();
120
130
 
@@ -200,7 +210,7 @@ public class SimpleMainView implements MainView {
200
210
  }
201
211
 
202
212
  @SuppressWarnings("unchecked")
203
- private void init(Vector<Object> params) {
213
+ private void init(MainView v, Vector<Object> params) {
204
214
  Rhodes r = RhodesInstance.getInstance();
205
215
 
206
216
  view = new LinearLayout(r);
@@ -209,7 +219,11 @@ public class SimpleMainView implements MainView {
209
219
  view.setLayoutParams(new LinearLayout.LayoutParams(FILL_PARENT, FILL_PARENT));
210
220
  view.setId(Rhodes.RHO_MAIN_VIEW);
211
221
 
212
- webView = r.createWebView();
222
+ webView = null;
223
+ if (v != null)
224
+ webView = v.detachWebView();
225
+ if (webView == null)
226
+ webView = r.createWebView();
213
227
  view.addView(webView, new LinearLayout.LayoutParams(FILL_PARENT, 0, 1));
214
228
 
215
229
  LinearLayout bottom = new LinearLayout(r);
@@ -254,11 +268,15 @@ public class SimpleMainView implements MainView {
254
268
  }
255
269
 
256
270
  public SimpleMainView() {
257
- init(null);
271
+ init(null, null);
272
+ }
273
+
274
+ public SimpleMainView(MainView v) {
275
+ init(v, null);
258
276
  }
259
277
 
260
- public SimpleMainView(Vector<Object> params) {
261
- init(params);
278
+ public SimpleMainView(MainView v, Vector<Object> params) {
279
+ init(v, params);
262
280
  }
263
281
 
264
282
  public void back(int index) {
@@ -297,7 +315,7 @@ public class SimpleMainView implements MainView {
297
315
  webView.loadData(data, "text/html", "utf-8");
298
316
  }
299
317
 
300
- public void setNavBar(String title, Map<Object,Object> left, Map<Object,Object> right) {
318
+ public void addNavBar(String title, Map<Object,Object> left, Map<Object,Object> right) {
301
319
  removeNavBar();
302
320
 
303
321
  Rhodes r = RhodesInstance.getInstance();
@@ -33,6 +33,7 @@ import android.graphics.drawable.BitmapDrawable;
33
33
  import android.view.Gravity;
34
34
  import android.view.View;
35
35
  import android.view.ViewGroup.LayoutParams;
36
+ import android.webkit.WebView;
36
37
  import android.widget.FrameLayout;
37
38
  import android.widget.TabHost;
38
39
  import android.widget.TabWidget;
@@ -183,6 +184,10 @@ public class TabbedMainView implements MainView {
183
184
  return host;
184
185
  }
185
186
 
187
+ public WebView detachWebView() {
188
+ return getView(activeTab()).detachWebView();
189
+ }
190
+
186
191
  public void back(int index) {
187
192
  getView(index).back(0);
188
193
  }
@@ -219,8 +224,8 @@ public class TabbedMainView implements MainView {
219
224
  getView(index).loadData(data, 0);
220
225
  }
221
226
 
222
- public void setNavBar(String title, Map<Object,Object> left, Map<Object,Object> right) {
223
- getView(activeTab()).setNavBar(title, left, right);
227
+ public void addNavBar(String title, Map<Object,Object> left, Map<Object,Object> right) {
228
+ getView(activeTab()).addNavBar(title, left, right);
224
229
  }
225
230
 
226
231
  public void removeNavBar() {