use of com.simplecity.amp_library.ui.adapters.SearchAdapter in project Shuttle by timusus.
the class SearchActivity method onCreate.
@SuppressLint("InlinedApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeUtils.setTheme(this);
if (!ShuttleUtils.hasLollipop() && ShuttleUtils.hasKitKat()) {
getWindow().setFlags(FLAG_TRANSLUCENT_STATUS, FLAG_TRANSLUCENT_STATUS);
mTintManager = new SystemBarTintManager(this);
}
if (!ShuttleUtils.hasKitKat()) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
}
if (SettingsManager.getInstance().canTintNavBar()) {
getWindow().setNavigationBarColor(ColorUtils.getPrimaryColorDark(this));
}
super.onCreate(savedInstanceState);
final String query = getIntent().getStringExtra(SearchManager.QUERY);
filterString = !TextUtils.isEmpty(query) ? query.toLowerCase().trim() : "";
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
setContentView(R.layout.activity_search);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Get the ActionBar
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(null);
ThemeUtils.themeActionBar(this);
ThemeUtils.themeStatusBar(this, mTintManager);
adapter = new SearchAdapter();
adapter.setListener(this);
recyclerView = (FastScrollRecyclerView) findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
ThemeUtils.themeRecyclerView(recyclerView);
recyclerView.setThumbColor(ColorUtils.getAccentColor());
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
ThemeUtils.themeRecyclerView(recyclerView);
super.onScrollStateChanged(recyclerView, newState);
}
});
if (requestManager == null) {
requestManager = Glide.with(this);
}
dummySelector = new MultiSelector();
songsHeader = new SearchHeaderView(new Header(getString(R.string.tracks_title)));
albumsHeader = new SearchHeaderView(new Header(getString(R.string.albums_title)));
artistsHeader = new SearchHeaderView(new Header(getString(R.string.artists_title)));
prefixHighlighter = new PrefixHighlighter(this);
}
Aggregations