# limitations under the License.
# Views and services to use the Android native user interface
-module ui
+module ui is
+ # `adjustPan` allows to use EditText in a ListLayout
+ android_manifest_activity """android:windowSoftInputMode="adjustPan""""
+end
# Implementation note:
#
end
end
+redef class Activity
+ redef fun on_back_pressed
+ do
+ var window = app.window
+ if window.enable_back_button then
+ window.on_back_button
+ return true
+ end
+
+ return false
+ end
+end
+
# On Android, a window is implemented with the fragment `native`
redef class Window
redef var native = (new Android_app_Fragment(self)).new_global_ref
else // if (align > 0.5d)
g = android.view.Gravity.RIGHT;
- view.setGravity(g);
+ view.setGravity(g | android.view.Gravity.CENTER_VERTICAL);
`}
end
};
`}
end
+
+redef class Text
+ redef fun open_in_browser
+ do to_java_string.native_open_in_browser(app.native_activity)
+end
+
+redef class JavaString
+ private fun native_open_in_browser(context: NativeContext)
+ in "Java" `{
+ android.content.Intent intent = new android.content.Intent(
+ android.content.Intent.ACTION_VIEW,
+ android.net.Uri.parse(self));
+ context.startActivity(intent);
+ `}
+end