My app is a client for a freeware PC-based PVR application which allows the user to view a TV Guide and select TV shows to record and send a request to their own PC to schedule the recording (or cancel a previously scheduled recording).
One of my users has requested a feature to show all shows / all channels in a vertical list with shows divided by a 'timeslot' indicator / divider. They provided an example image as below...
My problem is I can't work out what sort of list that would be using. It seems in theory I can do this with a standard ListView and a custom adapter but I'm also wondering about ExpandableListView as those timeslot indicators / dividers could perhaps be implemented as group dividers.
I've never worked with ExpandableListView however so I'm not sure if that's how it works and it suggests all groups will need to be expanded by default.
I've done a lot of reading on both classes and looked at a variety of sample code on the Android developer web site but I still can't work out what approach to take. I'm sure I've seen a similar question on SO but can't find it to see what the answer was. Any pointers gratefully received.
I would bet for ExpandableListView; though it could be a regular ListView with two types of view, one for the separators and one for regular items.
Related
I have an an Android app that requires that i give the user options to turn on or off certain brand names within specific categories.
So for example, I need to display categories such as Fashion, Music, Film etc (about 10-15 categories in total). Then the user needs to be able to click on a category and be presented with specific brands relating to that category which they can turn on and off, using perhaps a radio button or switch, depending on if they like that brand or not.
Can anybody advise as to a good way to display this kind of layout and what controls / layout to use. I'm currently thinking of using a grid layout for the categories, then submenu items or popup menu for the brands, but i'm not sure if they is a better way to go.
Also, i may need to include the brands actual logo so i need to allow for that to be possible in whatever view control i choose.
I think a great way to show that kind of thing would be using a Card View.
Xamarin has an example on how to use it available here: http://developer.xamarin.com/samples/CardViewSample/
To use it you must add the nuget package for it to your project: https://www.nuget.org/packages/Xamarin.Android.Support.v7.CardView/
I am working on simple app, similar to Instagram, Facebook app or G+ app. I want to make board with other users posts. The posts on board will be displayed in bocks, simular to Facebook:
How should i create such blocks, that i can fill with downloaded data and add up to the board, modify them or remove them from board while user is still in board activity? Is there any class that i could use?
You should probably look at ListView.
It lets you maintain a list of objects and build views from visible ones, add more dynamically etc.
As for the actual block.. Depends on how you want to display them. I hope you know about View types such as LinearLayout etc, if not you should probably read some basic guide for android programming before you begin.
I have an app where I programmatically add several views to a linear layout. I would like to allow the user to reorder these views but I am having a hard time figuring out how to do that. I would like to emulate the functionality that google keep uses to reorder items in its checklists. If someone could please point me at a working example that would be awesome.
Thanks,
Nathan
I am new to Android development. I am working on application where Sql-lite is also involved, its a database application. The application is used on Android Tablets
In of the screen we have a lot of "related information", nearly 100 different controls (Text Data, DateTime Data, Selection list) are used to load that data, the user enters the data & can perform the CRUD operations on it. Currently i am using the ScrollView Layout as the main container for that screen.
The application is running smoothly no performance issue but the users saying we are tired of scrolling up & down all the time.
1- I need your suggestions how to resolve this issue?
2- Should i divide the information into more than one screen & what is the best solution? (For example each screen can have Forward Backward Arrows etc.)
Thanks for your valuable time & help.
How about using a PreferenceActivity? It gives a really nice, clean way of organising lots of options or data and you can define sub PreferenceScreens in the XML layout which are perfect for grouping large chuncks of options/data, or a couple of smaller groups, together. This way you can easily hide away bits that you don't need.
Using hierarchyviewer on the Gmail conversation view shows an interesting and unusual layout hierarchy:
All messages in a single conversation are rendered in a single WebView (specifically a com.google.android.gm.CustomWebView, seen on the left). Only the body of the messages is rendered - the spaces where the headers would go are left blank.
On top of the WebView is overlaid a com.google.android.gm.MessageHeaderScrollView (seen on the right) which uses a HybridConversationScrollContainer to position a MessageHeaderView in the correct position for each message in the conversation view.
<->
So, how (and why) is this achieved? Is it something that an Android developer could & should aspire to re-create in their own apps?
Obviously the probable why is performance - WebView uses the fast native WebKit rendering of the message text, and a single WebView is probably more efficient than a separate WebView for each message. If anyone has seen any good blogposts on the performance benefits of this I'd be interested.
Yet there's an obvious complexity cost to this approach (against naively using an ExpandableListView with some TextViews inside it or whatever) - the HybridConversationScrollContainer has to somehow work out where the message headers should go over the web-rendering, in order to position it's MessageHeaderViews correctly. What I'd like to know is: How does it work out those offsets?
Incidentally, the only approach I can think of is javascript-based - use javascript in the WebView to gather the header coordinates, and then use WebView.addJavascriptInterface() to pass those coordinates on to Java and the HybridConversationScrollContainer. I haven't tried doing this myself though so I'm not sure if it could actually work.
There is a short post on the android Developer blog talking about the addJavascriptInterface() method:
http://android-developers.blogspot.com/2008/09/using-webviews.html
It would be wonderful if MessageHeaderScrollView could be released as an open-source library - I'd use it! - but seeing as the Gmail app is closed, it doesn't seem immediately likely.