Custom PopupMenu (layout)

A PopupMenu is meant for displaying Menus and there really isn’t a good way of customizing the appearance of the menu items. If you want something more flexible, your answer is ListPopupWindow. private static final String TITLE = “title”; private static final String ICON = “icon”; private List<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>(); // … Read more

Spinner’s scrollbar style

After hours of work, I got the right solution (Thanks Khaled for guiding me to the right direction). You need a custom spinner: import java.lang.reflect.Field; import java.lang.reflect.Method; import org.holoeverywhere.widget.ListPopupWindow; import org.holoeverywhere.widget.ListView; import org.holoeverywhere.widget.Spinner; import android.content.Context; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; public class CustomSpinner extends Spinner { public CustomSpinner(Context context) { super(context); } public CustomSpinner(Context … Read more

Populate list of custom view using ListFragment

I solved my problem (as system32 suggests on comment) creating a CustomArrayAdapter class, and setting it as the adapter for my listView. First I changed android:id=”@+id/listView1″ to android:id=”@android:id/list” in fragment.xml. CustomArrayAdapter.java public class CustomArrayAdapter extends ArrayAdapter<Menu> { Context context; public CustomArrayAdapter(Context context, int textViewResourceId, List<Menu> objects) { super(context, textViewResourceId, objects); // TODO Auto-generated constructor stub … Read more

No resource identifier found for attribute ‘…’ in package ‘com.app….’

I just changed: xmlns:app=”http://schemas.android.com/apk/res-auto” to: xmlns:app=”http://schemas.android.com/apk/lib/com.app.chasebank” and it stopped generating the errors, com.app.chasebank is the name of the package. It should work according to this Stack Overflow : No resource identifier found for attribute ‘adSize’ in package ‘com.google.example’ main.xml

How to make custom dialog with rounded corners in android

Create an XML file in drawable, say dialog_bg.xml: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <solid android:color=”@color/white”/> <corners android:radius=”30dp” /> <padding android:left=”10dp” android:top=”10dp” android:right=”10dp” android:bottom=”10dp” /> </shape> set it as the background in your layout XML: android:background=”@drawable/dialog_bg” Set the background of the dialog’s root view to transparent, because Android puts your dialog layout within a root view … Read more