[android-developers] Re: Seekbar Save state and restore

2013-07-15 Thread Keith Zettler
I am trying to save the actual position of 200 seekbars on one activity. I 
think this means i have to save/restore the position of the seekbars and 
the integer value of the seekbar before the activity was paused? i had read 
the API and it made no reference to seekbars . I was not aware they were 
widgets nor that i could store their positions and int value in shared 
preferences or that shared preferences even existed. Thank you Fred for 
that. What would be the correct way to accomplish the above TreKing?
Thank you both for your time and efforts 

On Thursday, July 11, 2013 10:14:38 PM UTC-4, Keith Zettler wrote:

 How exactly can i save/restore this seekbar if user uses back button or 
 activity is destyroyed?
 I have not been able to find a specific example anywhere


 public class MainActivity extends Activity  implements 
 SeekBar.OnSeekBarChangeListener {

 SeekBar seekBar;
 SeekBar seekBar1;
 TextView textView;
 TextView textView1;
 TextView textView2;
 TextView textView3;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 seekBar=(SeekBar)findViewById(R.id.seekbar);
 seekBar1=(SeekBar)findViewById(R.id.seekBar1);
 textView=(TextView)findViewById(R.id.textview);
 textView1=(TextView)findViewById(R.id.textView1);
 textView2=(TextView)findViewById(R.id.textView2);
 textView3=(TextView)findViewById(R.id.textView3);


 
 seekBar.setOnSeekBarChangeListener(this);
 
 }

 @Override
 public void onProgressChanged(SeekBar seekBar, int progress,
 boolean fromUser) {
 //  Notify that the progress level has changed.
 
 int A= (progress+250);
 textView.setText(SeekBar now at the value of:+progress);
 textView1.setText(SeekBar now at the value of:+A);
 

 }

 @Override
 public void onStartTrackingTouch(SeekBar seekBar) {
 // Notify that the user has started a touch gesture.
 //textView.setText(textView.getText()+\n+SeekBar Touch 
 Started);

 }

 @Override
 public void onStopTrackingTouch(SeekBar seekBar) {
 // Notify that the user has finished a touch gesture.
// textView.setText(textView.getText()+\n+SeekBar Touch 
 Stopped);   
 }
 

 
 
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
 // Inflate the menu; this adds items to the action bar if it is 
 present.
 getMenuInflater().inflate(R.menu.main, menu);
 return true;
 }
 
 
 }


-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: Seekbar Save state and restore

2013-07-15 Thread TreKing
On Mon, Jul 15, 2013 at 9:45 PM, Keith Zettler leftcont...@gmail.comwrote:

 I am trying to save the actual position of 200 seekbars on one activity.


Two *hundred*? In *one* activity? Jesus. That does not seem right ... but
hey, it's your app.

I think this means i have to save/restore the position of the seekbars and
 the integer value of the seekbar


Yes...


 before the activity was paused?


No. *After*. See the activity lifecyle:
http://developer.android.com/guide/components/activities.html#Lifecycle

Pay special attention to the part about saving state.


 i had read the API and it made no reference to seekbars .


You're quite hung up on these Seekbars. Again, these are just another
widget like any other - there's nothing special about them that would
require special mention of how to handle saving and restoring their state.

What would be the correct way to accomplish the above TreKing?


Read the links I gave you, then implement the correct methods to save and
restore (onSaveInstanceState, onRestoreInstanceState, respectively) the
states of your seekbars.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Seekbar thumb (scrubber control) clipping and offset

2012-05-24 Thread Karakuri Dev
Someone please help me with this, it has me stuck for two days.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: SeekBar bug? Calling setThumb(drawable) makes thumb disappear

2011-06-15 Thread Blake B.
Thanks for the hint, Romain!  Here is the code that now works:

final int drawableId = R.drawable.thumb1;
final Drawable d = getResources().getDrawable(drawableId);
d.setBounds(new Rect(0, 0, d.getIntrinsicWidth(),
d.getIntrinsicHeight()));   == this is the new call
slider.setThumb(d);

Regards,
Blake


On Jun 15, 12:58 pm, Romain Guy romain...@android.com wrote:
 You probably need to call setBounds() on the drawable to give it a size?









 On Wed, Jun 15, 2011 at 6:03 AM, Blake B. bbuckle...@yahoo.com wrote:
  I'm using a custom image for the Thumb on my SeekBar.  I want to
  change the image at some points in my app, but whenever
  setThumb(drawable) is called, the Thumb image disappears.  The seekbar
  still works, but it's like the Thumb is invisible.

  I've found a few other questions regarding this, but no answers, and
  there is no Issue being tracked that I could find.  Does anyone know
  what I'm doing wrong, or how to work around this?  Any Googlers that
  are familiar with SeekBar?

  Thanks,
  Blake

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: SeekBar problem

