action menu wrap content and use handler to show and to dismiss loadVideoProgress
authorDralagen <dralagen@dralagen.fr>
Sat, 11 Apr 2015 10:22:48 +0000 (12:22 +0200)
committerDralagen <dralagen@dralagen.fr>
Sat, 11 Apr 2015 10:22:48 +0000 (12:22 +0200)
app/src/main/java/org/alma/rotoscope/DrawingActivity.java
app/src/main/res/layout/activity_drawing.xml

index 282e2ae..8873ef3 100644 (file)
@@ -280,7 +280,13 @@ public class DrawingActivity extends Activity implements View.OnTouchListener {
 
     } else {
       // Load new frame
-      loadVideoProgress.show();
+      handler.post(new Runnable() {
+        @Override
+        public void run () {
+          loadVideoProgress.show();
+        }
+      });
+
       new Thread(new Runnable() {
         @Override
         public void run() {
@@ -297,7 +303,12 @@ public class DrawingActivity extends Activity implements View.OnTouchListener {
               }
             });
           } finally {
-            loadVideoProgress.dismiss();
+            handler.post(new Runnable() {
+              @Override
+              public void run () {
+                loadVideoProgress.dismiss();
+              }
+            });
           }
         }
       }).start();
index 21e50e5..3f80c51 100644 (file)
@@ -33,7 +33,7 @@
   <LinearLayout
       android:orientation="vertical"
       android:layout_width="wrap_content" android:animateLayoutChanges="true"
-      android:layout_height="fill_parent" android:id="@+id/MenuLayout" android:layout_alignParentLeft="false"
+      android:layout_height="wrap_content" android:id="@+id/MenuLayout" android:layout_alignParentLeft="false"
       android:layout_alignParentTop="true" android:layout_alignParentRight="true">
     <ImageView
         android:layout_width="match_parent"