Advice: the 'Empty View' should stay in center of list instead of its parent container.
hello, I found a problem while learning your code. see the usage below:
then, you add "Empty View" into the parent of mListView (see EmptyLayout.java:463)
You view looks like this:
Obviously, I want the picture in center of list view instead of its parent.
Now I make a little change at EmptyLayout.java:changeEmptyType(), you can easily understand.
~~~
// insert views in the root view
if (!mViewsAdded) {
RelativeLayout.LayoutParams lp = new LayoutParams(mListView.getWidth(), mListView.getHeight());
lp.topMargin = mListView.getTop();
lp.leftMargin = mListView.getLeft();
RelativeLayout rl = new RelativeLayout(mContext);
rl.setLayoutParams(lp);
if (mEmptyView!=null) {
rl.addView(mEmptyView);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mEmptyView.getLayoutParams();
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
mEmptyView.setLayoutParams(layoutParams);
}
if (mLoadingView!=null) {
rl.addView(mLoadingView);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mLoadingView.getLayoutParams();
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
mLoadingView.setLayoutParams(layoutParams);
}
if (mErrorView!=null) {
rl.addView(mErrorView);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mErrorView.getLayoutParams();
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
mErrorView.setLayoutParams(layoutParams);
}
mViewsAdded = true;
ViewGroup parent = (ViewGroup) mListView.getParent();
parent.addView(rl);
mListView.setEmptyView(rl);
}
~~~
Thanks for your good code.
I don't know whether I can commit my change to your repos. however, I did it.

Wish this view support more projs. If made any trouble, I'm sorry for that.
Nice change.@walfud I want use this library to show network error UI. Thx for your code~
Just fork this repo and pull a request~
I did that. @johnwatson5412 The repo: https://github.com/walfud/android-empty-layout.git
