move emptyStub inside api check

This commit is contained in:
Chumva 2018-03-28 16:38:19 +03:00
parent c15584eca3
commit ed67b29bf0

View file

@ -96,10 +96,10 @@ public class NotesFragment extends OsmAndListFragment {
View view = getActivity().getLayoutInflater().inflate(R.layout.update_index, container, false); View view = getActivity().getLayoutInflater().inflate(R.layout.update_index, container, false);
view.findViewById(R.id.header_layout).setVisibility(View.GONE); 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);
if (Build.VERSION.SDK_INT >= 18) { if (Build.VERSION.SDK_INT >= 18) {
ViewStub emptyStub = (ViewStub) view.findViewById(R.id.empty_view_stub);
emptyStub.setLayoutResource(R.layout.empty_state_av_notes);
emptyView = emptyStub.inflate(); emptyView = emptyStub.inflate();
int icRes = getMyApplication().getSettings().isLightContent() int icRes = getMyApplication().getSettings().isLightContent()
? R.drawable.ic_empty_state_av_notes_day : R.drawable.ic_empty_state_av_notes_night; ? R.drawable.ic_empty_state_av_notes_day : R.drawable.ic_empty_state_av_notes_night;