Android: Seekbar doesn't scroll all the way to end - android

Hi I have a seekbar in my app that i need to snap to 7 positions. To achieve this I set the max property of the Seekbar to 7. NOw, to be aesthetically pleasing, i need to be able to drag my seekbar all the way to end of the bar, but when I set a value to the max property, the scroll won't drag all the way to end. Why does this happen and how can I get around it?

try adding some padding to the sides of your seekbar

Related

SeekBar add padding to only the thumb

I have a SeekBar that I'm trying to implement custom styling on. The edges of my progressDrawable have rounded corners which I think looks great, however when i drag the thumb to the edges it looks strange.
This is how the SeekBar looks when I use an "in the middle" progress value like 80.
And this is how the start and end look when I use a progress value of 0 or 100 respectively. You can see how the rounded corners look strange due to the way the thumb goes all the way to the end of the SeekBar.
I'm looking for a way to get the thumb to STOP at around 16dp before the end of the SeekBar, but for the progressDrawable to still fill it in as if it had gone to 100.
I also just noticed that the thumb seems to cut off half way through it's drawable. That is not related to what I'm asking, so I'm trying to avoid any confusion there.

Ranges on seek bar

Hi I want to put the ranges on seek bar. I am able to run seekbar successfully. Even though on sliding i can get the values also. But on the top of it I have to set ranges as it is shown in image. Please let me know how can I do that. It would not be hardcoded because with seekbar I have given plus minus button also, so that If I click on plus button so right now range is from 0 to 100000 with 10000 interval. Then the range value will change to 100000 to 200000 and so on. so with that ranges should also change.
Please suggest.
Thanks in advance.
What you are looking for is simply indicators for the range, so it doesn't need to be part of your seekbar.
I would do it in the layout. Above the seek bar, create 10 textviews that are weighted evenly in a linearlayout.
Then just have some simple logic to update the text on these textviews when the user changes the range.

Partially hide Layout programmatically?

What should I do to partially hide some layout from code? Should I play with setMargins?
Basically, I want to detect size of the screen and then I want that element X becomes visible only 10% of its width? I know how to do it all except how to make it partially hidden or offscreen?
Look at these images to see what I want to achieve. Image 1 - UI element is in the center. Image 2 - I set in code it's moved to top offscreen thus becoming only partially visible.
I found out that here as well the best solution is to use Animation (TranslateAnimation) by setting this on the first screen load and setting its speed to minimum value of 1 millisecond. The transition in reality is unnoticeable to a human eye.
Also do not use margins as they simply "push" element from one side without making it goes offset. If you have any child in the layout you want to offset, they all will be squeezed as you increase margin values.
NOTE: if you ever want to use animation on that screen on the element you offset before, take into account the negative value of offset. Otherwise your animation will not look nice. To avoid bumping effect, take special care of fromXDelta value.

Android clip upper part of text in TextView

I need to have two TextViews displaying same number, first of which should display upper half and second lower half in order to animate those parts differently. (See images below, there's an example with '8' digit).
http://img403.imageshack.us/img403/2461/bottomtop.png
While clipping bottom is perfectly simple (setting TextView's height is just enough), the second task I find very hard. The only solution I came up with till now is to wrap TextView into some layout and set it's y position to negative - it would be OK, but I need to care about optimization because there will be many digits animated in that way simultaneously.
Do any of you know how to achieve this in more effective way?
What about overlaying the top textview OVER the bottom textview (maybe with the white spacer as well?

Is it possible to have a SeekBar's thumb image extend outside the bar?

I have set negative paddings on my custom seekbar so that the round thumb image can go outside the bar, but the thumb isn't rendered out there, is there anyway to force the thumb to be drawn outside those bounds?
Sorry guys, I'm new to Android development, and have been tasked with fixing an existing application. The problem is that we have a custom rounded looking track bar, which consists of two rounded 'end cap' images and a 1 px background that is tiled to create the seekbar. As far as I can tell there was never one image that could be set as the background of a normal SeekBar, which is why a custom one was created.
The thumb is a circle and needs to 'fit' into the end caps - the three pieces of the bar are in a relative layout. Right now I'm kind of unclear as to how the 1 px background png gets stretched as the seekbar bg, otherwise I would try to tack on the two endcaps onto that drawable some how ... ?
Please let me know if this was unclear and I'll try to post any followup info. Thanks in advance for any advice!!
Oh, I'm using Android 2.1 if that's relevant to anyone's interests :)
This is what it looks like when the thumb all the way over - outside of the seekbar. Ideally what I need is for the thumb to be shown as 'inside' the endcap image :-/
I was having the same problem, my thumb is very big length wise and it kept being cut off. Make sure that you set the offset property AFTER you set the drawable for your thumb, like this:
seek.setThumb(Main.app.getResources().getDrawable(R.drawable.thumb));
seek.setThumbOffset(15);
This will set the correct offset when your thumb is very long.
Try to change the thumb offset property, after that it will not go off from the seek bar
I just ran into this issue. I was able to get satisfactory results by using android:paddingLeft and android:paddingRight within the XML.

Categories

Resources