コード例 #1
0
  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));
  }
コード例 #2
0
  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();
  }
コード例 #3
0
  @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();
  }
コード例 #4
0
  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);
    }
  }
コード例 #5
0
 @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));
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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);
   }
 }
コード例 #8
0
ファイル: PitScout.java プロジェクト: Meshiest/chAPPreciate
 private void updateActionBarTransparency(float scrollRatio) {
   int newAlpha = (int) (scrollRatio * 255);
   mActionBarBackgroundDrawable.setAlpha(newAlpha);
   toolbar.setBackground(mActionBarBackgroundDrawable);
 }