Skip to content

Commit

Permalink
#56 modify setViewofElectionList() in turnoutFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1994 committed Nov 11, 2018
1 parent 1a8e0f7 commit 70ccd3b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ public Tuple2 call(Throwable throwable) {
electionVO.setElection_name(x.getValue2());
electionList.add(electionVO);
Log.d("@@@Election_name:", x.getValue2());
setViewofElectionList();
});
}
}
Expand All @@ -171,6 +170,7 @@ private void getCandidateList(){
CandidateVO candidateVO = new CandidateVO();
contractUtil.getCandidateInfo(i)
.subscribeOn(Schedulers.computation())
.observeOn(rx.android.schedulers.AndroidSchedulers.mainThread())
.onErrorReturn(new Func1<Throwable, Tuple4<BigInteger, String, BigInteger, BigInteger>>() {
@Override
public Tuple4<BigInteger, String, BigInteger, BigInteger> call(Throwable throwable) {
Expand All @@ -185,12 +185,13 @@ public Tuple4<BigInteger, String, BigInteger, BigInteger> call(Throwable throwab
candidateVO.setElection_id(Integer.parseInt(x.getValue4().toString()));
candidateList.add(candidateVO);
Log.d("@@@List", "///list:" + candidateList.size());
setViewofElectionList();
});
}
}

private void setViewofElectionList() {
if (electionCounter == electionList.size()) { // 선거정보 카운터와 선거정보리스트의 크기가 같아질때 즉, 데이터 수신이 완료 된 시점에.
if (candidateCounter == candidateList.size()) { // 선거정보 카운터와 선거정보리스트의 크기가 같아질때 즉, 데이터 수신이 완료 된 시점에.
spinnerAdapter = new ElectionSpinnerAdapter(getContext(),
android.R.layout.simple_spinner_item,
electionList);
Expand Down

0 comments on commit 70ccd3b

Please sign in to comment.