seekbar

unable to get right position of texBox in Thumb of seekbar

牧云@^-^@ 提交于 2019-12-11 19:46:08
问题 I am working in android. I am designing a seekbar. I added thumb there. It is showing at right place. But at that thumb I want to show progress in text box. For this I am using this code: int xPos = ((seekbar.getRight() - seekbar.getLeft()) * seekbar.getProgress()) / seekbar.getMax(); But this x coordinate is not exact. It is a little bit different. Please suggest me what should I do for this. 回答1: You've calculated the distance along the seekbar, so you just need to add seekbar.getLeft()

How to get a seekbar after clicking button

故事扮演 提交于 2019-12-11 15:46:56
问题 I made an application on paint. I want to control the size of brush being used in paint using seek-bar. In the menu(options) ,I have an option of changing brush size. So, by clicking on it, a seek bar should appear and I should be able to control that using save button (to set) and then use that value inside paint. How do I do that? 回答1: Make seekbar visible inside xml or when you get its reference in onCreate method. on button click make it visible. Use latest values by registering

Accessing Fragment's seekBar value from Activity

旧街凉风 提交于 2019-12-11 14:34:25
问题 I have an Activity (MainActivity) which extends to Activity and a related Fragment (FragmentFive) There is a seekbar placed in Fragment whose value I want to access from MainActivity. How to do it? API level 18 or above only. MainActivity has a Button which direct to FragmentFive when clicked: android:onClick= "goFag5" An example code for Activity will be very useful! Code for Fragment is as below; FragmentFive.java public class FragmentFive extends Fragment { private SeekBar RedBar; public

Prevent SeekBar from moving past a dynamic point

谁都会走 提交于 2019-12-11 12:53:11
问题 I need two SeekBars for setting a minimum and maximum, and the thumb on each SeekBar cannot move past the other. Is there a way to disallow moving the SeekBar past a specific point? 回答1: Found the solution myself: in SeekBar.OnSeekBarChangeListener.onProgressChanged() method, just set the progress to a correct value, which in this case is the same as the other SeekBar @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (!isLegalMove(seekBar)) {

Android SeekBar with Thumb BELOW the bar

北战南征 提交于 2019-12-11 12:06:00
问题 I'm trying to implement a Seek Bar following the design of the art team. They want a thumb that is not centered vertically, but rather below the progress bar (I would post a picture, but I don't have enough reputation yet to do it). I have been playing with the attributes like the thumbOffset that controls the horizontal offset, but I haven't been able to find anything to indicate a vertical offset or padding. As a result, I'm only able to get a seek bar where the thumb is centered vertically

Android Time Range Seek Bar

筅森魡賤 提交于 2019-12-11 11:05:43
问题 I want to allow the user of my app to trim a specific part from a video. And i'm looking for a solution that can help me make a time selection slider with two thumbs(Max and Min time). This is a sample of what i want to achieve . I know that there is already some librarys that can help: android-range-seek-bar Material Range Bar But they work only with floats and integers. My question is how can i make it work with time values ? 回答1: Basically you can represent time with a numeric type! With

Android Drawable setLevel(); not filling SeekBar appropriately

孤街浪徒 提交于 2019-12-11 10:18:35
问题 Okay so I've been able to customize a few SeekBar's to be used as a Bar Graph type of image, but since I need to be able to switch between a Green or Red Image (depending on certain values) which you can see below. The problem is that regardless of what value I use in the setLevel for the Drawable it doesn't fill appropriately (you can see the image below for an example since the green bar should be closer to the right based on the two values) Below is the code for the section that setups

Is it possible to change the shape of android seek bar?

我的未来我决定 提交于 2019-12-11 10:03:01
问题 I want to implement something similar to android seek bar.But not in a linear fashion,in an arc shape. is it possible to customize the seek bar in an arc shape? 回答1: You can't make SeekBar to draw its thumb any other way than offset horizontally. The code that actually draws thumb is in AbsSeekBar.onDraw, and there it's seen it's just horizontal offset. You may however make your own widget extending ProgressBar, which would draw thumb whatever way is needed (in arc). But you'll also need to

Custom Seekbar thumb vertical position issue

青春壹個敷衍的年華 提交于 2019-12-11 09:29:47
问题 My custom SeekBar looks bad. Thumb's vertical position not shown correctly. I have volum_control with 350x83 pixels size and volum_control_slide with 83x83 pixels size. I put them to drawable-hdpi folder. <SeekBar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/seekbar" android:layout_width="350px" android:layout_height="183dp" android:progressDrawable="@drawable/volum_control" android:thumb="@drawable/volum_control_slide" android:max="100" /> How can I change

Android seekbar - no color tint parameters

心不动则不痛 提交于 2019-12-11 07:57:32
问题 See what's installed in the picture Emulator is set to 4.4.2. MinSDK set to 16. Error: No resource found that matches the given name: attr 'android:progressBackgroundTint' etc Seekbar does not have the following parameters: colorControlActivated, progressbackgroundtint, progresstint, thumbtint How to change color of seekbar? Main.axml seekbar style: <SeekBar p1:layout_width="250dp" p1:layout_height="wrap_content" ... /> Xamarin.Diagnostics [I:sdk]: Key HKCU\SOFTWARE\Novell\Mono for Android