From 842fb73b4b99cb00a6d5b66e1c86398c08aa360f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 26 Jan 2015 06:04:10 -0500 Subject: [PATCH] lib/android: remove popup hack in `ui` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/android/ui.nit | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) 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; -- 1.7.9.5