SeekBar Thumb

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

SeekBar Thumb

Postby Peeyush » Mon Jul 06, 2009 6:25 am

Hi,
How to set the thumb position when progress has changed.
Peeyush
Freshman
Freshman
 
Posts: 8
Joined: Tue Jun 30, 2009 10:01 am
Location: India

Top

since you are very vague on what you are looking for

Postby pentace » Mon Jul 13, 2009 1:05 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
  2.  
  3.  
  4.  
  5. }
  6.  
  7.  
  8.  
  9. public void onStartTrackingTouch(SeekBar seekBar) {
  10.  
  11.  
  12.  
  13. }
  14.  
  15.  
  16.  
  17. public void onStopTrackingTouch(SeekBar seekBar) {
  18.  
  19.  
  20.  
  21. }
  22.  
  23.  
  24.  
  25. public static void startPlayProgressUpdater() {
  26.  
  27.  
  28.  
  29.         float progress = ((((float)musicPlayer.getCurrentPosition()/100)/
  30.  
  31.                         (((float)musicPlayer.getDuration()/100)/100)));
  32.  
  33.         mProgressStatus =(int)(progress);  
  34.  
  35.         if (musicPlayer.isPlaying()) {
  36.  
  37.                 Runnable notification = new Runnable() {
  38.  
  39.                 public void run() {
  40.  
  41.                                        
  42.  
  43.                         // Update the progress bar                    
  44.  
  45.                         mHandler.post(new Runnable() {                        
  46.  
  47.                         public void run() {
  48.  
  49.                          mSeekBar.setProgress(mProgressStatus);
  50.  
  51.                          }                    
  52.  
  53.                          });
  54.  
  55.                         startPlayProgressUpdater();
  56.  
  57.              
  58.  
  59.                         }
  60.  
  61.             };
  62.  
  63.             handler.postDelayed(notification,1000);
  64.  
  65.             final long timeInMillis = musicPlayer.getCurrentPosition();
  66.  
  67.  
  68.  
  69.             mProgressText.setText(makeTimeString(timeInMillis/1000));
  70.  
  71.            // mProgressText.setText(minutes+":"+seconds);
  72.  
  73.         }
  74.  
  75.        
  76.  
  77. }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
pentace
Junior Developer
Junior Developer
 
Posts: 19
Joined: Wed Oct 22, 2008 2:16 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot], Google Feedfetcher and 9 guests