Create a paged GridView - android-fragments

I need to create a paged GridView where each page contains some elements from a list, like launcher applications do to show the installed apps.The GridView only contains the elements that have enough space on the screen to be shown and the remaining apps are added in the GridView of the next Fragment.
I've found many examples that explain how to implement this, for example http://shrikantsonarblogs.blogspot.com/2013/07/gridview-with-viewpager-like-android.html or Display images in grid view of View pager, but in all of these examples the number of rows and columns are fixed values.
Is there a way to make these values "dynamic" by dividing the dimensions of the ViewPager by the dimensions of a child View (supposed they are all the same size, but I have to measure the first one)?
If what I want to achieve is not clear, an example can be the app drawer of the CyanogenMod Trebuchet launcher, with the only difference that I don't need it to display installed apps.

Related

Create dynamic table using TableView in xamarin forms

I am new in Xamarin forms and I need to implement a table in Xamarin forms. Requirement is-
Initially table will be empty and has four columns. After feeling form and clicking on submit button, new entry will be added in table. First column is Test, second column is single radio button, third column is again single radio button and forth column is button to delete that row it self.
I need to know which approach will be suitable to implement this requirement. Is it grid layout or tableview or something else.
Consider Table View use cases vs List View use cases. Table views are meant for static content. You should really consider a list view for dynamic content. (like adding a row with views) Being new to Xamarin.Forms, you should take the time to read completely through the documentation as (at least for me) it wasn't straightforward. Also, consider a WebView as radio buttons are not going to play nicely across platforms, and your problem would be easily solvable with jQuery.

Edit static grouped table view with multiple sections in Xcode Storyboard

In XCode storyboard, it is possible to Edit the cells in table view if it's static. Is it possible to enter multiple section of data (that is in group view multiple groups) right under Storyboard, or do I need to use the data source delegate instead?
I'm not sure if I quite understand the question, but if you're asking if you can do everything in Interface Builder, the answer is yes. After you've set the table content to 'static cells' in the Attribute Inspector, set the number of sections to the number of data sections you want, then modify each section by selecting the section, changing the header, footer, and number of rows. You can also quickly edit the header by double-clicking on it.
Each row in the section can be modified in the same way.

How can I create a draganddrop wrapper inside a table row, that can represent the whole row

When I use treetable in Vaadin, it is working fine drag and drop the whole row when click the left and right blank ereas. but that is not user friendly, I wanna create a draggable layout inside the row, let's say the 1st component of the each row, that when clicking it, the whole row is selected and can be draged and dropped to reorder.
The thing is I can create a vertical layout with wrapper doing that, but drag mode is only for its component or the wrapper itself, and when doing the drag action, it doesn't actually showing the whole row is moving, which may confuse the clients. What can I do to make it looking like I am dragging the whole row, similar with the one you drag the blank area of each row? Thanks.
I'm afraid there currently is no way for adding a wrapper that would extend the entire row instead of just one cell. To do this you'd need to extend the client-side implementation of Table (VScrollTable) and this is not something I would recommend as it is quite complex.
I do think that what you describe should be possible in core Vaadin (without using drag & drop wrappers), so could you please file a ticket at dev.vaadin.com? And please attach a small application showing the problem to make it easier for us to see the problem and fix it.
Anyways, in order for you to get it working today I'd suggest that you change your UI design a bit and for example borrow drag handles from iOS. By this I mean that you could add an icon that suggests "draggable" as a background-image in the first cell (or in the row header cell of each row) that encourages the user to grab the row there, where it is "empty" and dragging works. This way the user might not be too confused if dragging only works reliably in some parts of the rows.

how to divide QGridLayout into rows and columns at Design Time in QT?

how to divide QGridLayout into rows and columns at Design Time in QT ?
I want to design one form where i want to have 2 columns and 7 rows .
I am designing using QTCreator but i am not getting any option of giving rows/columns.
It shows only these properties
See Using Layouts in Qt Designer. For you the most important paragraph is this:
The simplest way to manage objects is
to apply a layout to a group of
existing objects. This is achieved by
selecting the objects that you need to
manage and applying one of the
standard layouts using the main
toolbar, the Form menu, or the form's
context menu.
place your widgets on the form
arrange them into 2 columns and 7 rows
select all of them
right click on the selected widgets
select Lay Out in a Grid on the context menu.
You can often drag a new UI element to a position between two existing columns to create a new column - the GUI indicates that it's ready to create a new column by showing a blue vertical line to the user (same thing for creation of a new row with a horizontal blue line).
If instead it is showing a red line or outline, that's indicating that it will fit the element currently being dragged into the existing row/column grid at the indicated position, without creating a new row or column.
It can sometimes be quite difficult to get the GUI to play nice - I've have a number of occasions where I can follow this process to create a new column - but not if I try to place the UI element on the row I actually want it on - so instead I end up dropping it on another row to create the column, dropping another of the same UI element where I actually want it, and deleting the first (superfluous) UI element.
Alternatively, it can quite often be easier to simply right click the element with the layout set, select "break layout" from the layout menu, move things about manually and then go back and select "layout in grid" (or whichever other option) from that layout menu - hoping that it will correctly guess where you want things to go in terms of rows and columns. It's usually pretty good at that.
But yes, it probably would be nice to be able to force create a new column/row in a grid layout (perhaps with some default UI element - a label, maybe - inserted as a placeholder to keep the new row/column open) at a predefined position within the grid for those times when the GUI just does not want to play nice.
QLayout structure is created dynamically as you add widgets to it, there's no way to predefine how many rows/cols a layout have.
Maybe you are using the wrong approach to achieve your goal.

Make a custom component or extend the List component for a 2D top down view MAP in flex 4?

Hy!
I'm building a top view 2D map, that it's objects are stored on the server.
The kind of objects are 10 and might be a photo, label, button, lists, mix of them or labels with tooltips.
The component must request the "areas" that are missing on screen.
An area is 1000x1000 px and is cached in flex.
To move in the map, will be like in google maps (drag-and-drop)
I should be able to have another list and move objects from one to another using drag-an-drop on objects. Ex.: I grab an objects from a list and I move it on this map, I release the mouse button and the item is placed there.
Now the problem is: I build a custom component for this trying to emulate the item renderer for performance and recyclage, implement drag-and-drop on objects and request the areas that are missing?
or
I extend the List component from spark and I add some features as multiple kind of itemrenderers and use recycle on them. Of course it must be able to request the missing areas on the screen and cache it's data.
Maybe create a custom layout is needed too.
What I need is something that must be really fluid, so the lighter this component is, the better!
Thanks for your help! (:
UPDATE:
*There will be not any object over another.
*I will not use hitTest on bitmaps because all bitmaps are wrapped in another component,as they,for now are itemrenderers.
Anyway I already begin to do this using a class that extends the SkinnableDataContainer and a custom layout. As the layout is not like a grid, is sparse, random items at diferent points(x, y).
Now I have this problem: https://stackoverflow.com/questions/4192934/how-to-get-the-localx-and-localy-relative-to-item-renderer-and-not-to-the-spark
Maybe you could use a combination of some of the following:
A canvas background (for layered components), looks fluid if using hitTest. Split up the canvas using constraintColumn/constraintRow for a grid layout.
Use hitTest (on items bitmapdata) for collision detection, and move the items to a new position (if items are dropped on top of one another).
Use a combo of mouseDown, mouseMove, mouseUP (example here) for drag n drop.
Use a 2D/3D indexed array to track the position of items (example here)

Resources