Android: ListView with left status line - java

Need something like this: ListView and Status Line
Please could you suggest the best way to do this?
add for each row - line which be stretched over the whole height (and half for first and the last item), or a separate element?
Or maybe there already some library?

Just make a View as a line.
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#45a"
android:id="#+id/line"/>
and you can animate this view according

Yeah, 3 different layouts would be the best choice, 1° element with the line stretching only in the second half, middle elements with full line stretch (both top and bottom) and the last element with only top line. You need to check the position in which you're inflating the layout, and inflate the correct one of your choice!

Related

A way to adapt the position of items in an android layout

I am currently work on an Android project, I have to show several check-box, now they are in a Relative Layout and all are positioned to their left neighbor.
So in landscape, I have a line of check-box, the problem is if I switch in Portrait the line is cut, because there are too many elements. So is there a simple way too automatically go to the next line when the element will be cut ?
I can change the layout type (relative, linear, ...).
U may check this library flowlayout coz u cant easily achieve this behavior.

ExpandableListViewGroupPosition?

I have implemented ExpandedListView. I have 2 questions for that
When I expand and scroll child item ,the group header also scroll ,is any way to keep that group header at top always even we scrolling child item list ?
Is any way to fit ExpandableListView (before child items comes) to phone screen , right now in bottom lot of blank space ?
For your first question:
no there is no why that you can fix the group view, if you want to fix group i would suggest you to make four list view on screen. where in a Linearlayout make 4 textview and 4 listview placed alternately so that they are fixed and if there is no child inside you can write some appropriate message saying there is nothing to display.
And i guess it solve your second question as well ?
1. When I expand and scroll child item ,the group header also scroll ,is any way to keep that group header at top always even we scrolling child item list ?
No, ExpandableListView's Header's (Parent) and Childs are connected to eachother You can not independently scroll the Child views besides scrolling parent views.
2. Is any way to fit ExpandableListView (before child items comes) to phone screen , right now in bottom lot of blank space ?
You can fit the ExpandableListView by setting its height and width to fixed but it will be always affected as and when you will add some data into it. Till then you can not fit it into the screen.

Linearly align items in a View to go to next line if space is filled

I want to show buttons in an align as shown in the pic.
If i put them in a Linearlayout with orientation Horizontal, its ok.But how can i proceed to next line?
Following image shows some TextViews align Horizontally but i have no idea how to make them go to Next Line.
There are no standard layouts (in the Andorid library) like the Swing's FlowLayout that can solve this problem. There are a couple of open source implementations of layouts that have the functionality you need. Here is an example: https://github.com/ApmeM/android-flowlayout
You could also read the answers to this question (which is essentially the same question): How can I do something like a FlowLayout in Android?

How to disable a childdivider in an ExpandableListView in Android

I'm trying to hide child dividers in my ExpandableListView. I've managed to make the child dividers transparent by adding:
<ExpandableListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:childDivider="#00000000"/>
But it removes the last divider of the current group as well as removing the first divider of the next group. I want to keep the dividers on both sides of each group, and remove the internal dividers between children.
I'd post an image showing what I'm looking for but this is my first post and it wouldn't let me. :)
Any help would be appreciated!
Here's how I fixed it.
In the parent groups, I gave them borders on the top so that there was separation between the previous child groups and the current parent group.

Make top row of GridView non-scrollable

I have a GridView of 9 rows of which the first one is sort of "header" row.
As there are 8 more rows they flow beyond the end of screen and need to be scrolled down to.
However this scrolling also causes the first row to go "off-screen".
Was wondering if there is any way I can prevent the first row alone from being scrolled off?
I dont want to make this a separate LinearLayout as it is part of a dynamic View (the GridView) that I create at runtime.
TIA
Was wondering if there is any way I
can prevent the first row alone from
being scrolled off?
Not that I am aware of, sorry.

Categories

Resources