From c15584eca33b6ef5fae433baa2581f8191375b41 Mon Sep 17 00:00:00 2001 From: Chumva Date: Wed, 28 Mar 2018 16:28:56 +0300 Subject: [PATCH] wrap NotesFragment emptyView with API check --- OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java index 5afe9918c8..be3bc7a01a 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java @@ -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)); } - 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; }