Skip to content
Snippets Groups Projects
Commit a62c2130 authored by Xavier Gibert's avatar Xavier Gibert
Browse files

BUGFIX: S Duos post invocation of slidder open and browser loading, I'm the best XD

parent db2dca4f
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ public final class HudFragment extends Fragment {
XWalkView browser;
LinearLayout browserLayout, slider_content;
Button views_menu;
SlidingDrawer drawer;
@SuppressWarnings("deprecation")
@SuppressLint({ "JavascriptInterface", "SetJavaScriptEnabled", "NewApi" })
......@@ -69,7 +70,7 @@ public final class HudFragment extends Fragment {
false);
//Hud Panel
SlidingDrawer drawer = (SlidingDrawer) rootView.findViewById(R.id.slidingDrawer1);
drawer = (SlidingDrawer) rootView.findViewById(R.id.slidingDrawer1);
drawer.setOnDrawerOpenListener(new OnDrawerOpenListener() {
public void onDrawerOpened() {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(browser.getLayoutParams());
......@@ -102,6 +103,7 @@ public final class HudFragment extends Fragment {
browser = ((MainActivity)getActivity()).mXwalkView;
browser = new XWalkView(this.getActivity().getApplicationContext(), this.getActivity());
XWalkSettings browserSettings = browser.getSettings();
browserSettings.setJavaScriptEnabled(true);
......@@ -127,7 +129,7 @@ public final class HudFragment extends Fragment {
browserLayout.addView(browser);
browser.load(Parameters.Web.STARTING_PAGE,null);
//browser.load(Parameters.Web.STARTING_PAGE,null);
views_menu = (Button) rootView.findViewById(R.id.buttonMissionNew);
views_menu.setOnClickListener(new OnClickListener(){
......@@ -144,8 +146,21 @@ public final class HudFragment extends Fragment {
simulator.setControlButtons(but_play,but_stop);
simulator.setCorrectSimulatorControls();
if(Parameters.Hud.start_panel_open)
drawer.getHandle().callOnClick();
/*if(Parameters.Hud.start_panel_open)
drawer.getHandle().callOnClick();*/
//needs to have browser defined but not loaded yet
rootView.post(new Runnable()
{
@Override
public void run()
{
if(Parameters.Hud.start_panel_open)
drawer.open();
browser.load(Parameters.Web.STARTING_PAGE,null);
}
});
return rootView;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment