use of com.readystatesoftware.systembartint.SystemBarTintManager 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);
}
use of com.readystatesoftware.systembartint.SystemBarTintManager in project Shuttle by timusus.
the class SettingsActivity method onCreate.
@SuppressLint("InlinedApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
if (!ShuttleUtils.isUpgraded() && !ShuttleUtils.isAmazonBuild()) {
IabManager.getInstance();
}
ThemeUtils.setTheme(this);
mPrefs = PreferenceManager.getDefaultSharedPreferences(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);
setContentView(R.layout.activity_settings);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ThemeUtils.themeActionBar(this);
ThemeUtils.themeStatusBar(this, mTintManager);
if (savedInstanceState == null) {
if (!getIntent().getBooleanExtra(EXTRA_SUPPORT, false)) {
getSupportActionBar().setTitle(getString(R.string.settings));
getSupportFragmentManager().beginTransaction().replace(R.id.main_container, new SettingsFragment()).commit();
} else {
getSupportActionBar().setTitle(getString(R.string.pref_title_support));
getSupportFragmentManager().beginTransaction().replace(R.id.main_container, SettingsFragment.newInstance(R.xml.settings_support)).commit();
}
}
}
use of com.readystatesoftware.systembartint.SystemBarTintManager in project discreet-app-rate by PomepuyN.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window win = getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
winParams.flags |= bits;
bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
winParams.flags |= bits;
win.setAttributes(winParams);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint
tintManager.setNavigationBarTintEnabled(true);
tintManager.setTintColor(Color.parseColor("#DDDDDD"));
}
manageViews();
settings = getSharedPreferences(PreferencesConstants.PREFS_NAME, 0);
editor = settings.edit();
updateValueDisplay();
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switch(actionSpinner.getSelectedItemPosition()) {
case 0:
getAppRate().checkAndShow();
break;
case 1:
getAppRate().reset();
break;
case 2:
getAppRate().forceShow();
break;
case 3:
getAppRate().neverShowAgain();
break;
case 4:
editor.putLong(PreferencesConstants.KEY_LAST_CRASH, System.currentTimeMillis());
editor.commit();
Toast.makeText(MainActivity.this, "App has crashed just now", Toast.LENGTH_LONG).show();
break;
}
updateValueDisplay();
}
});
}
Aggregations