List without scrolling - android

i need make a list that not have scrolling, because i will have two lists, and wish you had just one scroll, and they were wrap_content, there exist object to make it?
Thanks in advance
Sorry by my English
I up a image to you understand me
http://imagizer.imageshack.us/a/img819/4513/m0u2.jpg

listView.setScrollContainer(false);
More you can read here.
You should set fixed height for each ListView, using weight in your xml.
The way to do this: link.

Related

How can I create an horizontal ListView in Android with fixed number of items?

I searched for a few hours over the internet but I didn't find any example or documentation explaining how to create an horizontal list view with fixed number of elements.
Basically, I would like to have, let's say 3 elements out of n(total number of elements) which are displayed on the screen without taking into consideration the size of the scree. The elements can be bigger or smaller proportionate to the screen but the number of visible elements should be the same, fixed. see the image.
How can I do that? Any hint is appreciated! Thank you!
You can use TwoWayWiew third party library (i dont really recommend this solution), or if you want to avoid to use lib for this, just use RecyclerView, and you can set HORIZONTAL param to layout manager.
I would not use a ListView for this, but a RecyclerView instead. Performance is better in a RecyclerView and I honestly find them easier to work with. You can allow for horizonatal scrolling via the LayoutManager for your RecyclerView.
If don't mind scrolling horizontally by 3 items you could use a ViewPager with each View containing a LinearLayout (orientation horizontal) with three of your elements that have a
android:layout_width="0dp" and an
andriod:layout_weight="1"
for even distribution.
When you "scroll" you would just animate the next "page" into the screen bringing in the next 3 elements.
This might not be the most elegant solution but I think it would behave the way you want.
use the linear layout with its orientation set as horizontal under the relative layout

Scroll text inside recyclerview element

I have a recyerview which contains in each row a picture, a title and a description.See here.
The height of an element of the recyclerview is fixed.
The problem is the description could be too long for the fixed height.
To solve it I would like to implement a vertical scrolling that could allow me to read everything in any cases.
I have no idea where I have to search to do that.
Someone has a good tutorial to follow ?
Thank you.
As far as I know, you will get scroll conflicts by doing this as the recyclerview will not know whether to scroll itself upwards or to scroll the actual text inside it's views.
A better approach is to implement an expandable textview, an easy to use library can be found here:
https://github.com/Manabu-GT/ExpandableTextView

Listview, Gridview or something else for single column of scrolling images

re: example http://www.youtube.com/watch?v=Ej--SFh963M
Similar to the above app, I am trying to create a scrolling list of images, like a Listview but with images only. (I also need to set it to fill a set height and width, say 85% of the height, 10% of the width of the screen). Is a one column Griview best? (I have had troubles in the past selecting the image height of a gridview programatically).
Any online tutorials precisely for this you have used?
If your view is going to have only one element per row, then the best and correct way of implementation is to use a ListView. The GridView should or can be used when there are going to be multiple elements per row. I believe the purpose of ListView satisfies its role for your need.
For creating a GridView with uneven rows similar to how Pinterest looks. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore. Check out this link, there is a library named "StaggeredGridView" : https://github.com/maurycyw/StaggeredGridViewDemo
As there is no text and only one column of buttons, it seems like I overlooked the obvious answer of using a scrollview of buttons, which is what I will go with. Thanks for your assistance.

Android: How to organaze layouts

I need to organize complicated Activity with many Views inside.
Also layout should depending on screen orientation.
Inner elements - it actually some templates.
Help me please to find out what is the best way to organize this?
Should I create layouts dynamically or I can create some xml templates and use them?
And if I want to realize Template3 as clickable element is it enough to define onListItemClick for ListView (ListItem has an xml declaration, so the ids will be the same for all elements).
And all the template elements should have the same width and height. It's OK with the ListView, But what to do with Template1? I want each items has the same height, and match parent view.
How to organize onConfigurationChanged() ? Where and how I can realize adding or removing 3 additional Template1 elements? Dynamically? Or create 2 xml?
What is the best for performance?
Maybe someone can give me a link to "example of complicated layout" or something like this? :)
Try searching on concept of fragmentation,it will solve the problem.

Is there a way to show the scrollbar of ListView all the time?

Is there a way to always show the vertical scroll bar of the ListView?
Sure, it is possible. Try View.setScrollbarFadingEnabled.
There is actually a very easy way to do this using following property in xml file.
android:fadeScrollbars="false"
This will solve the problem.
Simple, make the client area (the area where you are placing the widgets in ScrollView) larger than the screen size. So scroll bar(s) will be visible all the time.

Categories

Resources