seekbar

Using SeekBar and setProgress doesn't change seekBar position [duplicate]

孤街醉人 提交于 2019-12-04 01:04:23
问题 This question already has answers here : Android SeekBar set progress value (6 answers) Closed last year . I am using a Seekbar in a fragment and need to move the Seekbar to different positions. However, setProgress(xxx) is not working. How do you trigger this method programmatically for a Seekbar : public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) ? Moving the Seekbar manually works fine. 回答1: It's a Bug in ProgressBar! The setProgress(...) seems to not trigger

拖动条SeekBar

瘦欲@ 提交于 2019-12-03 20:10:31
1. SeekBarDemo public class SeekBarDemo extends AppCompatActivity { private SeekBar seekBar = null; private TextView textView = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_seek_bar_demo); this.seekBar = (SeekBar)findViewById(R.id.seekbar); //取得seekBar this.textView = (TextView)findViewById(R.id.text); //取得TextView this.textView.setMovementMethod(ScrollingMovementMethod.getInstance()); //滚动文本 this.seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListenerImpl()); } private class

Android Seekbar float values from 0.0 to 2.0

心已入冬 提交于 2019-12-03 17:39:28
问题 how can I get the values ​​from 0.0 to 2.0 with a seekbar ? values ​​should go in steps of 0.5 ( 0.0 , 0.5 , 1.0, 1.5, 2.0) can someone help me? 回答1: SeekBar extends ProgressBar. ProgressBar has a method public void setMax(int max) Since it only accepts int you'll have to do some conversion from an int value to get the float that you are after. Something like this should do the trick: mSeekBar.setMax(4); //max = 4 so the possible values are 0,1,2,3,4 seekbar.setOnSeekBarChangeListener( new

Seekbar with tooltip android

左心房为你撑大大i 提交于 2019-12-03 17:34:05
Hi All, I am trying to customize android seekbar with tooltip, like the given image. Is there any way to add the textview with the thumb in seekbar. or any other idea Thanks We can do it by getting the bounds of thumb. and setting the x of textview in on progressChanged of seekbar @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { mDistance.setText("" + AppConstants.getDistance() + " miles"); //Get the thumb bound and get its left value int x = mSeekBar.getThumb().getBounds().left; //set the left value to textview x value mDistance.setX(x); } Some

Espresso - Set SeekBar

喜欢而已 提交于 2019-12-03 16:56:12
问题 does anybody know, how to set a seekBar to a specific value or just a click on that view on Espresso UI Testing ? I just get an exception: Error performing 'single click' on view with id... onView(withId(R.id.FilterPriceMax)).perform(click()); 回答1: I use a swipe-action to perform an actual swipe on the SeekBar . This makes sure the callback method ( SeekBar.OnSeekBarChangeListener. onProgressChanged ) is called with fromUser set to true. It is also more in the line of click testing. public

Detecting thumb position in SeekBar prior to API version 16

蓝咒 提交于 2019-12-03 16:16:40
问题 Basically, I need to detect when the progress changes in the SeekBar and draw a text view on top of the thumb indicating the progress value. I do this by implementing a OnSeekBarChangeListener and on the public void onProgressChanged(SeekBar seekBar, int progress, boolean b) method, I call Rect thumbRect = seekBar.getThumb().getBounds(); to determine where the thumb is positioned. This works perfectly fine, but apparently getThumb() is only available in API level 16+ (Android 4.1), causing a

Setting and accessing iOS seek bar on lock screen

非 Y 不嫁゛ 提交于 2019-12-03 15:44:41
I am playing a audio file in iOS app using AVQueuePlayer/AVFoundation. i have set the MPNowPlayingInfoCenter's now playing information like album title, artist, Artwork, like this NSMutableDictionary *albumInfo = [[NSMutableDictionary alloc] init]; MPMediaItemArtwork *artworkP; UIImage *artWork = [UIImage imageNamed:album.imageUrl]; [albumInfo setObject:album.title forKey:MPMediaItemPropertyTitle]; [albumInfo setObject:album.auther forKey:MPMediaItemPropertyArtist]; [albumInfo setObject:album.title forKey:MPMediaItemPropertyAlbumTitle]; [albumInfo setObject:artworkP forKey

Fill two image overlay like seekbar on touch event of image-view

给你一囗甜甜゛ 提交于 2019-12-03 14:52:47
问题 There are two image black and blue while touching on blue image it should fill like progress, I achieved using multiple cuts images without using canvas but not get smoothness on touch, like 100 Pushups application. Actually I'm trying to achieve similar like 100 Pushups application as I mention above, I got one link to but that's achieved using canvas and I want to achieve using Images, I Google but no luck, any link or tutorial similar to that application(100 push-ups)? 回答1: Here's

How to show tick marks for Discrete Slider?

家住魔仙堡 提交于 2019-12-03 12:09:31
I'm trying to style a seekbar/slider like the one labeled Discrete Slider - Click (that has the little tick mark indicators) in the Material Design Guidelines . I can't figure out the magical incantation to have the tickmarks show up, does anyone know how to do this? I have a seekbar with 5 positions (0-4) <SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:max="4" /> NameSpace Add tick marks with the style attribute: <SeekBar android:id="@+id/seekBar" style="@style/Widget.AppCompat.SeekBar.Discrete" android:layout_width="match_parent" android:layout

Custom SeekBar Drawable Android

耗尽温柔 提交于 2019-12-03 11:48:46
问题 I want to personalise the default Android seekbar to: I read about nine patch image and created 6 png images. The first three are for the gray progress bar (progressDrawable), as shown below: Right image Center image Left image The result should be: The blue images represent the progress and are as follows: Right image Center image Left image And the thumb is as follows: My question is, how can I use nine patch image to generate the custom seekbar exactly as the first picture and how can I