Code review changes

This commit is contained in:
Gabriel Calero 2018-05-18 19:43:41 -03:00
parent 85cff19020
commit 054e6041af

View file

@ -53,6 +53,7 @@ public class DomainAdapter extends RecyclerView.Adapter<DomainAdapter.ViewHolder
domainProvider.retrieve(filterText, new DomainProvider.DomainCallback() {
@Override
public void retrieveOk(List<Domain> domain) {
if (filterText.length() == 0) {
Domain lastVisitedDomain = new Domain(mContext.getString(R.string.your_last_location), mLastLocation, DEFAULT_THUMBNAIL_PLACE);
if (!mLastLocation.isEmpty() && mLastLocation.contains("://")) {
int startIndex = mLastLocation.indexOf("://");
@ -64,12 +65,11 @@ public class DomainAdapter extends RecyclerView.Adapter<DomainAdapter.ViewHolder
}
}
}
if (filterText.length() == 0) {
domain.add(0, lastVisitedDomain);
}
for (Domain d : domain) {
// we override the default picture added in the server by an android specific version
if (d.thumbnail != null &&
d.thumbnail.endsWith("assets/places/thumbnail-default-place-e5a3f33e773ab699495774990a562f9f7693dc48ef90d8be6985c645a0280f75.png")) {
d.thumbnail = DEFAULT_THUMBNAIL_PLACE;