GirdView with a large first item - android

i wonder if there is a way to implement a GridView which first item is for example twize as large as the rest of the items.
I think this screenshot of an iPad App describes best what i want to achieve:

It depends on for what android versions you want to develop for:
Android versions prior 3.0 (Honeycomb) doesnt support column or row spans in GridViews,
so you have to implement your own ViewGroup (You can extend the very basic FrameLayout).
Started with Android 3.0 you can use the GridLayout class to do that.

Related

Material design listview on Android 4

Hi I'm trying to create listview on Android 4+ similar to those available in material design, something like this https://developer.android.com/design/material/videos/ContactsAnim.mp4 but with some modifications, after click on item I would like to expand this item in a pretty way scrolling to almost top of the list and making rest of items darken. What is the best way to achieve something like this on Android 4? I was trying to use ExpandableListView but it looks really awfull. Or maybe there is some library which can provide this functionality?
Yes you could use Transition API for building animations like this. Most part of this API could be used in android 4+ bu using, for example, this library

Which layout should I use (css inline-block equivalent)

I would like to build a specific layout for an android application. Actually, I would like to obtain something with the same behavior as inline-block div in html/css... I don't really know if I should use a LinearLayout or a GridLayout or something else...
It's like a horizontal LinearLayout but when the line is full, I would like my objects to go on the next line... I'm going to add the items programmatically to the container...
Here's an example of what I would like to do:
Do you have any idea?
Thanks by advance,
Valentin
Instead of using a layout, it might be easier to use a GridView because they will only use memory for items on screen and can be added using an adapter.
Read more here: http://developer.android.com/guide/topics/ui/layout/gridview.html
Android provides a GridLayout component (along with the helper view Space which can be used to build a flexible layout with multiple rows and columns, as explained in The Android Developers Blog. It is available as of Ice Cream Sandwich (v14) or as part of the v7 support library, and hence available to all 2.1+ devices.

Drag and drop in grid view

I want to drag a image view in the grid view which support in android version 2.2.
I can implement it using drag listener but for 3.0 and above, but i want to implement it in 2.2 also.
Please suggest me any example if any one have.
Yes, that can be achieved in 2.2 but not using Standard Android API. You have to use some 3rd Party to achieve it. I have accomplished Drag and Drop in GridView Task by using PagedDragDropGrid. if you required only in single page then do it by creating only one page in ExamplePagedDragDropGridAdapter. Hope this will help you.

Android Widget Scrollabe Textview

i'm developing a SMS Widget.So came to across messages-widget
When i tried to replicate, the scroll feature is not available to that widget.
when i surfed, results where http://stackoverflow.com/questions/3879748/scrollable-textview-in-android-widget
Note i'm using Android 2.2 API Level 8.
Can anyone tell me how textview is scrollable with that opensource coding.
Is it possible to make a scrollable textview in widget ?
The link you provided is not a scrollable widget. It has buttons to move to the next/previous message.
HTC (and maybe others) have scrollable widgets, but it's their own implementation.
Scrollable widgets (with ListView and GridView) are available in Android 3.0+ (API 11+).

How to create layout like android market app? Should I use tableLayout, GridView, or create custom one?

What's the best way to create android market like layout? I was thinking to use tableLayout, but then I need to handle rotation and re-layout. Or another option was to use GridView, but I cannot span more than one cell.
Can anyone point me to any good resource please? thank you
i think the best way is to implement (extend) a framelayout. With this layout you
can position each child with leftMargin/topmargin layout attributes and can keep track
of each child's position and size, even if the device gets rotated.
btw: there is no layout prior android 4.0 that have col spans/row spans - with Android 4.0
you can implement that with GridLayout.
I found this useful compatibility library for GridLayout: https://github.com/dlew/android-gridlayout and it supports Android version 1.5+

Categories

Resources