I need to create a SeekBarPreference with 2 thumbs (min/max functionality).
There are very, very little resources to find on this - mostly just old broken libraries.
I'd like to implement my own. The backend functionality is not a problem - my problem is trying to create the xml widget. Initially I tried to overlay 2 SeekBars on top of eachother but it doesn't seem feasible as only one can be changed at a time.
I'm after direction/a set of steps to implement this RangeBar as there is quite a lot to take on.
Alternatively if there are any current libraries with 2-thumb widget, that are compatible with AndroidX, that would be appreciated.
Please refer below link :
https://github.com/syedowaisali/crystal-range-seekbar
Using this crystal range seekbar library you can modify the seekbar as per your requirements like single thumb or two thumbs and also modify the theme.
<com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar
android:id="#+id/PriceRangeSeekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10ssp"
app:bar_color="#dddddd"
app:bar_highlight_color="#color/colorPrimary"
app:corner_radius="1"
app:data_type="_integer"
app:left_thumb_color="#color/white"
app:left_thumb_image="#drawable/ic_thumb"
app:max_value="500"
app:min_value="50"
app:right_thumb_color="#color/white"
app:right_thumb_image="#drawable/ic_thumb"
app:steps="50" />
Related
I searching for a way to animate views via xml, I am really lost in this part of UI programming.
Can anybody explain to me step by step how to do this?
You can animate android views by using Animation resources.
With xml animations you can set different properties e.g duration, rate of change (interpolator).
AndroidHive has a very good tutorial with a nice set of animations
http://www.androidhive.info/2013/06/android-working-with-xml-animations/
From my experience with xml animations, you won't know what you want until you've played around with different properties.
http://developer.android.com/guide/topics/resources/animation-resource.html
Update:
Interpolators as well are also important,they allow you to achieve a lot more smoothness. But misusing them can also be expensive so be make sure its necessary.
http://developer.android.com/reference/android/view/animation/Interpolator.html
This blog also gives a quick peek into the actual effects of interpolators:
http://android-er.blogspot.co.uk/2012/02/various-effect-of-interpolator-in.html
Is there a library for creating Floating Action Buttons with labels (similar to the Evernote app)?
Evernote Screenshot
The popular libraries seem to be
https://github.com/futuresimple/android-floating-action-button (closest to what I want... ability to expand hide "sub" actions)
https://github.com/makovkastar/FloatingActionButton (Primary function is to hide/show with a scrollview, recyclerview, or listview)
https://github.com/oguzbilgener/CircularFloatingActionMenu (library which has been around pre-lollipop)
Neither of these, to my knowledge, have this capability. Before re-inventing the wheel, has somebody already done this?
This feature request ended up being implemented in https://github.com/futuresimple/android-floating-action-button. This includes labels on both the left and right sides.
If you're interested, see the discussion here: https://github.com/futuresimple/android-floating-action-button/issues/22#issuecomment-66155108
Disclaimer: I haven't used this (yet).
I'd recommend this library over others that I've seen.
Nowadays there are available techniques of manipulating behaviour of the view that enable you to program FloatinActionButton as you want and to have joy that you have made it by yourself!
Fade in/out FloatingActionButton while scrolling RecyclerView . DETAILS
Slide down/up , beside it blog says how to:
Expand floatingActionButton and show subFloatingButtons. DETAILS HERE
There is to much details, "how to do". Therefore I've attached just links to blogs. Anyway I encourage you guys to take a look at those blogs. You will have total control over your application. Currenty I use all solutions from both blog's. Enjoy!
Especially the last library you mentioned looks quite sophisticated. To my knowledge, you can set any kind of View you want to be shown as a Button.
This View could simply be a custom-view of yours that shows an image as well as a label.
In case anyone is still looking for this functionality: I made an Android library that has this ability and much more, called ExpandableFab (https://github.com/nambicompany/expandable-fab).
The Material Design spec refers to this functionality as 'Speed Dial' and ExpandableFab implements it along with many additional features.
Nearly everything is customizable (colors, text, size, placement, margins, animations and more) and optional (don't need an Overlay, or FabOptions, or Labels, or icons, etc). Every property can be accessed or set through XML layouts or programmatically - whatever you prefer.
Written 100% in Kotlin but comes with full JavaDoc and KDoc (published API is well documented). Also comes with an example app so you can see different use cases with 0 coding.
Github: https://github.com/nambicompany/expandable-fab
Library website (w/ links to full documentation): https://nambicompany.github.io/expandable-fab/
I am in a situation like i have to generate UI Controls like Button,Switcher,Progress Bar, Label text etc based on my list Items .
I am looking for a way to generate the controls in a View and add Views with generated controls in a Layout .
Can anyone give me a proper way to do that?
Why not to use Fragments?
Google docs about this here
and little tutorial here
You may want to take a look at the Metawidget source code. The Android version of Metawidget makes extensive use of generating Views and Layouts at runtime (e.g. see org.metawidget.android.widget.widgetbuilder.AndroidWidgetBuilder). You may even find Metawidget itself will suit your needs (it's designed to be embedded into projects for use-cases such as this).
There are a lot of questions on here asking about horizontally scrolling GridViews. A few have answers that lead to some custom classes that manage to do it, yet Google clearly indicates there a standard way to do this. They have an entire page about it in their Design section: Grid Lists. This page illustrates horizontally scrolling grids and implies strongly that this is normal, supported behavior (as it should be). They go into great detail about WHEN to use it. Unfortunately, they neglect to mention HOW to do it. I have searched all day to find an example of how this is accomplished with GridView or any other standard Android UI class, regardless of SDK version. Is their documentation wrong? What is this page referring to?
yet Google clearly indicates there a standard way to do this
No, they do not.
They have an entire page about it in their Design section: Grid Lists.
They have material in the Design section for which there is no out-of-the-box implementation in the Android SDK. Other examples include the drawer, some of the gestures, and section headings in lists.
Is their documentation wrong?
It is design documentation. To that extent, it is not "wrong" to have a design that calls for a horizontal-scrolling GridView. The mere fact that the Android SDK does not supply one -- at least at the time of this writing -- does not preclude somebody creating one.
What is this page referring to?
Grids.
try an xml with the following;
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<GridView
//your layout
>
</GridView>
</HorizontalScrollView>
I have an upcoming project that requires me to make a custom layout. I have been looking all over for a way to complete this but with no success. The layout will have custom buttons that need to fit the screen and some other custom views. In other words I need it to look the same on all types of devices. So these custom views need to stretch to fit the screens. Something similar to the weather bug app but the buttons will be at the top and there won't be so many options. The buttons will fit the screen width wise. Basically the layout will not contain any stock UI.
I would like to have a book or tutorial that I could follow to help me out here.
check out this blog: http://blog.stylingandroid.com/
there are a lot of good examples for every kind of layout manager in Android.
Furthermore I strongly recommend to you to have a look in the Android's API Demo and source code.
For creating custom view, that's the best resource: http://developer.android.com/guide/topics/ui/custom-components.html
good luck!