Java Code Examples for org.chromium.chrome.browser.widget.TintedImageButton#setVisibility()

The following examples show how to use org.chromium.chrome.browser.widget.TintedImageButton#setVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BookmarkRow.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    mIconImageView = (ImageView) findViewById(R.id.bookmark_image);
    mTitleView = (TextView) findViewById(R.id.title);

    if (isSelectable()) {
        mHighlightView = (BookmarkItemHighlightView) findViewById(R.id.highlight);

        mMoreIcon = (TintedImageButton) findViewById(R.id.more);
        mMoreIcon.setVisibility(VISIBLE);
        mMoreIcon.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                showMenu(view);
            }
        });
    }

    setOnClickListener(this);
    setOnLongClickListener(this);
}
 
Example 2
Source File: BookmarkRow.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    mIconImageView = (ImageView) findViewById(R.id.bookmark_image);
    mTitleView = (TextView) findViewById(R.id.title);

    if (isSelectable()) {
        mMoreIcon = (TintedImageButton) findViewById(R.id.more);
        mMoreIcon.setVisibility(VISIBLE);
        mMoreIcon.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                showMenu(view);
            }
        });
    }
}
 
Example 3
Source File: AppMenuAdapter.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
private void setupImageButton(TintedImageButton button, final MenuItem item) {
    // Store and recover the level of image as button.setimageDrawable
    // resets drawable to default level.
    int currentLevel = item.getIcon().getLevel();
    button.setImageDrawable(item.getIcon());
    item.getIcon().setLevel(currentLevel);
    if (item.isChecked()) {
        button.setTint(ApiCompatibilityUtils.getColorStateList(
                button.getResources(), R.color.blue_mode_tint));
    }
    button.setEnabled(item.isEnabled());
    button.setFocusable(item.isEnabled());
    button.setContentDescription(item.getTitleCondensed());

    button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            mAppMenu.onItemClick(item);
        }
    });

    // Menu items may be hidden by command line flags before they get to this point.
    button.setVisibility(item.isVisible() ? View.VISIBLE : View.GONE);
}
 
Example 4
Source File: BookmarkRow.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    mIconImageView = (ImageView) findViewById(R.id.bookmark_image);
    mTitleView = (TextView) findViewById(R.id.title);

    mMoreIcon = (TintedImageButton) findViewById(R.id.more);
    mMoreIcon.setVisibility(VISIBLE);
    mMoreIcon.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            showMenu(view);
        }
    });
}
 
Example 5
Source File: ToolbarTablet.java    From delion with Apache License 2.0 5 votes vote down vote up
private void setToolbarButtonsVisible(boolean visible) {
    if (mToolbarButtonsVisible == visible) return;

    mToolbarButtonsVisible = visible;

    if (mShouldAnimateButtonVisibilityChange) {
        runToolbarButtonsVisibilityAnimation(visible);
    } else {
        for (TintedImageButton button : mToolbarButtons) {
            button.setVisibility(visible ? View.VISIBLE : View.GONE);
        }
        mLocationBar.setShouldShowButtonsWhenUnfocused(visible);
        setStartPaddingBasedOnButtonVisibility(visible);
    }
}
 
Example 6
Source File: ToolbarTablet.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void setToolbarButtonsVisible(boolean visible) {
    if (mToolbarButtonsVisible == visible) return;

    mToolbarButtonsVisible = visible;

    if (mShouldAnimateButtonVisibilityChange) {
        runToolbarButtonsVisibilityAnimation(visible);
    } else {
        for (TintedImageButton button : mToolbarButtons) {
            button.setVisibility(visible ? View.VISIBLE : View.GONE);
        }
        mLocationBar.setShouldShowButtonsWhenUnfocused(visible);
        setStartPaddingBasedOnButtonVisibility(visible);
    }
}
 
Example 7
Source File: ToolbarTablet.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void setToolbarButtonsVisible(boolean visible) {
    if (mToolbarButtonsVisible == visible) return;

    mToolbarButtonsVisible = visible;

    if (mShouldAnimateButtonVisibilityChange) {
        runToolbarButtonsVisibilityAnimation(visible);
    } else {
        for (TintedImageButton button : mToolbarButtons) {
            button.setVisibility(visible ? View.VISIBLE : View.GONE);
        }
        mLocationBar.setShouldShowButtonsWhenUnfocused(visible);
        setStartPaddingBasedOnButtonVisibility(visible);
    }
}