private void configureToolbar() { Toolbar toolbar = getToolbar(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) toolbar.setBackground( getResources().getDrawable(R.drawable.cci_action_bar_gradient_colors, null)); else toolbar.setBackground(getResources().getDrawable(R.drawable.cci_action_bar_gradient_colors)); }
private void configureToolbar() { Toolbar toolbar = getToolbar(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) toolbar.setBackground( getResources().getDrawable(R.drawable.cbw_action_bar_gradient_colors, null)); else toolbar.setBackground(getResources().getDrawable(R.drawable.cbw_action_bar_gradient_colors)); toolbar.setTitleTextColor(Color.WHITE); if (toolbar.getMenu() != null) toolbar.getMenu().clear(); }
@SuppressWarnings("deprecation") private void configureToolbar() { Toolbar toolbar = getToolbar(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) toolbar.setBackground( getResources().getDrawable(R.drawable.ccw_action_bar_gradient_colors, null)); else toolbar.setBackground(getResources().getDrawable(R.drawable.ccw_action_bar_gradient_colors)); if (toolbar.getMenu() != null) toolbar.getMenu().clear(); }
private void configureToolbar() { Toolbar toolbar = getToolbar(); if (toolbar != null) { // toolbar.setBackgroundColor(Color.parseColor("#1d1d25")); toolbar.setTitleTextColor(Color.WHITE); // toolbar.setBackgroundColor(Color.TRANSPARENT); // toolbar.setBottom(Color.WHITE); // if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { // Window window = getActivity().getWindow(); // window.setStatusBarColor(Color.parseColor("#1d1d25")); // } Drawable drawable = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { drawable = getResources() .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors, null); toolbar.setElevation(0); } else { drawable = getResources() .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors); } toolbar.setBackground(drawable); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_import); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(" "); toolbar.setBackground(getDrawable(R.drawable.beequietbanner)); }
private void updateTitleBackground(float progress) { ColorDrawable drawable = new ColorDrawable(toolbarBackgroundColor); if (progress <= 1) { drawable.setAlpha((int) (progress * 255)); } else { drawable.setAlpha(255); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) toolbar.setBackground(drawable); else toolbar.setBackgroundDrawable(drawable); }
private void configureToolbar() { Toolbar toolbar = getToolbar(); if (toolbar != null) { toolbar.setTitleTextColor(Color.WHITE); toolbar.setBackgroundColor(Color.TRANSPARENT); toolbar.setBottom(Color.WHITE); Drawable drawable = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) drawable = getResources() .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors, null); else drawable = getResources() .getDrawable(R.drawable.dap_wallet_asset_issuer_action_bar_gradient_colors); toolbar.setBackground(drawable); } }
private void updateActionBarTransparency(float scrollRatio) { int newAlpha = (int) (scrollRatio * 255); mActionBarBackgroundDrawable.setAlpha(newAlpha); toolbar.setBackground(mActionBarBackgroundDrawable); }