I am pretty new to android and I have a good iphone background. I need to know whether it is possible to have a expandablelistview inside a listview ?. If yes please let me know how to do that.
I need to know whether it is possible to have a expandablelistview inside a listview ?
No, sorry. You cannot generally put scrollable things inside of other scrollable things, at least when they scroll in the same direction, as they fight over the touch events.
There is an expandable listview demo in sdk for each version of android. It should be in a location like
E:\Program Files\Android\android-sdk-windows\samples\android-8\ApiDemos
Create a project from existing source in eclipse and you can check its source to understand how it works.
Related
I am trying to implement a screen in Appcelerator, where there are tabs in one view and the other view contains a listview with list sections. On the click of every tab, the respective section and section heading should scroll up. Say, I click on the third widget, the third list section and its section heading should scroll up. I have used the scrollToItem property for this. It works fine on iOS, but doesn't align properly when executing on the android devices. Any suggestions?
It's a bug in Android 4.x, this method would not scroll to correct position when you are running the app on Android 4.x. You can have a look at the Appcelerator docs : http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-method-scrollToItem
So if it is an appcelerator bug then, thumbs down we will need to look for some other options or work around to solve the problem (Maybe a Widget or Module if you want to go specifically with the listView).
Or else, you could use the TableView, as it also has a method scrollToIndex, only thing you cannot add animation in android in this.
Good Luck & Cheers
Hi everyone. I want to make a view like above. On the same screen , I have got two different layout (or it can be fragments, doesn't matter for now.). User can swipe both layout on long touch and drag/drop like above. Do you know how can we do it or is there any library for this?
Thanks
Please check DragLinearLayout libray.
Hope for help. :)
You can use Drag sort library
but i think this assumes that you use a listview.
I want to develop a layout with a very simple ImageView and a Listview binded in a Relativelayout . Now for a better user experience I want to delete the Image view by swiping it left or right same like what is implemented in android Gmail app to delete emails.
Implementing it on a listview item is very simple and there are many tuts and sample codes are available over the internet including the official Google I/O talk on animation and explained in a very good way by Chet Hasse here
https://www.youtube.com/watch?v=YCHNAi9kJI4
but I don't require to implement it on the listview items insted I want to implement it in more generic way. In my case I want the same behaviour for my ImageView item as one view and ListView another . Like shown below
As soon as the ImageView item is deleted the whole ListView should smoothly come on the top.
I have tried many way to implement the same without any success.
Suggest me the approach or some samples to do this which is supported in Gingerbread and above android OS.
You can use this code:
https://github.com/romannurik/Android-SwipeToDismiss/blob/master/src/com/example/android/swipedismiss/SwipeDismissTouchListener.java
As described in readme this code works for android 14+.
You can use the NineOldAndroids library to support old versions of Android, or use the Jake Wharton's port:
https://github.com/JakeWharton/SwipeToDismissNOA
I looked around and found this helpful.
https://github.com/nhaarman/ListViewAnimations
I implemented a custom ViewGroup that takes one child and allows you to drag/fling it to the left with a callback once the swipe is complete. My intention was for it to work just like in a RecyclerView. Works well in a LinearLayout with animateLayoutChanges=true and setting the visibility to GONE in the callback.
Gist here: https://gist.github.com/darnmason/38a1a5178a06470202784050f4dc1cdf
All you need is this library: https://github.com/timroes/EnhancedListView
Does anybody know how the article layout in the Google Currents Android app is built? I'd like to use some very similar layout for my app.
Example:
The first thing which came to my mind was to build up an the layout with a WebView with multicolumn stlye (http://www.w3.org/TR/css3-multicol/). Am I on the right way or is my suspicion completely wrong.
How do I get the page flip through the swipe/fling gesture and how to get the corresponding page indicator at the bottom?
Thanks in advance! :-)
You must use native views android and not webView because it is not efficient. But if you begun on Android you can actually use a webView is a good learning.
However, if you're interreses the layout android http://developer.android.com/ the website is a very good teaching technique. And what is the view of pourfaire text scroll from right to left, I encourage you to use the library ViewPagerIndicator.
I hope I have helped you!
I have a GridLayout with some items in it. Nothing special on it.
I just would like to know if I can drag items around and make the other items automatically arrange themselves.
It's like Android does in Jellybean if you move an icon near another icon.
Is that possible in GridLayout?
Thank you!
I don't know if that is possible with a GridLayout, doubt it, but here is a example that looks like a GridLayout and implements Drag and Drop. This should solve your issue.
I feel like there are many projects which could solve this slightly better than the other answer:
See the following question
Within this, the following projects are mentioned:
PagedDragDropGrid
Alternative View Drag and Drop
Google Project and some other 3rd party stuff
This may help you find some stuff other than GridViews as well.