Make top row of GridView non-scrollable - java

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.

Related

GridBagLayout: changes alignment after adding checkbox

I have two classes which creates two different dialog box. Both the classes have same code, except one has additional lines of code, which creates a checkbox
first Class, with Checkbox
Second Class, without Checkbox
There is slight alignment difference in "save" button. How can I fix this.
Is there a particular reason you're using fixed row and column sizes? One of the great features of GridBagLayout is its ability to center/align and fill. This also tends to make things look better on different screen sizes, different fonts, etc.
To answer your specific question, my guess is that the checkbox is taller than the row you're putting it into, pushing the next row down.
When I debug GBL, I often set row/column background colors to different things and print out (or view in a debugger) sizes of the things I'm trying to fit into the container.
I had to adjust the row height as the checkbox was taller than the row and was pushing the third row downward( Thanks to Ingrid Biery). so I changed the 2nd row height from 25 to 30 and it worked.

Changing Gridview number of columns based on position

Im currently building an application that implements a GridView. However, i need to split the GridView up. For example, at position zeta the number of columns is 3 then at position 2 3 4 the number of columns change to 1.
I have had a look around but it doesn't look like its possible. Coming from an iOS Background ive done it before in some previous iOS projects so i thought i may be able to replicate it in android.
Any suggestions would be great.
Just a idea not sure if it would work. Making the gridView an auto_fit column,
then based on position make the item cell view width properly so the gridView could either put in multiple cells or just one cell in the row.

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.

set scroll bar position in JTable/SWT Table

I would like to ask question that is not directly related to any technology but it’s a logic level question. Forgive me if I am wrong.
I am trying to solve this issue in Java side.
We have a list view (may be JTable or SWT Table). We are displaying records from a table in to that list. The table may have millions of records. And the table size is keeps increasing. As the table size is huge and it keeps increasing we are keeping a cache of 3000 records and displaying the cache in the table. So at a single point only 3000 records will be there in the view. At this time, the scroll bar of the view (JTable or SWT Table) shall be set based on the cache only (in this case 3000 records).
And based on the user events like, PgUP, PgDwn, DownKey, UpKey, Mouse Scroll etc we are refreshing the cache so that the view will be refreshed.
But we need to give users an actual feel that the scroll position based on the records in the table. I think it is not possible as the scroll position is set by the OS based on the number records in the display. Can somebody can assist me with an alternate method. If I am not explained my question correctly, I will explain this in details. Please help.
Usually a scrollbar is set at the top of the list, or at the bottom, depending on if the property "AutoScroll" is set to true or false.
I believe there IS a method where you can set the scrollbar at a specific point, but last time I tried using it, it was kinda clunky.
It sounds like you're trying to make the scroll bar do two things at once, and that can be confusing. You could use a separate control to the do the paging. A row of buttons in a JToolBar looks nice, but a JComboBox will take up less room. There's some good answers about this here.

Extended JTable clipping problem

Hi I'm using set of classes I found on internet that extends JTable capabilities making me able to merge or split some cells.
Mentioned capability works ok but I have two problems with how the table is displayed. The extended JTable is stored in JScrollPane and it is stored in Box.
The first issue is that when I have a lot of collumns the last one or last two ( depends on how many collumns I have ) is being clipped ( when I move scrollbar to the right edge I don't see last collumn or it is clipped so only the part of the data is visible.)
I did some experiments and I add some empty collumns and that helped so I assume it is something connected with how JScrollPane gets the width of the table it should display but I could not figure out how can I change that. I was trying to call table_.setPreferredScrollableViewportSize(new Dimension()); with Dimentsion set to something really big but it did not help.
Second issue is that when I click on a cell that is placed closer to the right edge then the next cell is being selected. The further the cell is from the left edge the further cell to its right is being selected. I can't see selection when I click on the cell from last collumn.
If there is no easy answer maybe someone knows some open source alternative to display data in table with merging capabilities. I found only commercial ones which cost a lot of money.

Categories

Resources