+redef class NativeEditText
+
+ # Configure this view to hide passwords
+ fun is_password=(value: Bool) in "Java" `{
+ if (value) {
+ self.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD);
+ self.setTransformationMethod(android.text.method.PasswordTransformationMethod.getInstance());
+ } else {
+ self.setInputType(android.text.InputType.TYPE_CLASS_TEXT);
+ self.setTransformationMethod(null);
+ }
+ `}
+end
+
+redef class Button
+ super Finalizable
+
+ redef type NATIVE: NativeButton
+ redef var native = (new NativeButton(app.native_activity, self)).new_global_ref
+
+ private fun on_click do notify_observers new ButtonPressEvent(self)
+
+ redef fun finalize do native.delete_global_ref
+end
+