Search in sources :

Example 1 with ContributorView

use of com.moro.mtweaks.views.recyclerview.ContributorView in project MTweaks-KernelAdiutorMOD by morogoku.

the class ContributorsFragment method postInit.

@Override
protected void postInit() {
    super.postInit();
    showProgress();
    if (mWebpageReader == null) {
        mWebpageReader = new WebpageReader(getActivity(), new WebpageReader.WebpageListener() {

            @Override
            public void onSuccess(String url, String raw, CharSequence html) {
                if (!isAdded())
                    return;
                hideProgress();
                Contributors contributors = new Contributors(raw);
                if (contributors.readable()) {
                    for (final Contributors.Contributor contributor : contributors.getContributors()) {
                        if (contributor.getLogin().equals("Grarak")) {
                            continue;
                        }
                        addItem(new ContributorView(contributor));
                    }
                } else {
                    error();
                }
            }

            @Override
            public void onFailure(String url) {
                error();
            }
        });
        mWebpageReader.get("https://api.github.com/repos/Grarak/KernelAdiutor/contributors");
    }
}
Also used : ContributorView(com.moro.mtweaks.views.recyclerview.ContributorView) WebpageReader(com.moro.mtweaks.utils.WebpageReader) Contributors(com.moro.mtweaks.utils.other.Contributors)

Aggregations

WebpageReader (com.moro.mtweaks.utils.WebpageReader)1 Contributors (com.moro.mtweaks.utils.other.Contributors)1 ContributorView (com.moro.mtweaks.views.recyclerview.ContributorView)1