Fix travel card vector icon for api 16

This commit is contained in:
Dima-1 2020-05-27 17:11:37 +03:00
parent 077d5fcf6c
commit 1bbf578e4a
3 changed files with 11 additions and 6 deletions

View file

@ -10,5 +10,8 @@
</item>
<item
android:drawable="@drawable/ic_action_import"
android:gravity="center"/>
android:top="4dp"
android:bottom="4dp"
android:left="4dp"
android:right="4dp" />
</layer-list>

View file

@ -10,5 +10,8 @@
</item>
<item
android:drawable="@drawable/ic_action_reset_to_default_dark"
android:gravity="center"/>
android:top="4dp"
android:bottom="4dp"
android:left="4dp"
android:right="4dp" />
</layer-list>

View file

@ -68,7 +68,7 @@ public class TravelDownloadUpdateCard extends BaseTravelCard {
DownloadUpdateVH holder = (DownloadUpdateVH) viewHolder;
this.ref = new WeakReference<TravelDownloadUpdateCard.DownloadUpdateVH>(holder);
holder.title.setText(getTitle(loading));
holder.icon.setImageDrawable(getIcon());
holder.icon.setImageResource(getIcon());
holder.description.setText(getDescription());
if (indexItem == null) {
holder.fileDataContainer.setVisibility(View.GONE);
@ -117,9 +117,8 @@ public class TravelDownloadUpdateCard extends BaseTravelCard {
return app.getString(download ? R.string.download_file : R.string.update_is_available);
}
private Drawable getIcon() {
int id = download ? R.drawable.travel_card_download_icon : R.drawable.travel_card_update_icon;
return AppCompatResources.getDrawable(app, id);
private int getIcon() {
return download ? R.drawable.travel_card_download_icon : R.drawable.travel_card_update_icon;
}
@NonNull