Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 26th, 2012  |  syntax: None  |  size: 2.85 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ProgressBar on top of FrameLayout
  2. <?xml version="1.0" encoding="utf-8"?>
  3. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:id="@+id/RelativeLayout01"
  5. android:layout_width="fill_parent"
  6. android:layout_height="fill_parent" >
  7.  
  8. <FrameLayout
  9.     android:id="@+id/gl_container"
  10.     android:layout_width="wrap_content"
  11.     android:layout_height="wrap_content"
  12.     android:layout_centerInParent="true" >
  13. </FrameLayout>
  14.  
  15. <SurfaceView
  16.     android:id="@+id/surface"
  17.     android:layout_width="fill_parent"
  18.     android:layout_height="fill_parent"
  19.     android:layout_centerInParent="true" >
  20. </SurfaceView>
  21.  
  22. <LinearLayout
  23.     xmlns:android="http://schemas.android.com/apk/res/android"
  24.     android:id="@+id/controlContainer"
  25.     android:layout_width="fill_parent"
  26.     android:layout_height="wrap_content"
  27.     android:layout_alignParentBottom="true"
  28.     android:background="#aa000000"
  29.     android:orientation="vertical"
  30.     android:padding="10dp" >
  31.  
  32.     <LinearLayout
  33.         android:layout_width="fill_parent"
  34.         android:layout_height="wrap_content"
  35.         android:gravity="center"
  36.         android:orientation="horizontal" >
  37.  
  38.         <ToggleButton
  39.             android:id="@+id/buttonPausePlay"
  40.             android:layout_width="wrap_content"
  41.             android:layout_height="wrap_content"
  42.             android:background="@drawable/selector_play_pause"
  43.             android:textOff=""
  44.             android:textOn="" />
  45.  
  46.         <ImageButton
  47.             android:id="@+id/buttonStop"
  48.             android:layout_width="wrap_content"
  49.             android:layout_height="wrap_content"
  50.             android:background="#00000000"
  51.             android:src="@drawable/ic_media_stop" />
  52.     </LinearLayout>
  53.  
  54.     <ProgressBar
  55.         android:id="@+id/seekbar"
  56.         style="@android:style/Widget.ProgressBar.Horizontal"
  57.         android:layout_width="fill_parent"
  58.         android:layout_height="wrap_content"
  59.         android:enabled="false"
  60.         android:indeterminate="false" />
  61. </LinearLayout>
  62.  
  63. <LinearLayout
  64.     android:id="@+id/loadingContainer"
  65.     android:layout_width="wrap_content"
  66.     android:layout_height="wrap_content"
  67.     android:layout_centerInParent="true"
  68.     android:gravity="center"
  69.     android:orientation="vertical" >
  70.  
  71.     <ProgressBar
  72.         android:id="@+id/loading"
  73.         style="@android:style/Widget.ProgressBar.Large.Inverse"
  74.         android:layout_width="wrap_content"
  75.         android:layout_height="wrap_content"
  76.         android:indeterminate="true" />
  77.  
  78. </LinearLayout>
  79.  
  80. </RelativeLayout>
  81.        
  82. @Override
  83. public void onBuffering(int progress_in_percent) {
  84.     Log.d(TAG, "Buffering " + progress_in_percent + " %");
  85. }
  86.  
  87. @Override
  88. public void onBufferingBegin() {
  89.     Log.d(TAG, "Buffering begin");
  90.      loadingContainer.setVisibility(View.VISIBLE);
  91. }
  92.  
  93. @Override
  94. public void onBufferingEnd() {
  95.     Log.d(TAG, "Buffering end");
  96.     loadingContainer.setVisibility(View.GONE);
  97. }