use of io.plaidapp.ui.widget.BaselineGridTextView in project sbt-android by scala-android.
the class SearchActivity method setNoResultsVisibility.
private void setNoResultsVisibility(int visibility) {
if (visibility == View.VISIBLE) {
if (noResults == null) {
noResults = (BaselineGridTextView) ((ViewStub) findViewById(R.id.stub_no_search_results)).inflate();
noResults.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
searchView.setQuery("", false);
searchView.requestFocus();
ImeUtils.showIme(searchView);
}
});
}
String message = String.format(getString(R.string.no_search_results), searchView.getQuery().toString());
SpannableStringBuilder ssb = new SpannableStringBuilder(message);
ssb.setSpan(new StyleSpan(Typeface.ITALIC), message.indexOf('“') + 1, message.length() - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
noResults.setText(ssb);
}
if (noResults != null) {
noResults.setVisibility(visibility);
}
}
Aggregations