2010-11-22 Thread Roberto Previdi
Ok I've been able to obtain the slider update with this funny trick:

seekTime.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

public void onStopTrackingTouch(SeekBar seekBar)
 {
 final int progress = seekBar.getProgress();
 seekBar.setMax(progress * 2);
 *seekBar.setProgress(progress+1);*
* **seekBar.setProgress(progress-1);*

}
[...]

If i just do a setProgress(progress) it have no effect because it probably
recognize the same value and think that nothing is to update. I hope this
will help somebody in the future.

Roberto Previdi

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: seekbar

2010-09-03 Thread Kumar Bibek
I guess, you can set a drawable as the thumb to a seek bar. I read it
somewhere in the docs.

http://developer.android.com/reference/android/widget/AbsSeekBar.html#setThumb%28android.graphics.drawable.Drawable%29

-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 2, 12:39 pm, sudeep sr sudeevee...@gmail.com wrote:
 how to set circular thum to seekbar

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: SeekBar

2010-01-07 Thread Business Talk
you are right, I just tested it. It can't be done.

On Jan 7, 7:30 pm, Mark Murphy mmur...@commonsware.com wrote:
 Business Talk wrote:
  Has anybody tried to use the SeekBar in the window's title bar,
  instead of the ProgressBar, using the requestWindowFeature
  (Window.FEATURE_PROGRESS);?

 I do not believe that is possible.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _The Busy Coder's Guide to *Advanced* Android Development_
 Version 1.3 Available!
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: seekbar / progressbar

2009-11-18 Thread Narp Developments
I'm having the same error, and ever everything is equal to your
example

On Nov 16, 7:53 pm, Mario marioxxx...@gmail.com wrote:
 i want to change the color of progressbar  as the cursor is moved, but
 setProgressDrawable() seems to work only within OnCreate() method, if
 i change the ProgressDrawable inside onProgressChanged method
 inspecting mSeekBar i can see that the value of Currentdrawable and
 ProgressDrawable is updated but the progressbar disappear and it
 reappears only when the progressdrawable  changes back to the old value
 (the one set in the onCreate method)

 public void onProgressChanged(SeekBar seekBar, int progress,boolean
 fromTouch) {
      seekBar.setProgressDrawable(new_drawable);

 }

 Full code:
 public class SeekBar2 extends Activity implements
 SeekBar.OnSeekBarChangeListener {
         SeekBar mSeekBar;
         TextView mProgressText;
         TextView mTrackingText;
         static LayerDrawable mdrawable_green;
         static LayerDrawable mdrawable_blue;
         static LayerDrawable mdrawable_red;

         enum BarColor {
                 RED, BLUE, GREEN;
                 LayerDrawable getDrawable(){
                         switch(this){
                         case RED: return mdrawable_red;
                         case BLUE: return mdrawable_blue;
                         case GREEN: return mdrawable_green;
                         default : return mdrawable_red;
                         }
                 }
         };
         BarColor mcolor;

         public BarColor getColor() {
                 return mcolor;
         }

         public void setColor(SeekBar seekbar,BarColor color) {
                 this.mcolor = color;
                 seekbar.setProgressDrawable(color.getDrawable());
         }

         /** Called when the activity is first created. */
         @Override
         public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);
                 setContentView(R.layout.main);
                 mSeekBar = (SeekBar) findViewById(R.id.seek);
                 mdrawable_green = (LayerDrawable) 
 this.getResources().getDrawable
 (R.drawable.pgreen);
                 mdrawable_blue = 
 (LayerDrawable)this.getResources().getDrawable
 (R.drawable.pblue);
                 mdrawable_red = (LayerDrawable)this.getResources().getDrawable
 (R.drawable.pred);

                 setColor(mSeekBar ,BarColor.RED);
                 mSeekBar.setOnSeekBarChangeListener(this);
                 mProgressText = (TextView) findViewById(R.id.progress);
                 mTrackingText = (TextView) findViewById(R.id.tracking);

         }

         public void onProgressChanged(SeekBar seekBar, int progress,
                         boolean fromTouch) {
                 mProgressText.setText(progress +   + seekbar_from_touch
                                 + = + fromTouch);

                 BarColor color;
                 if(progress  33)
                         color = BarColor.RED;
                 else if ((progress=33)  (progress66))
                         color = BarColor.BLUE;
                 else
                         color = BarColor.GREEN;
                 if(color!=mcolor)
                         setColor(seekBar,color);

         }

         public void onStartTrackingTouch(SeekBar seekBar) {
                 mTrackingText.setText(seekbar_tracking_on);
         }

         public void onStopTrackingTouch(SeekBar seekBar) {
                 mTrackingText.setText(seekbar_tracking_off);
         }

 }

 main.xml:
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent

         SeekBar    android:id=@+id/seek

                                 android:layout_width=fill_parent
                                 android:layout_height=wrap_content
                                 android:max=100
                                 android:progress=0
                                 android:secondaryProgress=0
           /

     TextView android:id=@+id/progress
         android:layout_width=fill_parent
         android:layout_height=wrap_content /

     TextView android:id=@+id/tracking
         android:layout_width=fill_parent
         android:layout_height=wrap_content /
 /LinearLayout

 pblue.xml(pred.xml and pgreen.xml are different only for the progress
 layer):

 ?xml version=1.0 encoding=utf-8?
 layer-list xmlns:android=http://schemas.android.com/apk/res/
 android

     item android:id=@android:id/background
         shape
             corners android:radius=5dip /
             gradient
                     android:startColor=#ff9d9e9d
                     android:centerColor=#ff5a5d5a
                     android:centerY=0.75
                     android:endColor=#ff747674
                     android:angle=270
             /
         /shape
     /item

     

