android-ui

How to gradient fill a button's background?

I have to create a colored button with gradient fill(starting from the middle of the button along Y axis). If I set the background property of the button to the color I want, I lose the rounded look and feel of a button and also the gradient fill(It looks like a TextView with a background). Also, I want this color to change when the use...

Recommendations for Android programming resources.

Hey Everyone, I am working on getting familiar with the Android SDK and I have having a hard time getting the UI side of things figured out. I am trying to create a menu, kind of like how apps are listed in the market place or how the contact list works. Where I would have basically a list view and treat each item in the list as a butto...

Android View.onDraw() always has a clean Canvas

I am trying to draw an animation. To do so I have extended View and overridden the onDraw() method. What I would expect is that each time onDraw() is called the canvas would be in the state that I left it in and I could choose to clear it or just draw over parts of it (This is how it worked when I used a SurfaceView) but each time the ...

Is it possible to set font for entire Application?

Hi, I need to use certain font for my entire application. I have .ttf file for the same. Is it possible to set this as default font, at application start up and then use it elsewhere in the application? When set, how do i use it in my layout XMLs? Sample code, tutorial that can help me here is appreciated. Thanks. ...

Adding an overlay to Google maps with path taken

Hi, I am trying to write a class to track a person's location(s), and to draw the path they've taken on a MapView. This feature of the program is for the user to track their speed, distance, path, etc. while running/cycling (or whatever else) using their Android phone. This is my first Android application, and I am not sure how to do th...

remove notification bar shadow in android app

In android, the notification bar at the top has a shadow most of the time. However, sometimes, such as when an app has it's title-bar showing, or in some other cases (such as in the twitter app or the market) that shadow effect is gone. My guess is that the shadow is supposed to be there when the content underneath can scroll. In my app...

Android Quick Actions UI Pattern

I'm interesting in incorporating the Android UI pattern called "Quick Action". Basically, it's a context menu that doesn't cover up the data that is being acted on. I'd like to implement this but I cannot find an API to help me out or some sample code. Note this UI pattern is discussed in the YouTube video, http://www.youtube.com/watch?...

Displaying a list with different types of information in Android

I want to create a page with X questions (the questions are stored in a database and I read them), headline and buttons at the end. When the user clicks on one question than the question should transform into a dialog where the user can modify the question, however the other questions above and beneath it should still display the same w...

How does android display a list with 200 elements?

When I have a ListActivity and an Adapter how does Android handle a list with 200 elements. Does it try to load all of them directly how does it wait till the user scrolls and then renders those elements? Do I have to worry with performance when a list is too long? ...

How do I change the textColorPrimary in a theme?

I'm changing the theme of an activity in onCreate using setTheme (I'm doing that even before calling super.onCreate(), as this is supposed to be more reliable). It does work in the sense that it changes the background and foreground colors. However, my layout has a few elements that use styles like textAppearanceLarge. Now Android's tex...

Android - Customizing the Spinner widget Look and Feel

Hi, Is it possible to change the color of the radio button in the android spinner widget. By default it displays the green color for the radio button I need to change it to some other color, Is it possible Suggestions and guidance are welcome. Thanks Vinayak ...

Android centering text in lists

Say I have a list of Strings with the elements: "One", "Two", "Three", "Four" I want to center them in the middle of the screen but I want to do it in a way that the start of each word is next to each other. Like this: One Two ...

Catching the android back hardware key event

for some reason, I'm not catching the OnKeyDown of the hardware back button ONLY when a keyboard is on the screen. I catch the OnKeyUp in my SurfaceView class, but by then the screen has already attempted to resize. I need to catch the OnKeyDown so I can notify some native code that the keyboard is being minimized before I get the sizec...

Android Landscape orientation Problem

I have designed two different layouts for landscape and portrait as by this example http://www.devx.com/wireless/Article/40792/1954 i tried applying android:configChanges="keyboardHidden|orientation" for the activity in the manifest. here is the question... when i changed the orientation, the activity does not reset instead it does no...

Automatic Checkbox list with 5 sec. delay in android

I want to show automatic checklist in android. For example I can have 4 list of item with unchecked check box adjutant to that. After 5 sec. delay I want to check the first item then move on to second. At the end of 20 sec. I should have all 4 check box checked one by one. Any idea how should I go on doing this ? I can use list view ...

How to add UI components on specific coordinates

I have to create a UI with components(TextView, Bottons etc) placed at particular coordinates as specified in an XML coming from a server. I am currently using AbsoluteLayout but since its deprecated i want to use some other method. ...

android UI external libraries ?

Hello guys, I'm starting with android, and the app I'm developing is gonna need custom widgets look (glossy buttons, animated backgrounds etc.), I've googled for any external libraries to achieve this and did not find anything. let me guess, the only way to this is by painly extending base view classes and overriding onDraw etc. ? ...

Reusable component: toolbar like in astro app for Android

I really like the toolbar in Astro app for Android and I was wondering: Do you know if it is reusable component, is it open source, if yes - where to find it; if not - can you provide a link to similar open source component. ...

Unable to Add a subview to a LinearLayout with "Wrap_Content"

I'm using data to build elements of a ViewGroup. The ViewGroup are LinearLayouts, except the leaves, which are TextViews. Because Data draws the hierarchy, I inflate the LinearLayouts and TextViews from individual XML files programatically on the fly. My Problem: When I create a LinearLayout with the attribute wrap_content, then infla...

How to detect HTC Sense?

Can I somehow detect if my app is running on HTC Sense? More generally, the problem is, that I have a Button with custom drawable. It's something very similar to the account switcher in the top right of Gmail app. When pressed or focused, the button has orange highlight. But that doesn't look nice on HTC Sense - because the standard hig...