I need to create a custom progress bar with a different style. Hopefully, I found a good example how to achieve this in this thread: Custom Drawable for ProgressBar/ProgressDialog, and it's working fine.
However, I need also to display the played time in a simple view just above the progress bar. The tricky part is that this view should move along with the progress of the progressBar and display the minutes and seconds.
To fully understand me what am I talking about, just take a look at the Vimeo player: https://jira.sakaiproject.org/secure/attachment/25159/Vimeo+player+in+Sakai.jpg. (00:22).
Could you please give me some some directions from where to start, and how this effect can be achieved?
My first idea is to get the duration of the audio file (milliseconds), and then depending of the current position, convert the milliseconds to pixels and move the View horizontally with "X" pixels.... but maybe there's a more intelligent solution.
I know this answer is late, but i saw your post today, and a bit later i found that blog entry. I think part 2 is exactly what you are looking for.
Ok, it only shows the progress in the bubble above, but I think it will guide you to the right way
Related
How can we change the button text and gif loading image on button click till we didn't get the server response in android.
please see the image:
Thanks in advance...
Here's an implementation of what your asking, it's bare bone but it will get you started:
ProgressBar
At the moment, when the user clicks the button, it will display the drawable (and animate) for you but you will have to dismiss the loading animation manually once you've finished with your background task via:
_progressButton.stopLoadingAnimation();
This will dismiss any animation for you and display any previous text that was there. The only thing missing it that there is no text whilst the animation is in progress, but I think you can hack something together for that. I plan on extending this a little further so that it will allow you to call something like _progressButton.setProgress(10) and then set the percentage that is done. I may even make it thread safe.
You should also be able to style it exactly how you have shown in your screenshot.
To use the code, simply download the project, there's sample code there that is pretty much self explanatory.
i found a design in IOS that i really like but i cant figure out how to do it in android i have tried doing a custom spinner and am having a hard time with it and i thought of using a pop up but i need to be able to put clickable button in the pop up, so i think a spinner is my best change. I am going to post a picture of what i am trying to accomplish, specifically on the little half box on the top of the drop down! Thanks would really Appreciate some help thanks!!!! ![enter image description here][1] Also i have seen this in Android as well so i know it can be done. http://i.imgur.com/L1ftrSU.png
It's action you showed in your image is called QuickAction, there are many tutorials on how to create one:
Try the NewQuickAction lib, it has a number of modes, and one of them will give you exactly the same layout as your sample image. Here's a quick tutorial for using the library. Have used this lib for 2 years and worked quite well.
This tutorial offers another method to accomplish the same thing, worth checking out as well.
You can use OptionMenu. Refer to this link!
I have a need to create a circular dial/rotary style component for use in an application. It's essentially a circular menu that allows users to select from the items that are ringed around it, and then they can click the button in the center to activate the selected item. However, I've never created a custom UIView of this type, and don't really know where to begin. Can anyone give me any pointers as to how I would draw the view and then rotate it as the user drags their finger? I obviously know how to intercept touch events, etc. but I'm not sure how to actually go about manipulating the UI appropriately. Any tips or pointers would be great!
I don't know if you've already found a solution to this, but here is a nice overview of how to get started:
http://shahabhameed.blogspot.com/2011/05/custom-views-in-android.html
For you, I think you can extend an existing View, that View being the SeekBar. You can take the standard SeekBar and draw it in a circle.
Finally, here is a source code that does the rotation with a volume knob. It is its own project though, so you have to do some work to use it in your own app.
http://mindtherobot.com/blog/534/android-ui-making-an-analog-rotary-knob/
Good Luck!
I have a neat library to do this. It is extremely stable and well maintained. https://bitbucket.org/warwick/hgdialrepo
Heres a youtube demo: https://youtu.be/h_7VxrZ2W-g
This library comes with a demo app with source code and the demo app actually uses a dial as a menu, So I think this should be the perfect solution for you.
The New York Times Android application has something like a notification bar at the top.
I suspect this is an included layout with a text view. The thing is that they managed to drag that title down in order to present the top news.
Can anyone give any insight on how to replicate this?
Edit:
Yes the drawer was the solution to my problem nevertheless i needed one as New York time and the default SlidingDrawer are meant to only go bottom to top... so i looked over on St Google and got a nice Custom Componente Sliding Drawer, get some difficult to make it work as i need it but you can follow the case in Layout positioning problem with Custom SlidingDrawer
I think what you're looking for is a Sliding Drawer.
http://developer.android.com/reference/android/widget/SlidingDrawer.html
edit:
the link I post is good for the documentation, but might not give a full idea of what is actually happening. A good place to find an example might be here:
http://techdroid.kbeanie.com/2009/08/android-sliding-drawer-example.html
They have most likely just used a TextView as you said. Moving it down can be done in multiple ways. The simplest is just to have another view or view group in top of it and initially set its visibility to gone, and then to visible when you want to show it.
Sorry, i misunderstood what you meant. Since the top element was so small, i simply thought you meant you wanted to expose a element on top of the other element. Ill up vote the other answer since this is most likely what you are after :)
I am looking for a class that implement a horizontal slider bar like the one on the "lock" screen. In other words, user must slide the bar from left to right to run an activity. Thank you so much for your time.
Internally, Android uses a class called SlidingTab for this (the main lockscreen is in a file called LockScreen.java. As with all Android core code, it's Apache licensed. At the risk of sounding like a broken record here on SO, download the AOSP and read through the code whenever you have a "how did the Google folks do x?" type of question (or even when you don't; there's some good stuff in there).
Maybe a Seek Bar might help you towards a solution to your problem. If this works for you let me know, because i am interested in a solution to that as well. Thanks
The link is the developer document for that feature.
Here is an example that extends a horizontal ProgressBar so that the user can set the "progress" by sliding left/right. It's actually quite straight forward, it just overrides the onTouchEvent() method, does some minor mathematics and sets the progress value depending on the TouchEvent's X coordinate.