From: Alexis Laferrière Date: Mon, 26 Jan 2015 11:04:10 +0000 (-0500) Subject: lib/android: remove popup hack in `ui` X-Git-Tag: v0.7.3~21^2~7 X-Git-Url: http://nitlanguage.org lib/android: remove popup hack in `ui` Signed-off-by: Alexis Laferrière --- diff --git a/lib/android/ui.nit b/lib/android/ui.nit index a07718e..9bd4fc0 100644 --- a/lib/android/ui.nit +++ b/lib/android/ui.nit @@ -106,43 +106,8 @@ end redef extern class NativeActivity - # Fill this entire `NativeActivity` with `popup` - # - # This is a workaround for the use on `takeSurface` in `NativeActivity.java` - # - # TODO replace NativeActivity by our own NitActivity - private fun dedicate_to_popup(popup: NativePopupWindow, popup_layout: NativeViewGroup) in "Java" `{ - final LinearLayout final_main_layout = new LinearLayout(recv); - final ViewGroup final_popup_layout = popup_layout; - final PopupWindow final_popup = popup; - final Activity final_recv = recv; - - recv.runOnUiThread(new Runnable() { - @Override - public void run() { - MarginLayoutParams params = new MarginLayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.MATCH_PARENT); - - final_recv.setContentView(final_main_layout, params); - - final_popup.showAtLocation(final_popup_layout, Gravity.TOP, 0, 40); - } - }); - `} - # Set the main layout of this activity - fun content_view=(layout: NativeViewGroup) - do - var popup = new NativePopupWindow(self) - popup.content_view = layout - dedicate_to_popup(popup, layout) - end - - # Set the real content view of this activity, without hack - # - # TODO bring use this instead of the hack with `dedicate_to_pupup` - private fun real_content_view=(layout: NativeViewGroup) in "Java" `{ + fun content_view=(layout: NativeViewGroup) in "Java" `{ final ViewGroup final_layout = layout; final Activity final_recv = recv;