- final DictionaryInfo downloadable = application.getDownloadable(dictionaryInfo.uncompressedFilename);
- if ((!application.isDictionaryOnDevice(dictionaryInfo.uncompressedFilename) || updateAvailable) && downloadable != null) {
- final Button downloadButton = new Button(parent.getContext());
- downloadButton.setText(getString(updateAvailable ? R.string.updateButton : R.string.downloadButton, downloadable.zipBytes / 1024.0 / 1024.0));
- final Intent intent = getDownloadIntent(downloadable);
- downloadButton.setOnClickListener(new IntentLauncher(parent.getContext(), intent));
- WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
- layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
- layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
- downloadButton.setLayoutParams(layoutParams);
- row.addView(downloadButton);
+ final DictionaryInfo downloadable = application.getDownloadable(dictionaryInfo.uncompressedFilename);
+ if (updateAvailable) {
+ downloadButton.setCompoundDrawablesWithIntrinsicBounds(
+ android.R.drawable.ic_menu_add,
+ 0, 0, 0);
+ downloadButton.setText(getString(R.string.downloadButton, downloadable.zipBytes / 1024.0 / 1024.0));
+ } else if (!application.isDictionaryOnDevice(dictionaryInfo.uncompressedFilename)) {
+ downloadButton.setCompoundDrawablesWithIntrinsicBounds(
+ android.R.drawable.ic_menu_add,
+ 0, 0, 0);
+ downloadButton.setText(getString(R.string.downloadButton, downloadable.zipBytes / 1024.0 / 1024.0));