Fix my places listview background

This commit is contained in:
Alexey Kulish 2017-03-27 12:36:20 +03:00
parent 1da75cd404
commit 2a247d2d35
2 changed files with 19 additions and 2 deletions

View file

@ -115,13 +115,21 @@ public class NotesFragment extends OsmAndListFragment {
listAdapter.notifyDataSetInvalidated();
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getListView().setBackgroundColor(
getResources().getColor(
getMyApplication().getSettings().isLightContent() ? R.color.ctx_menu_info_view_bg_light
: R.color.ctx_menu_info_view_bg_dark));
}
@Override
public void onResume() {
super.onResume();
items = new ArrayList<>(plugin.getAllRecordings());
ListView listView = getListView();
if (items.size() > 0) {
if (items.size() > 0 && footerView == null) {
//listView.addHeaderView(getActivity().getLayoutInflater().inflate(R.layout.list_shadow_header, null, false));
footerView = getActivity().getLayoutInflater().inflate(R.layout.list_shadow_footer, null, false);
listView.addFooterView(footerView);

View file

@ -307,6 +307,15 @@ public class OsmEditsFragment extends OsmAndListFragment
show(getChildFragmentManager(), DeleteOsmEditsConfirmDialogFragment.TAG);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getListView().setBackgroundColor(
getResources().getColor(
getMyApplication().getSettings().isLightContent() ? R.color.ctx_menu_info_view_bg_light
: R.color.ctx_menu_info_view_bg_dark));
}
@Override
public void onResume() {
super.onResume();
@ -318,7 +327,7 @@ public class OsmEditsFragment extends OsmAndListFragment
if (listAdapter == null) {
listAdapter = new OsmEditsAdapter(dataPoints);
ListView listView = getListView();
if (dataPoints.size() > 0) {
if (dataPoints.size() > 0 && footerView == null) {
//listView.addHeaderView(getActivity().getLayoutInflater().inflate(R.layout.list_shadow_header, null, false));
footerView = getActivity().getLayoutInflater().inflate(R.layout.list_shadow_footer, null, false);
listView.addFooterView(footerView);