Tag: android-widget

Android: a vertical gallery?

I’m looking for a widget that behaves similar to the gallery widget but scrolls vertically instead of horizontally. I googled all around and apparently the answer is no such pre-made widget exists. So I said myself, oh well, I’ll look at the gallery class in the android source and modify that to scroll vertically instead. […]

Reference for good Android UI design patterns

I would like to get some links for getting started with design patterns.My requirement is , (at Initial stage) How to go about developing a particular pattern , say customized ListView which can be shared across applications . e.g. Applications will call something like drawCustomizedListView(params…) and my code will draw the listview according to the […]

autoLink for map not working

I have the following TextView in my XML layout file:- <TextView android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text=”@string/autolink_test” android:autoLink=”all” /> The string autolink_test contains a phone number, an email address, a website address and a physical geographical address. While the first three are showing up correctly as clickable autolinks, the address does not. Only the zipcode part shows up […]

Grid view item not hightlight when press

My app has a grid view, By default, Its item does not highlight when I click on it (I don’t know why? ). I try to add it a list selector as below, But it does not work too, <GridView android:id=”@android:id/list” android:layout_width=”fill_parent” android:layout_height=”match_parent” android:layout_above=”@+id/load_more_process_id” android:layout_alignParentTop=”true” android:drawSelectorOnTop=”false” android:listSelector=”@drawable/grid_selector” > </GridView> Here my selector: <selector xmlns:android=”http://schemas.android.com/apk/res/android” > […]

Difference between Plain text input type and Person Name input type in Editext in android

When we use EditText widget in Android, then what are the basic difference while using Plain Text input type and Person name input type?

How to catch widget size changes on devices where onAppWidgetOptionsChanged not getting called?

Devices like Samsung Galaxy S3 working with Android version 4.1.2 has a bug which prevents onAppWidgetOptionsChanged to be called. So, how can we get information related to changed sizes?

How I can increase the touch area for controls (ToggleButton)?

I have a ToggleButton. I want to have more place for click on this button. If I add layout_width, layout_height etc. the image looks bad. I also tried using android:padding but it did not help me. It is needed for the convenience of users.

Change Size: Android Radio Button

In my Android Application I have to use a radio button. I need to make the size of the radio button small. So I created a drawable like this <item android:state_checked=”true” android:drawable=”@drawable/btn_check_on” /> <item android:state_checked=”false” android:drawable=”@drawable/btn_check_off” /> Normal way the radio button look like this but with the small icon, it have a space in […]

How to add icons to PreferenceScreen entries

Consider this preferences.xml file: <?xml version=”1.0″ encoding=”utf-8″?> <PreferenceScreen xmlns:android=”http://schemas.android.com/apk/res/android” android:title=”@string/preference_main”> <PreferenceScreen android:title=”@string/preference_sight” android:key=”category_sight”> <ListPreference android:summary=”@string/preference_sight_wb_msg” android:title=”@string/preference_sight_wb_title” android:key=”sight_wb” android:defaultValue=”auto”/> <Preference android:key=”sight_wb_values_cache”/> <eu.elevelcbt.sm.preferences.PercentBarPreference android:title=”@string/preference_sight_mean_confidence_min_title” android:summary=”@string/preference_sight_mean_confidence_min_msg” android:key=”sight_mean_confidence_min” android:defaultValue=”80″/> <CheckBoxPreference android:key=”sight_flash” android:defaultValue=”false” android:summary=”@string/preference_sight_flash_msg” android:title=”@string/preference_sight_flash_title”/> </PreferenceScreen> </PreferenceScreen> When shown in my MainPreference class extending PreferenceActivity is correctly shows me a first level menu with one entry “Sight” (@string/preference_main) which, when […]

Coloring the Space widget

I am trying to color the Space widget. I tried using both the android:foreground and android:background attributes, but still it is displaying a transparent View. <android.support.v4.widget.Space android:layout_width=”match_parent” android:layout_height=”0dp” android:layout_weight=”1″ android:foreground=”@android:color/black” android:background=”@android:color/black” />

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.