use of net.iGap.adapter.items.poll.PollAdapter in project iGap-Android by KianIranian-STDG.
the class PollFragment method init.
private void init(View view) {
emptyRecycle = view.findViewById(R.id.emptyRecycle);
rcDiscovery = view.findViewById(R.id.rcDiscovery);
pollAdapter = new PollAdapter(getActivity(), new ArrayList<>());
swipeRefreshLayout = view.findViewById(R.id.pullToRefresh);
swipeRefreshLayout.setOnRefreshListener(() -> {
setRefreshing(true);
boolean isSend = updateOrFetchRecycleViewData();
if (!isSend) {
setRefreshing(false);
HelperError.showSnackMessage(getString(R.string.wallet_error_server), false);
}
});
emptyRecycle.setOnClickListener(v -> {
boolean isSend = updateOrFetchRecycleViewData();
if (!isSend) {
HelperError.showSnackMessage(getString(R.string.wallet_error_server), false);
}
});
rcDiscovery.setLayoutManager(new LinearLayoutManager(getContext()));
rcDiscovery.setAdapter(pollAdapter);
mHelperToolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLeftIcon(R.string.icon_back).setLogoShown(true).setListener(new ToolbarListener() {
@Override
public void onLeftIconClickListener(View view) {
popBackStackFragment();
}
});
ViewGroup viewGroup = view.findViewById(R.id.fd_layout_toolbar);
viewGroup.addView(mHelperToolbar.getView());
tryToUpdateOrFetchRecycleViewData(0);
}
use of net.iGap.adapter.items.poll.PollAdapter in project iGap-Android by KianIranian-STDG.
the class PollFragment method onConfigurationChanged.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
PollAdapter adapter = (PollAdapter) rcDiscovery.getAdapter();
if (adapter != null) {
pollAdapter.notifyChangeData();
}
}
Aggregations