android-ui

How to show header of ListView when its empty

一世执手 提交于 2019-11-28 11:33:57
I am developing the following screen The fourboxes next to each other are buttons. On clicking of the buttons I am changing the adapter of the listview. Since the content above the listview took up lot of space I made the whole thing as an header and added it via code. myPollsList = (ListView) findViewById(R.id.listArea); myPollsList.addHeaderView(getLayoutInflater().inflate(R.layout.profile_listview_header, null)); Now I want to show some view when the list is empty. But if I do that then the header also goes away. I am using this in a Activity and not a ListActivity. Any suggestions or

Theme dependent colors of selected widgets

时光毁灭记忆、已成空白 提交于 2019-11-28 04:34:27
I'm pretty sure that this question already has been answered somewhere. It just seems too common. But I can't find the answer. I can't also figure out the solution. Here's the problem: I want one of my TableRow's to have different background color. It's simple, I just need to add android:background="#123456" In TableRow's XML Declaration. But, I also want my application to have two themes. In the other theme, the TableRow should have different background color. I just can't find a way to define a color value inside a theme and use it. I would like to type something like this: <style name=

How to add scroll bar to the Relative Layout?

心不动则不痛 提交于 2019-11-28 04:29:56
I am new to the Android app development. Now I am designing an app, in that I have an Activity which is containing some content but these content is some what more so the content is out of the screen. Now I wanna show that content to the user, but I don't know how to keep scrollers to the Activity . How to show the total content to the end user with the scroller using RelativeLayout ? VenkaReddy hi see the following sample code of xml file. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ScrollView01" android:layout_width="fill_parent" android:layout

Build Play Music-like interface

元气小坏坏 提交于 2019-11-28 03:51:19
I'm trying to build and interface that would mimic the recent Google Play Music interface which as a reminder looks like this on a phone I've already got the DrawerLayout and the Tabs right, but I have no idea how to build the amazing bottom fragment that displays the currently playing song. It mixes two features: If you swipe this fragment to the left, it will be replaced by the next song. i think it can be done fairly quickly using a ViewPager and a new Fragment for each song, but is it an efficient way to do it? If you swipe it up, it will open kind of a drawer containing the player itself

Change ActionBar Tabs background color

余生颓废 提交于 2019-11-28 03:13:50
问题 Is there a way to change the background color of the tab bar in the ActionBar without changing it in the one line version? To clarify what I want: In portrait mode the ActionBar is split in two lines, the ActionBar itself and the tabs below. In landscape mode the tabs are in the actual ActionBar. I want to change the background color of the portrait mode. If I change the background in the TabView it'll be changed for both modes. Do I have to create separate styles for those? Which brings up a

java.lang.IllegalStateException: ScrollView can host only one direct child [duplicate]

懵懂的女人 提交于 2019-11-28 02:41:08
问题 This question already has an answer here: How can I avoid “IllegalStateException: Scrollview can host only one direct child”? 7 answers I'm simply trying to add the ability to scroll through this layout by adding a scrollview however every time I attempt to load the layout I'm getting an error stating "java.lang.IllegalStateException: ScrollView can host only one direct child" and I'm unsure why. Any suggestions are much appreciated. SOURCE: <?xml version="1.0" encoding="UTF-8"?>

setShadowLayer causes slow draw time in GridView?

☆樱花仙子☆ 提交于 2019-11-28 01:02:08
问题 I'm currently working with a GridView containing ImageViews and would like shadows behind my images. There are potentially, say, 15 images visible in the grid at any time. Working under the assumption that I want my screen to render at 50fps to appear smooth, my math shows that I want the total draw time of each ImageView to be no worse than around 1.3ms. I took a look at how Romain Guy was doing shadows in his Shelves app: http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org

Android - Customizing the Spinner widget Look and Feel

余生颓废 提交于 2019-11-27 20:52:54
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, and how? I know this is an old question now, but here goes... You will need to create a custom Theme and apply it to the Activity with your spinner. First, you need to create images for the checked/unchecked states of the 'new' radio, you could just pull the given images btn_radio_on.png and btn_radio_off.png from the sdk's res/drawable-* folder(s). Edit them to look how you want (such as

How to change border color of radio button in android? [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-11-27 18:49:38
问题 This question already has an answer here: Change Circle color of radio button 18 answers How to change border color of radio button in android? I want to change circle color of android radio button. Thanks in advance. Any help is greatly appreciated. I have try different soluation and concern if any property is there other that drawable image 回答1: The easiest way to customize(change color) your views. Goto : http://android-holo-colors.com/ Select the color you want for Radio Button Download

[Android - Kitkat ]Get/pick an image from Android's built-in Gallery app programmatically

假如想象 提交于 2019-11-27 18:17:48
问题 Try to pick only one particular image from the SD card.I am able to pick images from gallery and Photos app in kikat.But not getting file path when i pick image from recents am getting file path as null. I tried https://stackoverflow.com/a/2636538/1140321. 回答1: This works for Kitkat public class BrowsePictureActivity extends Activity{ private static final int SELECT_PICTURE = 1; private String selectedImagePath; private ImageView imageView; public void onCreate(Bundle savedInstanceState) {