use of com.jakewharton.u2020.ui.misc.Truss in project u2020 by JakeWharton.
the class ExternalIntentActivity method fillExtras.
private void fillExtras() {
Bundle extras = baseIntent.getExtras();
if (extras == null) {
extrasView.setText("None!");
} else {
Truss truss = new Truss();
for (String key : extras.keySet()) {
Object value = extras.get(key);
String valueString;
if (value.getClass().isArray()) {
valueString = Arrays.toString((Object[]) value);
} else {
valueString = value.toString();
}
truss.pushSpan(new StyleSpan(Typeface.BOLD));
truss.append(key).append(":\n");
truss.popSpan();
truss.append(valueString).append("\n\n");
}
extrasView.setText(truss.build());
}
}
use of com.jakewharton.u2020.ui.misc.Truss in project u2020 by JakeWharton.
the class TrendingItemView method bindTo.
public void bindTo(Repository repository, Picasso picasso) {
picasso.load(repository.owner.avatar_url).placeholder(R.drawable.avatar).fit().transform(avatarTransformation).into(avatarView);
nameView.setText(repository.name);
starsView.setText(String.valueOf(repository.watchers));
forksView.setText(String.valueOf(repository.forks));
Truss description = new Truss();
description.append(repository.owner.login);
if (!TextUtils.isEmpty(repository.description)) {
description.pushSpan(new ForegroundColorSpan(descriptionColor));
description.append(" — ");
description.append(repository.description);
description.popSpan();
}
descriptionView.setText(description.build());
}
Aggregations