[android-developers] Re: SeekBar

2009-07-06 Thread peeyush varshney
Hi Jack,

 I have implemented the Vertical SeekBar. But when i am setring the
progress using setProgress() . Progress is ok(means yellow shadow is working
right) but Thumb also should move along with Yellow shadow.. But it is not
moving properly.
I am not getting what should i do..

Thanks,
Peeyush
On Mon, Jul 6, 2009 at 11:26 AM, Jack Ha jack...@t-mobile.com wrote:


 Hi Peeyush,

 Not sure exactly what you would like to do but you might want to take
 a look at the SeekBar.setProgress(position) function.

 --
 Jack Ha
 Open Source Development Center
 ・T・ ・ ・Mobile・ stick together

 The views, opinions and statements in this email are those of
 the author solely in their individual capacity, and do not
 necessarily represent those of T-Mobile USA, Inc.



 On Jul 5, 10:22 pm, peeyush varshney varshney.peey...@gmail.com
 wrote:
   Hi,
  How to set the thumb position when progress has changed.
 
  --
  Thank  Regards
  Peeyush Varshney
 



-- 
Thank  Regards
Peeyush Varshney

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-07-05 Thread Jack Ha

Hi Peeyush,

Not sure exactly what you would like to do but you might want to take
a look at the SeekBar.setProgress(position) function.

--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together

The views, opinions and statements in this email are those of
the author solely in their individual capacity, and do not
necessarily represent those of T-Mobile USA, Inc.



On Jul 5, 10:22 pm, peeyush varshney varshney.peey...@gmail.com
wrote:
 Hi,
         How to set the thumb position when progress has changed.

 --
 Thank  Regards
 Peeyush Varshney
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Seekbar thumb animation

2009-06-25 Thread Protocol-X

Well my problem is i actually want to change the thumb image after it
has been created like say a different one for 25 50 and 75% but it
vanishes.

