wrap NotesFragment emptyView with API check

This commit is contained in:
Chumva 2018-03-28 16:28:56 +03:00
parent f85dc396c4
commit c15584eca3

View file

@ -98,15 +98,15 @@ public class NotesFragment extends OsmAndListFragment {
view.findViewById(R.id.header_layout).setVisibility(View.GONE);
ViewStub emptyStub = (ViewStub) view.findViewById(R.id.empty_view_stub);
emptyStub.setLayoutResource(R.layout.empty_state_av_notes);
emptyView = emptyStub.inflate();
if (Build.VERSION.SDK_INT >= 18) {
emptyView = emptyStub.inflate();
int icRes = getMyApplication().getSettings().isLightContent()
? R.drawable.ic_empty_state_av_notes_day : R.drawable.ic_empty_state_av_notes_night;
((ImageView) emptyView.findViewById(R.id.empty_state_image_view)).setImageResource(icRes);
}
emptyView.setBackgroundColor(getResources().getColor(getMyApplication().getSettings()
.isLightContent() ? R.color.ctx_menu_info_view_bg_light : R.color.ctx_menu_info_view_bg_dark));
}
return view;
}