Create text for empty listView

RelativeLayout lContainerLayout = new RelativeLayout(this);
lContainerLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT));
TextView textView = new TextView(this);
textView.setText("List is empty!");
RelativeLayout.LayoutParams lButtonParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
lButtonParams.addRule(RelativeLayout.CENTER_IN_PARENT);
textView.setLayoutParams(lButtonParams);
lContainerLayout.addView(textView);
addContentView(lContainerLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT));
listView.setEmptyView(lContainerLayout);

Pull to refresh in project, disabling refresh when we want to scroll down

I have been working for my graduation work on layout `pull to refresh`, called now.. SwipeRefreshLayout. It was connected with NavigationDrawerFragment.
During tests over that two things I discovered I was not able to scroll down my list without calling refresh. I found very interesting solution on stackoverflow. Answer was posted by @Cabezas. Thank You!

Continue reading “Pull to refresh in project, disabling refresh when we want to scroll down”