On Jun 22, 8:31 pm, az9702 az9...@gmail.com wrote:
 AnimationDrawable can be used to implement simplethumbanimation such
 as blinking.

 * Create animation in anim/thumb_anim.xml:

 animation-list
         xmlns:android=http://schemas.android.com/apk/res/android;
         android:oneshot=true

   item android:drawable=@drawable/red android:duration=300 /
   item android:drawable=@drawable/blue android:duration=300 /
    ...
   item android:drawable=@drawable/ball_red android:duration=300 /

 /animation-list

 * Create an ImageView that turns the above XML into AnimationDrawable:
    //mImageView.setVisibility(View.INVISIBLE);
    mImage.setBackgroundResource(R.anim.thumb_anim);
    mAnim = (AnimationDrawable)mImage.getBackground();

 * Setseekbarthumbto the AnimationDrawable:

    mSeekBar.setThumb(mAnim);

 * In onWindowFocuseChanged,

   public void onWindowFocusChanged(boolean hasFocus) {
         if(hasFocus) {
            mAnim.start();
         } else {
             mAnim.stop();
         }
   }

   This step is baesd on disucssion in:  
 http://code.google.com/p/android/issues/detail?id=79#c4

 * Note the imageview is needed only for turning the XML into
 AnmiationDrawable so
   its visibility can be turned off (or using a ViewStub ?)

 * Also need to turn off mAnim as soon as user starts interacting w/
 thethumb.

 As pointed out in
 On Jun 20, 12:11 pm, Protocol-X shawn.bur...@gmail.com wrote:



  I appear to be having the same issue

  On Jun 19, 6:42 pm, az9702 az9...@gmail.com wrote:

   Hi,

   As the seekbarthumbis a drawable so its support for animation seems
   limited.
   It may not be feasible but I would like to hear feedback from those
   who have more experience w/ UI.

   Animations I have in mind are quite simple like a few blinks when
   layout becomes visible.
   With Views, blinks can be easily implemented with alpha  cycles but
   not so for Drawables.

   I explored several ideas but none seems to work well:

   * Using AnimationDrawable does not seem to help as it requires an
   ImageView host.

   * My main activity has an animation on its layout.
     I tried tosetthethumbdrawable to another bitmap onAnimationEnd
   when the main layout is complete.
      The old drawable went away but the new one did not show so 
   thethumbdisappeared.
      I checked the thumboffset to make sure it was not out of range.

   *Seta Drawable callback on the drawable but that also requires a
   view.

   Another way is to have a customseekbarwith a View forthumbinstead
   of Drawable.

   Please let me know if I have overlooked any other options currently
   supported by SDK ?

   Thanks in advance.

   - az9702- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Seekbar thumb animation

2009-06-22 Thread az9702

AnimationDrawable can be used to implement simple thumb animation such
as blinking.

* Create animation in anim/thumb_anim.xml:

animation-list
xmlns:android=http://schemas.android.com/apk/res/android;
android:oneshot=true

  item android:drawable=@drawable/red android:duration=300 /
  item android:drawable=@drawable/blue android:duration=300 /
   ...
  item android:drawable=@drawable/ball_red android:duration=300 /

/animation-list

* Create an ImageView that turns the above XML into AnimationDrawable:
   //mImageView.setVisibility(View.INVISIBLE);
   mImage.setBackgroundResource(R.anim.thumb_anim);
   mAnim = (AnimationDrawable)mImage.getBackground();

* Set seekbar thumb to the AnimationDrawable:

   mSeekBar.setThumb(mAnim);


* In onWindowFocuseChanged,

  public void onWindowFocusChanged(boolean hasFocus) {
if(hasFocus) {
   mAnim.start();
} else {
mAnim.stop();
}
  }

  This step is baesd on disucssion in:  
http://code.google.com/p/android/issues/detail?id=79#c4

* Note the imageview is needed only for turning the XML into
AnmiationDrawable so
  its visibility can be turned off (or using a ViewStub ?)

* Also need to turn off mAnim as soon as user starts interacting w/
the thumb.



As pointed out in
On Jun 20, 12:11 pm, Protocol-X shawn.bur...@gmail.com wrote:
 I appear to be having the same issue

 On Jun 19, 6:42 pm, az9702 az9...@gmail.com wrote:

  Hi,

  As the seekbarthumbis a drawable so its support for animation seems
  limited.
  It may not be feasible but I would like to hear feedback from those
  who have more experience w/ UI.

  Animations I have in mind are quite simple like a few blinks when
  layout becomes visible.
  With Views, blinks can be easily implemented with alpha  cycles but
  not so for Drawables.

  I explored several ideas but none seems to work well:

  * Using AnimationDrawable does not seem to help as it requires an
  ImageView host.

  * My main activity has an animation on its layout.
    I tried tosetthethumbdrawable to another bitmap onAnimationEnd
  when the main layout is complete.
     The old drawable went away but the new one did not show so 
  thethumbdisappeared.
     I checked the thumboffset to make sure it was not out of range.

  *Seta Drawable callback on the drawable but that also requires a
  view.

  Another way is to have a custom seekbar with a View forthumbinstead
  of Drawable.

  Please let me know if I have overlooked any other options currently
  supported by SDK ?

  Thanks in advance.

  - az9702


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Seekbar thumb animation

2009-06-20 Thread Protocol-X

I appear to be having the same issue

On Jun 19, 6:42 pm, az9702 az9...@gmail.com wrote:
 Hi,

 As the seekbarthumbis a drawable so its support for animation seems
 limited.
 It may not be feasible but I would like to hear feedback from those
 who have more experience w/ UI.

 Animations I have in mind are quite simple like a few blinks when
 layout becomes visible.
 With Views, blinks can be easily implemented with alpha  cycles but
 not so for Drawables.

 I explored several ideas but none seems to work well:

 * Using AnimationDrawable does not seem to help as it requires an
 ImageView host.

 * My main activity has an animation on its layout.
   I tried tosetthethumbdrawable to another bitmap onAnimationEnd
 when the main layout is complete.
    The old drawable went away but the new one did not show so 
 thethumbdisappeared.
    I checked the thumboffset to make sure it was not out of range.

 *Seta Drawable callback on the drawable but that also requires a
 view.

 Another way is to have a custom seekbar with a View forthumbinstead
 of Drawable.

 Please let me know if I have overlooked any other options currently
 supported by SDK ?

 Thanks in advance.

 - az9702
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Seekbar - Snap to value

2009-05-30 Thread Marco Nelissen
On Sat, May 30, 2009 at 8:19 AM, mscwd01 mscw...@gmail.com wrote:


 Hey,

 Quick question...

 Is there a way to define set values (i.e. 0%, 25%, 50%, 75%, 100%) for
 the seekbar widget that enables the slider to snap to the nearest
 set value? For example instead of allowing the user to position the
 slider at an percentage through 0-100, instead the slider can only
 ever be positioned at one of the five set values?


Does setting the range from 0-4 work? If not, you could add an
OnSeekBarChangeListener and reset the value to the nearest one yourself.

Oh and while were on the subject is there an easy solution for
 positioning the seekbar vertically, i'd rather not hack through the
 seekbar source code - but I fear I may have to!


SeekBar does not work vertically.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Seekbar - Snap to value

2009-05-30 Thread mscwd01

Thanks for the quick reply. I shall do as you suggested.

Pity there isn't support for a vertical seekbar though :(

On May 30, 4:26 pm, Marco Nelissen marc...@android.com wrote:
 On Sat, May 30, 2009 at 8:19 AM, mscwd01 mscw...@gmail.com wrote:

  Hey,

  Quick question...

  Is there a way to define set values (i.e. 0%, 25%, 50%, 75%, 100%) for
  the seekbar widget that enables the slider to snap to the nearest
  set value? For example instead of allowing the user to position the
  slider at an percentage through 0-100, instead the slider can only
  ever be positioned at one of the five set values?

 Does setting the range from 0-4 work? If not, you could add an
 OnSeekBarChangeListener and reset the value to the nearest one yourself.

 Oh and while were on the subject is there an easy solution for

  positioning the seekbar vertically, i'd rather not hack through the
  seekbar source code - but I fear I may have to!

 SeekBar does not work vertically.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread Mark Murphy

lggaleon wrote:
 Hello , everybody!
 
 I want to make my own Seek Bar. When I try to override
 onProgressRefresh method,
 
 Eclipse give me an error: the method onProgressRefresh is undefined
 for the type SeekBar.
 
 I cheked listing SeekBar.java and this method is in. Any ideas why
 this happend?

I do not see onProgressRefresh in the 1.1 SDK, and the method is
declared as package-private in the current source code. Hence, it is not
available to SDK developers.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread lggaleon



On Apr 22, 12:24 pm, Mark Murphy mmur...@commonsware.com wrote:
 lggaleon wrote:
  Hello , everybody!

  I want to make my own Seek Bar. When I try to override
  onProgressRefresh method,

  Eclipse give me an error: the method onProgressRefresh is undefined
  for the type SeekBar.

  I cheked listing SeekBar.java and this method is in. Any ideas why
  this happend?

 I do not see onProgressRefresh in the 1.1 SDK, and the method is
 declared as package-private in the current source code. Hence, it is not
 available to SDK developers.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 2.0 Available!

Thank you very much.
That's too bad. So,if I want to make my own seek bar, I need copy and
modify AbsSeekBar and SeekBar
classes? Doesn't make any sense for me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread Mark Murphy

lggaleon wrote:
 Thank you very much.
 That's too bad. So,if I want to make my own seek bar, I need copy and
 modify AbsSeekBar and SeekBar
 classes? Doesn't make any sense for me

Technically, you could put your code in the android.widget namespace, in
which case the package-private onProgressRefresh() method may be
available to you. This is not recommended, unless you are doing this
work as part of making a contribution to the firmware.

