Skip to content

Instantly share code, notes, and snippets.

@OyaCanli
Created June 21, 2019 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OyaCanli/d6bb57258b85b6fdfe3dc255dd0e2e38 to your computer and use it in GitHub Desktop.
Save OyaCanli/d6bb57258b85b6fdfe3dc255dd0e2e38 to your computer and use it in GitHub Desktop.
@InverseMethod("buttonIdToProcurementType")
public static int procurementTypeToButtonId(ProcurementType procurementType ){
int selectedButtonId = -1;
if(procurementType == null){
return selectedButtonId;
}
switch (procurementType){
case BOUGHT: {
selectedButtonId = R.id.radioBtn_bought;
break;
}
case RECEIVED: {
selectedButtonId = R.id.radioBtn_received;
break;
}
}
return selectedButtonId;
}
public static ProcurementType buttonIdToProcurementType(int selectedButtonId){
ProcurementType procurementType = null;
switch (selectedButtonId){
case R.id.radioBtn_bought: {
procurementType = ProcurementType.BOUGHT;
break;
}
case R.id.radioBtn_received: {
procurementType = ProcurementType.RECEIVED;
}
}
return procurementType;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment