title: How can i programatically move a view in android?
body: <p>Here's the layout (XML) structure.</p>
  
  <p>&lt;RelativeLayout><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Linearlayout><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<b>ScrollView</b>><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...&lt;Linearlayout>...&lt;/Linearlayout><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/<b>ScrollView</b>><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Linearlayout><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...(Buttons)...<br />
  &lt;/RelativeLayout></p>
  
  <p>I am trying to make the ScrollView scroll slow ( like some kind of slider ) so that it scrolls for example one px than waits for 10 milliseconds and scrolls another px ... until it has scrolled by 100px. 
  If i call scrollBy(100,0) (e.g.) it just switches to the specified position, but theres no visible movement in between.</p>
  
  <pre><code>public void move(int x, int y)
  {
      Activity context = (Activity)getContext();
  
      context.runOnUiThread(new Runnable() 
      {   
          @Override
          public void run() 
          {
              for(int i=0;i&lt;100;i++)
              {
                  scrollBy(-1,0); try{ Thread.sleep(20); } catch(Exception e){}
              }
  
          }
      });
  }
  </code></pre>
  
  <p>I've been trying Threads (like this) in the ScrollView ( i extended it) and the Activity. If there's any way to make it move slowly i'd be glad to know. Thanks!</p>