[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] cleaned up background view, removed unused thread



commit eb2b7531c9c38b4e81743a86cd3bd8b9771e58da
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date:   Thu Jun 28 17:01:24 2012 -0400

    cleaned up background view, removed unused thread
---
 src/org/torproject/android/AnimatedBlockView.java |   41 ++++-----------------
 1 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/src/org/torproject/android/AnimatedBlockView.java b/src/org/torproject/android/AnimatedBlockView.java
index 1599ccd..7ba4e63 100644
--- a/src/org/torproject/android/AnimatedBlockView.java
+++ b/src/org/torproject/android/AnimatedBlockView.java
@@ -13,7 +13,8 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.MeasureSpec;
 
-public class AnimatedBlockView extends View implements Runnable {
+public class AnimatedBlockView extends View
+{
 
 	  private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
 
@@ -22,14 +23,6 @@ public class AnimatedBlockView extends View implements Runnable {
 
 		Random rand = new Random();
 		
-		private Handler mHandler = new Handler()
-		{
-			 public void handleMessage(Message msg) {
-		            
-				 	invalidate();
-		        }
-		};
-		
 
 	public AnimatedBlockView(Context context) {
 	 super(context);
@@ -54,15 +47,15 @@ public class AnimatedBlockView extends View implements Runnable {
 	 paint.setColor(Color.WHITE);
 	 paint.setAntiAlias(true);
 
-	 new Thread (this).start();
-	 
 	}
 
 	@Override
 	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-	 // TODO Auto-generated method stub
-	 setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
+	   super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+	   
+	   setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
 	   MeasureSpec.getSize(heightMeasureSpec));
+	 
 	}
 
 	int a1 = 30;
@@ -71,6 +64,7 @@ public class AnimatedBlockView extends View implements Runnable {
 	@Override
 	protected void onDraw(Canvas canvas) {
 
+		super.onDraw(canvas);
 		
 		for (int i = 0; i < 20; i++)
 		{
@@ -104,26 +98,6 @@ public class AnimatedBlockView extends View implements Runnable {
 		
 
 	}
-	
-	public void run ()
-	{
-		
-		
-		/*while (true)
-		{
-			
-			
-			try
-			{
-				Thread.sleep(10);
-			}
-			catch (Exception e)
-			{}
-			
-			mHandler.sendEmptyMessage(0);
-			
-		}*/
-	}
 
 	@Override
 	public boolean onTouchEvent(MotionEvent event) {
@@ -155,6 +129,7 @@ public class AnimatedBlockView extends View implements Runnable {
 	 }
 	 
 	 return true;
+	 
 	}
 
 }
\ No newline at end of file



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits