Android-Advance | 安卓系统以及进阶教程
kandi X-RAY | Android-Advance Summary
kandi X-RAY | Android-Advance Summary
安卓系统以及进阶教程
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Runs the demo
- Get the largest value in the array
- Compares two integers
- Main method for testing
- Gets the path from root to the given node
- Display the permutation
- Build a map from an array of integers
- Convert this tree to a tree
- Recorder tree
- Test program
- Push a new node
- Main entry point for the K algorithm
- Returns - 1 - > k
- Main method for testing
- Checks if there is a circle in the head
- Main function of the search
- Find in the array
- Calculate power
- The minimum number of characters in the array
- Checks to see if a set of integers are in the same order
- Return a list of nodes in the tree
- Prints all the nodes in the tree rooted at root
- IN order
- Determines whether an array of numbers is continuous
- Process the tree rooted at the root
- Generate a permutation
Android-Advance Key Features
Android-Advance Examples and Code Snippets
Community Discussions
Trending Discussions on Android-Advance
QUESTION
I am designing a relatively complex UI, i have searched stackoverflow and haven't found similar design. There could be many approaches to this, but i would like to ask expert opionions on how to achieve this and i would like to share my approach and make sure i am doing it the right way. My approach is that i have created a recycleview with header and inside header recycleview i am using an expandable recycleview library developed by h6ah4i (taken from github). Please let me know if there's a better approach to this.
The following image preview is a live mockup of final result i would like to get. It's not the actual screen. My question is what is the best way to achieve this, should i use expandable recycleview or expandable listview in recycleview header. I appreciate any answer as approaches or libraries it doesn't have to be similar to my code. Any suggestions are welcomed. I hope this post will also help other people like me in search of similar solution.
RecycleView Adapter
...ANSWER
Answered 2020-Oct-06 at 12:44You were right to search a library that does most of the work for you, but I don't like the library you picked. It does not seem very flexible and concise. I suggest to take a look at Groupie, its API is pretty clean. Also check Reddit for some discussion on libraries.
If you want to write it yourself I think you can solve it without nested Adapter
's. Just create an 'expandable group' item type. Then in getItemCount()
you count all items and their nested items (when expanded). Take a look at the Groupie source code.
Some additional feedback on your code:
- I would explicitly add the header to the list of items you give to your adapter. So instead of a
List
, you rather provide aList
and have aHeaderItem
andPlantsItem
. This way you have a clear separation between your domain models (Plants
) and view models (the items) in your adapter. - Your
onBindViewHolder()
method does way too much. Let yourViewHolder
subclasses take care of that. Create an abstractViewHolder
with an abstractbindTo(Item item)
method. Then in yourHeaderViewHolder
subclass it and do the actual work (after an instanceof check). - Have a look at view binding, it can make your code more concise. (So does Kotlin.)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Android-Advance
You can use Android-Advance like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Android-Advance component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page