private void render() { mCurrancyListLayout.removeAllViews(); for (int i = 0; i < mAdapter.getItemCount(); i++) { CurrencyAdapter.RecyclerViewHolder holder = mAdapter.onCreateViewHolder(mCurrancyListLayout, i); mAdapter.onBindViewHolder(holder, i); mCurrancyListLayout.addView(holder.itemView); } }
@Override protected void onResume() { super.onResume(); String id = getIntent().getStringExtra(ID); Organization organization = mCurrencyService.getOrganization(id); getSupportActionBar().setTitle(organization.getTitle()); getSupportActionBar().setSubtitle(organization.getCity().getName()); mTitle.setText(organization.getTitle()); mLink.setText(organization.getLink()); mAddress.setText(organization.getAddress()); mRegion.setText(organization.getRegion().getName()); mCity.setText(organization.getCity().getName()); mPhone.setText(PhoneUtils.formatPhoneNumber(organization.getPhone())); mAdapter.setCurrencies(organization.getCurrencies()); render(); }