private void getReviewDetailsById() { AuditModel getAuditModel = new AuditModel(); getAuditModel.setAT(AppConfigManager.getAccessToken(mContext)); getAuditModel.setUId(AppConfigManager.getLoggedUid(mContext)); getAuditModel.setRID(AppConfigManager.getReturnRID(mContext)); getAuditModel.setDId(AppConfigManager.getDID(mContext)); if (getAuditDetails != null) getAuditDetails.cancel(true); getAuditDetails = new AuditForm8868_URL(getAuditModel.getAuditDetails(mContext), mContext); getAuditDetails.setOnResultListener(getAuditAsync); getAuditDetails.execute(); }
@Override public void run() { if (getAuditResponse != null && getAuditResponse.getOS() != null && getAuditResponse.getOS().equalsIgnoreCase("Success")) { if (getAuditResponse.getErrorList() != null && getAuditResponse.getErrorList().size() > 0 || getAuditResponse.getCautionList() != null && getAuditResponse.getCautionList().size() > 0) { wholeNoErrorLayout.setVisibility(View.GONE); wholeErrorLayout.setVisibility(View.VISIBLE); if (getAuditResponse.getErrorList() != null && getAuditResponse.getErrorList().size() > 0) { Error_layout.setVisibility(View.VISIBLE); NoError_layout.setVisibility(View.GONE); ReviewErrorListAdapter adapter = new ReviewErrorListAdapter( mContext, getAuditResponse.getErrorList(), R.layout.error_adapter, getActivity(), BId, EIN, BN); // LinearLayoutManager llm = new LinearLayoutManager(mContext); // llm.setOrientation(LinearLayoutManager.VERTICAL); // errorlist.setLayoutManager(llm); errorlist.setAdapter(adapter); errorlist.setExpanded(true); adapter.notifyDataSetChanged(); } else { ReviewNext.setEnabled(true); Error_layout.setVisibility(View.GONE); NoError_layout.setVisibility(View.VISIBLE); } if (getAuditResponse.getCautionList() != null && getAuditResponse.getCautionList().size() > 0) { ReviewCautionListAdapter adapter = new ReviewCautionListAdapter( mContext, getAuditResponse.getCautionList(), R.layout.error_adapter, getActivity(), BId, EIN, BN); // LinearLayoutManager llm = new LinearLayoutManager(mContext); // llm.setOrientation(LinearLayoutManager.VERTICAL); // cautionList.setLayoutManager(llm); cautionList.setAdapter(adapter); cautionList.setExpanded(true); adapter.notifyDataSetChanged(); caution_layout.setVisibility(View.VISIBLE); NoCaution_layout.setVisibility(View.GONE); } else { caution_layout.setVisibility(View.GONE); NoCaution_layout.setVisibility(View.VISIBLE); } } else { ReviewNext.setEnabled(true); wholeNoErrorLayout.setVisibility(View.VISIBLE); wholeErrorLayout.setVisibility(View.GONE); } } else if (getAuditResponse.getOS().equalsIgnoreCase("Failure")) { if (getAuditResponse.getEM() != null && !getAuditResponse.getEM().equalsIgnoreCase("null")) { if (getAuditResponse.getEM().equalsIgnoreCase("Access Token is invalid")) { utils.errorMessage(mContext, "Your session is Expired"); Logout.logout(mContext); } else { utils.errorMessage(mContext, getAuditResponse.getEM()); } } } }