Exemplo n.º 1
0
  @Override
  public void updateSecurityIcon(int securityLevel) {
    if (mSecurityIconType == securityLevel) return;
    mSecurityIconType = securityLevel;

    if (securityLevel == ConnectionSecurityLevel.NONE) {
      mAnimDelegate.hideSecurityButton();
    } else {
      // ImageView#setImageResource is no-op if given resource is the current one.
      mSecurityButton.setImageResource(
          LocationBarLayout.getSecurityIconResource(securityLevel, !shouldEmphasizeHttpsScheme()));
      mAnimDelegate.showSecurityButton();
    }
    mUrlBar.emphasizeUrl();
    mUrlBar.invalidate();
  }
  @Override
  public void updateSecurityIcon(int securityLevel) {
    // ImageView#setImageResource is no-op if given resource is the current one.
    mSecurityButton.setImageResource(
        LocationBarLayout.getSecurityIconResource(securityLevel, !shouldEmphasizeHttpsScheme()));

    if (mSecurityIconType == securityLevel) return;
    mSecurityIconType = securityLevel;

    if (securityLevel == ConnectionSecurityLevel.NONE) {
      // TODO(yusufo): Add an animator for hiding as well.
      mSecurityButton.setVisibility(GONE);
    } else if (mSecurityButton.getVisibility() != View.VISIBLE) {
      if (mSecurityButtonShowAnimator.isRunning()) mSecurityButtonShowAnimator.cancel();
      mSecurityButtonShowAnimator.start();
      mUrlBar.deEmphasizeUrl();
    }
    mUrlBar.emphasizeUrl();
    mUrlBar.invalidate();
  }