Or, you can subclass SeekBar and find ways around having to override
onProgressRefresh().

Or, as you suggest, you can copy whatever classes you need to your own
package and modify them as you see fit.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Training: http://commonsware.com/training.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread Streets Of Boston

What are you trying to accomplish?

Maybe you don't need to override onProgressRefresh.
Maybe you can implement your own SeekBar.OnSeekBarChangeListener and
register this listener with your seek-bar
(seekbar.setOnSeekBarChangeListener(...)).

On Apr 22, 5:03 pm, lggaleon lggal...@gmail.com wrote:
 On Apr 22, 12:24 pm, Mark Murphy mmur...@commonsware.com wrote:





  lggaleon wrote:
   Hello , everybody!

   I want to make my own Seek Bar. When I try to override
   onProgressRefresh method,

   Eclipse give me an error: the method onProgressRefresh is undefined
   for the type SeekBar.

   I cheked listing SeekBar.java and this method is in. Any ideas why
   this happend?

  I do not see onProgressRefresh in the 1.1 SDK, and the method is
  declared as package-private in the current source code. Hence, it is not
  available to SDK developers.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  _The Busy Coder's Guide to Android Development_ Version 2.0 Available!

 Thank you very much.
 That's too bad. So,if I want to make my own seek bar, I need copy and
 modify AbsSeekBar and SeekBar
 classes? Doesn't make any sense for me- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread lggaleon



On Apr 22, 5:21 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 What are you trying to accomplish?

 Maybe you don't need to override onProgressRefresh.
 Maybe you can implement your own SeekBar.OnSeekBarChangeListener and
 register this listener with your seek-bar
 (seekbar.setOnSeekBarChangeListener(...)).

 On Apr 22, 5:03 pm, lggaleon lggal...@gmail.com wrote:

  On Apr 22, 12:24 pm, Mark Murphy mmur...@commonsware.com wrote:

   lggaleon wrote:
Hello , everybody!

I want to make my own Seek Bar. When I try to override
onProgressRefresh method,

Eclipse give me an error: the method onProgressRefresh is undefined
for the type SeekBar.

I cheked listing SeekBar.java and this method is in. Any ideas why
this happend?

   I do not see onProgressRefresh in the 1.1 SDK, and the method is
   declared as package-private in the current source code. Hence, it is not
   available to SDK developers.

   --
   Mark Murphy (a Commons 
   Guy)http://commonsware.com|http://twitter.com/commonsguy

   _The Busy Coder's Guide to Android Development_ Version 2.0 Available!

  Thank you very much.
  That's too bad. So,if I want to make my own seek bar, I need copy and
  modify AbsSeekBar and SeekBar
  classes? Doesn't make any sense for me- Hide quoted text -

  - Show quoted text -

I try to make  universal seek bar, where I can easy change all
parameters(graphic elements, orientation, min and max values etc.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread lggaleon

That's what I'm gonna do - create my own seek bar, but I don't want to
invent bicycle, so I'm gonna use
existing code from Android core

On Apr 22, 7:08 pm, Raphael r...@android.com wrote:
 On Wed, Apr 22, 2009 at 2:47 PM, lggaleon lggal...@gmail.com wrote:
  I try to make  universal seek bar, where I can easy change all
  parameters(graphic elements, orientation, min and max values etc.)

 IIRC you can customize most of the drawables used for the graphic elements.

 If you really want to customize *everything*, wouldn't it be just
 easier to make your own seekbar?

 R/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar

2009-04-22 Thread Streets Of Boston

Note that with 9-Patch drawables and the possibility of setting the
progress-drawable  (and sub-progress-drawable) you can create pretty
funky SeekBars without creating your own version from scratch (maybe a
bit of sub-classing of SeekBar).

On Apr 22, 7:08 pm, Raphael r...@android.com wrote:
 On Wed, Apr 22, 2009 at 2:47 PM, lggaleon lggal...@gmail.com wrote:
  I try to make  universal seek bar, where I can easy change all
  parameters(graphic elements, orientation, min and max values etc.)

 IIRC you can customize most of the drawables used for the graphic elements.

 If you really want to customize *everything*, wouldn't it be just
 easier to make your own seekbar?

 R/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SeekBar does not reach the end

2009-03-10 Thread Kacza

Ok I guess I solved the mystery: It depends on seekbar resolution (max
value). I set max to 100 and now everything looks fine.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---