Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: How to Create Play/ Pause Button and Volume Control Seek Bar on BlackBerry Screen?

hi

if i use this code:

 

 slider = new SliderField(
                Bitmap.getBitmapResource( "slider_thumb_normal.png" ), Bitmap.getBitmapResource( "slider_progress_normal.png" ), Bitmap.getBitmapResource( "slider_base_normal.png" ),
                Bitmap.getBitmapResource( "slider_thumb_focused.png" ), Bitmap.getBitmapResource( "slider_progress_focused.png" ), Bitmap.getBitmapResource( "slider_base_focused.png"),
                Bitmap.getBitmapResource( "slider_thumb_pressed.png" ), Bitmap.getBitmapResource( "slider_progress_pressed.png" ), Bitmap.getBitmapResource( "slider_base_pressed.png"),
                50, 0, 10, 10, FOCUSABLE );
            slider.setPadding( 5, 5, 5, 35 );
            slider.setBackground( BackgroundFactory.createSolidBackground( 0xD3D3D3 ) );
            hfmSecond.add(slider);
            hfmSecond.add(_startPlayingButton);
            add(hfmSecond);

 

i am able to display the seek bar,but i am not able to display the playbutton?

Please use plain text.
Developer
shahumang8
Posts: 643
Registered: ‎08-09-2010
My Device: Not Specified

Re: How to Create Play/ Pause Button and Volume Control Seek Bar on BlackBerry Screen?

Please provide me more code so i check into detail.

 

Thanks.

Please use plain text.
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: How to Create Play/ Pause Button and Volume Control Seek Bar on BlackBerry Screen?

public class SeekBar extends UiApplication {
    private static SeekBar bar;
    private UIExampleSliderScreen screen;
    public static void main(String args[]){
         bar=new SeekBar();
        bar.enterEventDispatcher();
    }
    public SeekBar(){
        screen=new UIExampleSliderScreen();
        pushScreen(screen);
    }
    
    public  class UIExampleSliderScreen extends UIExampleScreen
    {
        private ButtonField _startPlayingButton;
 
        public UIExampleSliderScreen()
        {

            super( 0 );
      _startPlayingButton = new ButtonField("Play", ButtonField.CONSUME_CLICK);
      HorizontalFieldManager hfmSecond = new HorizontalFieldManager();
            setTitle( "Slider Example" );
            
            SliderField slider;
            
            slider = new SliderField(
                Bitmap.getBitmapResource( "slider_thumb_normal.png" ), Bitmap.getBitmapResource( "slider_progress_normal.png" ), Bitmap.getBitmapResource( "slider_base_normal.png" ),
                Bitmap.getBitmapResource( "slider_thumb_focused.png" ), Bitmap.getBitmapResource( "slider_progress_focused.png" ), Bitmap.getBitmapResource( "slider_base_focused.png"),
                Bitmap.getBitmapResource( "slider_thumb_pressed.png" ), Bitmap.getBitmapResource( "slider_progress_pressed.png" ), Bitmap.getBitmapResource( "slider_base_pressed.png"),
                50, 0, 10, 10, FOCUSABLE );
            slider.setPadding( 5, 5, 5, 35 );
            slider.setBackground( BackgroundFactory.createSolidBackground( 0xD3D3D3 ) );
            hfmSecond.add(slider);
            hfmSecond.add(_startPlayingButton);
            add(hfmSecond);

           /* slider = new SliderField(
                Bitmap.getBitmapResource( "slider2_thumb_normal.png" ), Bitmap.getBitmapResource( "slider2_progress_normal.png" ), Bitmap.getBitmapResource( "slider2_base_normal.png" ),
                Bitmap.getBitmapResource( "slider2_thumb_focused.png" ), Bitmap.getBitmapResource( "slider2_progress_focused.png" ), Bitmap.getBitmapResource( "slider2_base_focused.png"),
                20, 0, 16, 16, FOCUSABLE );
            slider.setPadding( 20, 20, 20, 20 );
            add( slider );
            add(_startPlayingButton);

            slider = new SliderField(
                Bitmap.getBitmapResource( "slider3_thumb_normal.png" ), Bitmap.getBitmapResource( "slider3_progress_normal.png" ), Bitmap.getBitmapResource( "slider3_base_normal.png" ),
                Bitmap.getBitmapResource( "slider3_thumb_focused.png" ), Bitmap.getBitmapResource( "slider3_progress_focused.png" ), Bitmap.getBitmapResource( "slider3_base_focused.png"),
                Bitmap.getBitmapResource( "slider3_thumb_pressed.png" ), Bitmap.getBitmapResource( "slider3_progress_pressed.png" ), Bitmap.getBitmapResource( "slider3_base_pressed.png"),
                5, 0, 8, 8, FOCUSABLE );
            slider.setPadding( 20, 20, 20, 20 );
            slider.setBackground( BackgroundFactory.createSolidBackground( 0xD3D3D3 ) );
            add( slider );
            */

        }
    }
}


Please use plain text.
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: How to Create Play/ Pause Button and Volume Control Seek Bar on BlackBerry Screen?

Please use plain text.
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: How to Create Play/ Pause Button and Volume Control Seek Bar on BlackBerry Screen?

Please use plain text.