Closed kozinakoff closed 6 years ago
There is an vector drawables issue on old Android devices. You should use AppCompatResources.getDrawable to support old Android versions.
... mLoadingDrawableRes = a.getResourceId(R.styleable.EmptyView_loadingDrawable, -1); ... mEmptyDrawableRes = a.getResourceId(R.styleable.EmptyView_emptyDrawable, -1); ... mErrorDrawableRes = a.getResourceId(R.styleable.EmptyView_errorDrawable, -1);`
private void setIcon(@DrawableRes int emptyDrawableRes, @ColorInt int tint) { if (emptyDrawableRes == -1) { mImageView.setVisibility(GONE); } else { mImageView.setVisibility(VISIBLE); mImageView.setImageDrawable(AppCompatResources.getDrawable(getContext(), emptyDrawableRes)); ... } }
Thanks!
Hi, which android version are we talking about exactly?
Hi! Android 4.2 for instance.
There is an vector drawables issue on old Android devices. You should use AppCompatResources.getDrawable to support old Android versions.
Thanks!