def nop = {attr -> null}

ext.QUIRKS = [
	// This requires lots of type checks, skipping this factory method for now
	"android.widget.AutoCompleteTextView" : [
		"setAdapter": nop
	],

	// Block setAdapter(ListAdapter) and setAdapter(SpinnerAdapter), leave only parent setAdapter(Adapter) instead
	"android.widget.AbsListView" : [
		"setAdapter": nop
	],
	"android.widget.ListView" : [
		"setAdapter": nop
	],
	"android.widget.GridView" : [
		"setAdapter": nop
	],
	"android.widget.AbsSpinner" : [
		"setAdapter": nop
	],
	"android.widget.Spinner" : [
		"setAdapter": nop
	],
	"android.widget.ExpandableListView" : [
		"setAdapter:android.widget.ListAdapter": nop
	],

	// Exception must be checked in this attribute setter
	"android.widget.TextView": [
		"setText:java.lang.CharSequence": nop,
		"setTextSize": nop, // broken: uses "sp" unit by default, fixed in BaseDSL
		"setInputExtras": { attr ->
			attr.code.add(""
					+ "try {\n"
					+ "	if (v instanceof android.widget.TextView && arg instanceof Integer)\n"
					+ "		((android.widget.TextView) v).setInputExtras((int) arg);\n"
					+ "} catch (org.xmlpull.v1.XmlPullParserException e) {\n"
					+ "	e.printStackTrace();\n"
					+ "} catch (java.io.IOException e) {\n"
					+ "	e.printStackTrace();\n"
					+ "}\n")
			return attr
		}
	],

	"android.widget.Switch": [
		"__viewAlias": "SwitchView"
	],

	// This will remove the whole builder, so no factory method will be generated
	"android.renderscript.RSSurfaceView": [
		"__viewAlias": false,
		"setRenderScriptGL": nop,
	],

	// This will remove the whole builder, so no factory method will be generated
	"android.renderscript.RSTextureView": [
		"__viewAlias": false,
		"setRenderScriptGL": nop,
	],
]
