I've currently managed to disable my spinner if a specific item is selected, however I also want to set that specific item to a disabled state visually. Is this possible?
EDIT: To clarify, when I click on my spinner, I see a drop down menu with several items I can select. I want the disabled items to have a different visual, like in the link above.
private static final String[]paths = {"None", "Arrow Rain", "Restoration", "Ares' Fervor", "Windstorm", "Guardian Angel", "Meteor", "Disaster", "Ares' Frenzy", "Phoenix Flight", "Snowstorm"};
ArrayAdapter<String>adapter1 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item,paths) {
@Override
public boolean isEnabled(int position) {
global1 = position;
if( (global1 == global2 || global1 == global3 || global1 == global4) && global1>0 ){
return false;
}else{
g1t.setText( "Price: " + String.valueOf(g1p) +"\n" );
totalprice.setText( "Total Price: " + String.valueOf(g1p+g2p+g3p+g4p));
return true;
}
}
};
magic1 = (Spinner)findViewById(R.id.spinnermagic1);
adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
magic1.setAdapter(adapter1);
magic1.setOnItemSelectedListener(this);
//global 2, 3, and 4 are also positions.
//Is there a way to set those to disabled states?