Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. @Override
  2. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  3. Bundle savedInstanceState) {
  4. this.context = getActivity();
  5. View rootView = inflater
  6. .inflate(R.layout.opengl_layout, container, false);
  7. swipeLayout = (SwipeRefreshLayout) rootView
  8. .findViewById(R.id.swipe_container);
  9. glView = (MyGLSurfaceView) rootView.findViewById(R.id.surfaceView1);
  10. //glView = new MyGLSurfaceView(getActivity());
  11. GLlayout = (RelativeLayout)rootView.findViewById(R.id.upperView);
  12. // getActivity().setContentView(glView);
  13.  
  14. touchStart = new PointF();
  15. glView.setRenderer(MenuActivity.renderer);
  16. //GLlayout.addView(glView);
  17. scaleGestureDetector = new ScaleGestureDetector(getActivity(), new ScaleListener());
  18. swipeLayout.setOnRefreshListener(this);
  19. swipeLayout.setColorScheme(android.R.color.holo_orange_dark,
  20. android.R.color.holo_red_dark,
  21. android.R.color.holo_orange_light, android.R.color.holo_red_light);
  22. return rootView;
  23.  
  24. <?xml version="1.0" encoding="utf-8"?>
  25.  
  26. <ScrollView
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent" >
  29.  
  30. <RelativeLayout
  31. android:id="@+id/upperView"
  32. android:layout_width="match_parent"
  33. android:layout_height="match_parent"
  34. android:padding="20dp" >
  35.  
  36. <Button
  37. android:id="@+id/button1"
  38. android:layout_width="wrap_content"
  39. android:layout_height="wrap_content"
  40. android:layout_alignParentLeft="true"
  41. android:layout_alignParentTop="true"
  42. android:text="Button" />
  43.  
  44. <Button
  45. android:id="@+id/button2"
  46. android:layout_width="wrap_content"
  47. android:layout_height="wrap_content"
  48. android:layout_alignParentRight="true"
  49. android:layout_alignParentTop="true"
  50. android:text="Button" />
  51.  
  52. <openGlSurface.MyGLSurfaceView
  53. android:id="@+id/surfaceView1"
  54. android:layout_width="wrap_content"
  55. android:layout_height="wrap_content"
  56. android:layout_alignLeft="@+id/button1"
  57. android:layout_alignRight="@+id/button2"
  58. android:layout_below="@+id/button1" />
  59.  
  60. </RelativeLayout>
  61. </ScrollView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement