Please have a look at this screenshot from Google Maps for Android. What layout is Google using for this particular screen?
Using multiple ListView controls here would be an overkill in terms of performance (or so I think). Also, because one can scroll on this screen, I don't think Google is using ListView controls here as ListView controls don't work along with ScrollView controls. Is Google using multiple instances of the all new CardView control on top of a ScrollView control here?
Can someone help with the best possible layout (from a performance perspective) for rendering this particular screen? I need to make sure my app supports lower end Android handsets so rendering performance is the number one priority but nothing like achieving it with clean, simple & reusable code + layouts (if possible in this scenario).
Thanks in advance!
Related
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 trying to create the UI but I'm having a lot of difficulty just placing controls where I want them to appear on the main screen. For example I want to add a few ImageButtons but they just seem to snap to one corner and I can't seem to add more than one.
Do I need to use a layout or something? Can't I just drag and drop and move the controls around where I want?
I suggest you start by reading a few of the developer tools out there. http://developer.android.com/guide/topics/ui/declaring-layout.html This guide will help you get your feet wet with how to properly layout a screen in Android. There are also a bunch of other great guides on there to help with other aspects of the UI. Even though you use C# in Xamarin Studio, the UI portion is native Android so the guides should still be relevant.
try to use relative layout , its kind of easy for visual studio developer and others too.
details here : http://developer.android.com/guide/topics/ui/layout/relative.html
I am developing a multiplayer android game and I am trying to add a chat UI for players to talk to eachother.
I don't want this chat UI always visible because of space issues, I'd like there to be a tab that you can press or slide that will bring the chat menu up. I have a sketch so you can see what I mean...
How can I go about implementing this in android.
I know I am going to need to use EditText and TextView etc but How can I get the sliding thing to work.
EDIT: I'm not looking for a flat out answer. I just need guidance. What widgets, methods etc should I be studying
There used to be a SlidingDrawer in the Android SDK. It is officially deprecated and, to be honest, was never that good.
There is nothing in the Android SDK that directly replaces the old SlidingDrawer. The leading third-party implementation seems to be AndroidSlidingUpPanel, though there are probably others floating around.
I should begin by saying that I'm brand new to android development, although I have a good understanding of the fundamentals of java. That being said, I usually learn best by doing, so I'm writing an app for a campus magazine I work for and trying to learn through the process of making it.
At the top of the screen is a bar with two spinners labeled "issues" and "sections," which allow the user to filter the articles shown to only those in the respective issue / section. The rest of the screen is taken up by what I will describe as a vertically-oriented gallery, which shows the headline for each story underneath an image associated with it. The user can then "flip" through the stories in the magazine by scrolling through the "gallery." Selecting one of the stories will open the full story up in ViewPager.
I have two main questions at this point:
1) Initially, I planned to place the "issues" and "sections" spinners in the ActionBar. However, as I understand it, ActionBars are not displayed to users using Android 2.x. Given that these elements are critical to navigating the app, and that a majority of android users are still using 2.x, this seems unacceptable. As a result, I'm using an ActionBar-less theme and essentially drawing my own action bar via a linear layout on top of my main activity. Am I correct in my understanding that ActionBars do not display on Android 2.x devices? If so, am I correct in including my "tool bar" as a part of the main activity, or is there a better way to implement it? (Perhaps as a fragment? I don't really understand how those fit in yet...).
2) I am aware that the gallery widget is deprecated, so obviously I'm not going to use it. What alternative widgets would best achieve the same visual goal of having the user "flip" through the stories in the magazine by scrolling through the widget? Is there a way to animate a ListView to achieve this goal?
Again, any help - particularly which helps me to understand the wider issues involved here - will be greatly appreciated.
Thanks in advance.
You can use ActionBarSherlock - it is compatible down to Android v 1.6.
ViewPager might help you
Could someone please explain how Google implemented the "detail" page of their Google + app? The detail page features an image at the top (which can be tapped) and a ListView that is positioned roughly 50% down the screen.
Like so:
Example
When you swipe up the ListView moves up to fill the entire screen:
Example
After this, additional swipes control the listView up/down:
Example
I've done my research but very little is available to suggest how they implemented this.
Thanks
The short answer is that they're using various tricks for enabling the sliding menus. Tons of resources have been authored by folks in the Android community, most notably:
The video on the subject here:
https://plus.google.com/115177579026138386092/posts/FjnASs9no1a
The sample that was authored to accompany the video:
https://github.com/jfeinstein10/SlidingMenu
And finally, a demo app that exists in the play store.
The easiest way to get the demo is to search for SlidingMenu Demos in the Play store. The specific controls of interest in the Demo are the "ViewPager" example and the "Slide" example.
When you look at the library, you'll notice that it pretty much rewrites significant pieces of the existing controls from View on up as well as custom transformations for a canvas element used in the view.
The sample that Jeremy authored, which really is an alternative library to existing ListView and Page controls, supports a large spectrum of Android devices as well as a number of UI controls that are slightly different variations of the examples you gave and that use varying transitions.