I want to make a CircularListView that will be coming from corner click of screen and only half list item should be visible before scrolling. And the item in list is in Dynamic nature - .
And I have used these libraries from github but not getting any efficient solution from any of them. These libraries are:
RamotionCircleMenu -> In this library custom layout is not possible.
HellocslCursorWheelLayout -> Here no customization is possible, Item Selection is poor.
JungHsuanCircularList -> When you add items in bulk the item overlaps, circle radius not get updated according to item count(still this one is better)
LukedeightonWheelview -> Only Drawable as item is allowed.
So please let me know if anyone is having solution for it. I want the solution for dynamic item count, custom layout as item and smooth scroll of List/RecyclerView.
I'm Using to this layout manager to show recycler view in android
https://github.com/AndroidDeveloper98/CircularRecyclerView
Related
I want to create a simple view like this. (red circle)
I searched on internet for Bundling in Recyclerview but I could not find any resources.
Can anyone tell me the name of this view or share any tutorial resources.
Can someone share an example of how to do it. Or any Tutorials on how to get this view . - Bounty question
In recyclerview you can do this with item decoration.
An ItemDecoration allows the application to add a special drawing and
layout offset to specific item views from the adapter's data set. This
can be useful for drawing dividers between items, highlights, visual
grouping boundaries and more.
All ItemDecorations are drawn in the order they were added, before the
item views (in onDraw()) and after the items (in onDrawOver(Canvas,
RecyclerView, RecyclerView.State).
refer here
or
you can design a custom layout and inflate it using getViewByType in
viewholder
I think you better to follow this videos, i am sure my side this videos gives you a perfect idea on Android Recyclerview and also provide a solution for problem.
Please follow this youtube link: https://www.youtube.com/watch?v=XhbsNO2_oDI
ItemDecorator from example below doesn't suite you. Try to use Expandable Listview, which helps you to adjust list, when user tap on image below list item, and expand size for another item, for example, chat messages in your image.
Use This Example!
Many apps have a side scrolling list of views: take the new Twitter highlights feature or even the introduction activity of pretty much every app out there.
The main behaviour I'm looking for is a list of views which contain a mixture of text and images, this list of view scroll horizontally instead of vertically & the views 'lock' so they are fully in view no partially.
Is there a built-in view that I'm unaware of (considering I have only been doing this for a few months now I wouldn't be surprised) or something else entirely
Optional request: along side it how would I support pagination style naviagtion
Is there a built-in view that I'm unaware of or something else entirely ?
Yes
You can use RecyclerView to show Horizontally Scrolling List . You can visit this link to implement RecyclerView .
And to add HORIZONTAL scrolling functionality use this link .
I have a little Problem with my ListView.
I fill my ListView with an ArrayList<String> per ArrayAdapter<String> with more than 100 items.
Before my dialog will be show i want to highlight and disable some items. I have found the solution with ListView.post(new Runnable() {...});
I highlight my items with lv.getChildAt(2).setBackgroundColor(Color.BLUE);
and disbable an item with lv.getChildAt(3).setEnabled(false);
I do both also in an OnItemClickListener().
Now my problem:
if in the ListView are 11 items visible at runtime, the the highligt- and disable-pattern will repeat every 11 items.
i.e. if i highlight just the 3. item also the 14., 25. ... item will get a blue background.
And if i disable the 4. item also the 15. and 26. and so on is disabled.
If i scroll fast to buttom and back to top other items are highlighted and disabled.
Another problem is, that i can only access the first (11) visible items in the post-runnable. If i try to highlight the 20. item the app will crash with a NullPointerException.
What can i do to prevent the "item-recycling" and to get full access to all items before the Dialog is shown?
I'm not sure i understand what you want to achieve but here are some suggestions for you.
1) Always Recycle, you should never avoid recicling since you maybe run into another problem, you will run out of memory.
2) In your model implement the checkeable interface, so the model should know if an item is selected or not, Not the view only
3) When iterating each element make use of a ViewHolder and then check the model to see if the elment being inflaed it selected or not and use the desired color
Please have a look at this example link, it describes the use of CAB (Contextual Action Bar) but it uses the things i'm mentioning.
I hope it helps you.
I am showing a list of items in an alert dialog. I'd like to make some items selected by default(highlight a row) - display nth item - when the dialog is shown.
I am a newbie to android and currently i am planning to extend arrayadapter to override getview method to highlight a particular row. But the problem is i am not sure whether my approach is right.
You probably dont need to override the adapter in this case. What you are suggesting will work, however it's cleaner if you have a background selector set for your list then you can mark the items in question as checked and have the selector highlight them. There are some good tutorials on ListViews in the android docs
How can we add custom borders around ListView Items in android.
I know I can use dividers with a custom drawable background but it does not add it for the first and last element and therefore if there is only 1 item in the list, it won't even display it.
Thanks a lot.
There are two xml-attributes called footerDividersEnabled and headerDividersEnabled
and they have their corresponding java methods setFooterDividersEnabled and setHeaderDividerseEnabled.
Hope this solves your problem!