+
+ public View setupButton(Button textButton, ImageButton imageButton,
+ final DictionaryInfo dictionaryInfo,
+ final IndexInfo indexInfo, int size) {
+ LanguageResources languageResources = isoCodeToResources.get(indexInfo.shortName);
+ View result;
+
+ if (languageResources == null || languageResources.flagId <= 0) {
+ textButton.setText(indexInfo.shortName);
+ textButton.setVisibility(View.VISIBLE);
+ imageButton.setVisibility(View.GONE);
+ result = textButton;
+ } else {
+ imageButton.setImageResource(languageResources.flagId);
+ imageButton.setScaleType(ImageView.ScaleType.FIT_CENTER);
+ textButton.setVisibility(View.GONE);
+ imageButton.setVisibility(View.VISIBLE);
+ result = imageButton;
+ }
+ // Assume dimensions have been set before in Layout
+ return result;
+ }