use of com.fastaccess.ui.adapter.UsersAdapter in project FastHub by k0shk0sh.
the class OrgListDialogFragment method onFragmentCreated.
@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
toolbar.setTitle(R.string.organizations);
toolbar.inflateMenu(R.menu.add_menu);
toolbar.getMenu().findItem(R.id.add).setIcon(R.drawable.ic_info_outline).setTitle(R.string.no_orgs_dialog_title);
toolbar.setOnMenuItemClickListener(item -> {
MessageDialogView.newInstance(getString(R.string.no_orgs_dialog_title), getString(R.string.no_orgs_description), false, true).show(getChildFragmentManager(), MessageDialogView.TAG);
return true;
});
toolbar.setNavigationIcon(R.drawable.ic_clear);
toolbar.setNavigationOnClickListener(v -> dismiss());
stateLayout.setEmptyText(R.string.no_orgs);
stateLayout.setOnReloadListener(v -> getPresenter().onLoadOrgs());
refresh.setOnRefreshListener(() -> getPresenter().onLoadOrgs());
recycler.setEmptyView(stateLayout, refresh);
adapter = new UsersAdapter(getPresenter().getOrgs());
recycler.setAdapter(adapter);
recycler.addKeyLineDivider();
if (savedInstanceState == null) {
getPresenter().onLoadOrgs();
}
fastScroller.attachRecyclerView(recycler);
}
use of com.fastaccess.ui.adapter.UsersAdapter in project FastHub by k0shk0sh.
the class RepoContributorsFragment method onFragmentCreated.
@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
if (getArguments() == null) {
throw new NullPointerException("Bundle is null, therefore, issues can't be proceeded.");
}
stateLayout.setEmptyText(R.string.no_contributors);
stateLayout.setOnReloadListener(this);
refresh.setOnRefreshListener(this);
recycler.setEmptyView(stateLayout, refresh);
recycler.addKeyLineDivider();
adapter = new UsersAdapter(getPresenter().getUsers(), true);
adapter.setListener(getPresenter());
getLoadMore().initialize(getPresenter().getCurrentPage(), getPresenter().getPreviousTotal());
recycler.setAdapter(adapter);
recycler.addOnScrollListener(getLoadMore());
if (savedInstanceState == null) {
getPresenter().onFragmentCreated(getArguments());
} else if (getPresenter().getUsers().isEmpty() && !getPresenter().isApiCalled()) {
onRefresh();
}
fastScroller.attachRecyclerView(recycler);
}
use of com.fastaccess.ui.adapter.UsersAdapter in project FastHub by k0shk0sh.
the class TeamMembersFragment method onFragmentCreated.
@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
if (getArguments() == null) {
throw new NullPointerException("Bundle is null, username is required");
}
stateLayout.setEmptyText(R.string.no_members);
stateLayout.setOnReloadListener(this);
refresh.setOnRefreshListener(this);
recycler.setEmptyView(stateLayout, refresh);
getLoadMore().initialize(getPresenter().getCurrentPage(), getPresenter().getPreviousTotal());
adapter = new UsersAdapter(getPresenter().getFollowers());
adapter.setListener(getPresenter());
recycler.setAdapter(adapter);
recycler.addOnScrollListener(getLoadMore());
recycler.addKeyLineDivider();
if (getPresenter().getFollowers().isEmpty() && !getPresenter().isApiCalled()) {
onRefresh();
}
fastScroller.attachRecyclerView(recycler);
}
use of com.fastaccess.ui.adapter.UsersAdapter in project FastHub by k0shk0sh.
the class ProfileFollowingFragment method onFragmentCreated.
@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
if (getArguments() == null) {
throw new NullPointerException("Bundle is null, username is required");
}
stateLayout.setEmptyText(R.string.no_followings);
stateLayout.setOnReloadListener(this);
refresh.setOnRefreshListener(this);
recycler.setEmptyView(stateLayout, refresh);
getLoadMore().initialize(getPresenter().getCurrentPage(), getPresenter().getPreviousTotal());
adapter = new UsersAdapter(getPresenter().getFollowing());
adapter.setListener(getPresenter());
recycler.setAdapter(adapter);
recycler.addOnScrollListener(getLoadMore());
recycler.addKeyLineDivider();
if (getPresenter().getFollowing().isEmpty() && !getPresenter().isApiCalled()) {
onRefresh();
}
fastScroller.attachRecyclerView(recycler);
}
use of com.fastaccess.ui.adapter.UsersAdapter in project FastHub by k0shk0sh.
the class OrgMembersFragment method onFragmentCreated.
@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
if (getArguments() == null) {
throw new NullPointerException("Bundle is null, username is required");
}
stateLayout.setEmptyText(R.string.no_members);
stateLayout.setOnReloadListener(this);
refresh.setOnRefreshListener(this);
recycler.setEmptyView(stateLayout, refresh);
getLoadMore().initialize(getPresenter().getCurrentPage(), getPresenter().getPreviousTotal());
adapter = new UsersAdapter(getPresenter().getFollowers());
adapter.setListener(getPresenter());
recycler.setAdapter(adapter);
recycler.addOnScrollListener(getLoadMore());
recycler.addKeyLineDivider();
if (getPresenter().getFollowers().isEmpty() && !getPresenter().isApiCalled()) {
onRefresh();
}
fastScroller.attachRecyclerView(recycler);
}
Aggregations