org.chromium.chrome.browser.widget.TintedImageButton Java Examples

The following examples show how to use org.chromium.chrome.browser.widget.TintedImageButton. 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 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 #2
Source File: HistoryItemView.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mTitle = (TextView) findViewById(R.id.title);
    mDomain = (TextView) findViewById(R.id.domain);
    mIconImageView = (ImageView) findViewById(R.id.icon_view);
    mContentView = findViewById(R.id.content);
    mRemoveButton = (TintedImageButton) findViewById(R.id.remove);
    mRemoveButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            remove();
        }
    });

    updateRemoveButtonVisibility();
}
 
Example #3
Source File: BottomToolbarPhone.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();

    mExpandButton = (TintedImageButton) findViewById(R.id.expand_sheet_button);

    // Add extra top margin to the URL bar to compensate for the change to location bar's
    // vertical margin in the constructor.
    ((MarginLayoutParams) mLocationBar.findViewById(R.id.url_bar).getLayoutParams()).topMargin =
            getResources().getDimensionPixelSize(R.dimen.bottom_toolbar_url_bar_top_margin);

    // Exclude the location bar from the list of browsing mode views. This prevents its
    // visibility from changing during transitions.
    mBrowsingModeViews.remove(mLocationBar);

    updateToolbarTopMargin();
}
 
Example #4
Source File: CustomTabToolbar.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    setBackground(new ColorDrawable(
            ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color)));
    mUrlBar = (UrlBar) findViewById(R.id.url_bar);
    mUrlBar.setHint("");
    mUrlBar.setDelegate(this);
    mUrlBar.setEnabled(false);
    mUrlBar.setAllowFocus(false);
    mTitleBar = (TextView) findViewById(R.id.title_bar);
    mLocationBarFrameLayout = findViewById(R.id.location_bar_frame_layout);
    mTitleUrlContainer = findViewById(R.id.title_url_container);
    mTitleUrlContainer.setOnLongClickListener(this);
    mSecurityButton = (TintedImageButton) findViewById(R.id.security_button);
    mSecurityIconType = ConnectionSecurityLevel.NONE;
    mCustomActionButton = (ImageButton) findViewById(R.id.action_button);
    mCustomActionButton.setOnLongClickListener(this);
    mCloseButton = (ImageButton) findViewById(R.id.close_button);
    mCloseButton.setOnLongClickListener(this);
    mAnimDelegate = new CustomTabToolbarAnimationDelegate(mSecurityButton, mTitleUrlContainer);
}
 
Example #5
Source File: AppMenuIconRowFooter.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mForwardButton = (TintedImageButton) findViewById(R.id.forward_menu_id);
    mForwardButton.setOnClickListener(this);
    mForwardButton.setOnLongClickListener(this);

    mBookmarkButton = (TintedImageButton) findViewById(R.id.bookmark_this_page_id);
    mBookmarkButton.setOnClickListener(this);
    mBookmarkButton.setOnLongClickListener(this);

    mDownloadButton = (TintedImageButton) findViewById(R.id.offline_page_id);
    mDownloadButton.setOnClickListener(this);
    mDownloadButton.setOnLongClickListener(this);

    mPageInfoButton = (TintedImageButton) findViewById(R.id.info_menu_id);
    mPageInfoButton.setOnClickListener(this);
    mPageInfoButton.setOnLongClickListener(this);

    mReloadButton = (TintedImageButton) findViewById(R.id.reload_menu_id);
    mReloadButton.setOnClickListener(this);
    mReloadButton.setOnLongClickListener(this);
}
 
Example #6
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 #7
Source File: CustomTabToolbar.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    setBackground(new ColorDrawable(
            ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color)));
    mUrlBar = (UrlBar) findViewById(R.id.url_bar);
    mUrlBar.setHint("");
    mUrlBar.setDelegate(this);
    mUrlBar.setEnabled(false);
    mUrlBar.setAllowFocus(false);
    mTitleBar = (TextView) findViewById(R.id.title_bar);
    mLocationBarFrameLayout = findViewById(R.id.location_bar_frame_layout);
    mTitleUrlContainer = findViewById(R.id.title_url_container);
    mTitleUrlContainer.setOnLongClickListener(this);
    mSecurityButton = (TintedImageButton) findViewById(R.id.security_button);
    mSecurityIconType = ConnectionSecurityLevel.NONE;
    mCustomActionButton = (ImageButton) findViewById(R.id.action_button);
    mCustomActionButton.setOnLongClickListener(this);
    mCloseButton = (ImageButton) findViewById(R.id.close_button);
    mCloseButton.setOnLongClickListener(this);
    mAnimDelegate = new CustomTabToolbarAnimationDelegate(mSecurityButton, mTitleUrlContainer);
}
 
Example #8
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 #9
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 #10
Source File: AppMenuAdapter.java    From delion 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);
        }
    });
}
 
Example #11
Source File: CustomTabToolbar.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    setBackground(new ColorDrawable(
            ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color)));
    mUrlBar = (UrlBar) findViewById(R.id.url_bar);
    mUrlBar.setHint("");
    mUrlBar.setDelegate(this);
    mUrlBar.setEnabled(false);
    mUrlBar.setAllowFocus(false);
    mTitleBar = (TextView) findViewById(R.id.title_bar);
    mLocationBarFrameLayout = findViewById(R.id.location_bar_frame_layout);
    mTitleUrlContainer = findViewById(R.id.title_url_container);
    mTitleUrlContainer.setOnLongClickListener(this);
    mSecurityButton = (TintedImageButton) findViewById(R.id.security_button);
    mSecurityIconType = ConnectionSecurityLevel.NONE;
    mCustomActionButton = (ImageButton) findViewById(R.id.action_button);
    mCustomActionButton.setOnLongClickListener(this);
    mCloseButton = (ImageButton) findViewById(R.id.close_button);
    mCloseButton.setOnLongClickListener(this);
    mAnimDelegate = new CustomTabToolbarAnimationDelegate(mSecurityButton, mTitleUrlContainer);
}
 
Example #12
Source File: AppMenuAdapter.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private View createMenuItemRow(
        View convertView, ViewGroup parent, MenuItem item, int numItems) {
    RowItemViewHolder holder = null;
    if (convertView == null
            || !(convertView.getTag() instanceof RowItemViewHolder)
            || ((RowItemViewHolder) convertView.getTag()).buttons.length != numItems) {
        holder = new RowItemViewHolder(numItems);
        convertView = mInflater.inflate(R.layout.icon_row_menu_item, parent, false);

        // Save references to all the buttons.
        for (int i = 0; i < numItems; i++) {
            holder.buttons[i] =
                    (TintedImageButton) convertView.findViewById(BUTTON_IDS[i]);
        }

        // Remove unused menu items.
        for (int j = numItems; j < 5; j++) {
            ((ViewGroup) convertView).removeView(convertView.findViewById(BUTTON_IDS[j]));
        }

        convertView.setTag(holder);
        convertView.setTag(R.id.menu_item_enter_anim_id,
                buildIconItemEnterAnimator(holder.buttons));
    } else {
        holder = (RowItemViewHolder) convertView.getTag();
    }

    for (int i = 0; i < numItems; i++) {
        setupImageButton(holder.buttons[i], item.getSubMenu().getItem(i));
    }
    convertView.setFocusable(false);
    convertView.setEnabled(false);
    return convertView;
}
 
Example #13
Source File: ToolbarPhone.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mLocationBar = (LocationBarPhone) findViewById(R.id.location_bar);

    mToolbarButtonsContainer = (ViewGroup) findViewById(R.id.toolbar_buttons);

    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);

    mUrlBar = (TextView) findViewById(R.id.url_bar);

    mUrlActionContainer = findViewById(R.id.url_action_container);

    mBrowsingModeViews.add(mLocationBar);

    mToolbarBackground = new ColorDrawable(getToolbarColorForVisualState(VisualState.NORMAL));
    mTabSwitcherAnimationBgOverlay =
            new ColorDrawable(getToolbarColorForVisualState(VisualState.NORMAL));

    mLocationBarBackground =
            ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.card_single);
    mLocationBarBackground.getPadding(mLocationBarBackgroundPadding);
    mLocationBar.setPadding(
            mLocationBarBackgroundPadding.left, mLocationBarBackgroundPadding.top,
            mLocationBarBackgroundPadding.right, mLocationBarBackgroundPadding.bottom);

    setLayoutTransition(null);

    mMenuButtonWrapper.setVisibility(View.VISIBLE);
    inflateTabSwitchingResources();

    setWillNotDraw(false);
}
 
Example #14
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);
    }
}
 
Example #15
Source File: ToolbarTablet.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mLocationBar = (LocationBarTablet) findViewById(R.id.location_bar);

    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);
    mBackButton = (TintedImageButton) findViewById(R.id.back_button);
    mForwardButton = (TintedImageButton) findViewById(R.id.forward_button);
    mReloadButton = (TintedImageButton) findViewById(R.id.refresh_button);
    mSecurityButton = (TintedImageButton) findViewById(R.id.security_button);
    mShowTabStack = AccessibilityUtil.isAccessibilityEnabled();

    mTabSwitcherButtonDrawable =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), false);
    mTabSwitcherButtonDrawableLight =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), true);

    mAccessibilitySwitcherButton = (ImageButton) findViewById(R.id.tab_switcher_button);
    mAccessibilitySwitcherButton.setImageDrawable(mTabSwitcherButtonDrawable);
    updateSwitcherButtonVisibility(mShowTabStack);

    mBookmarkButton = (TintedImageButton) findViewById(R.id.bookmark_button);

    mMenuButton = (TintedImageButton) findViewById(R.id.menu_button);
    mMenuButtonWrapper.setVisibility(View.VISIBLE);

    if (mAccessibilitySwitcherButton.getVisibility() == View.GONE
            && mMenuButtonWrapper.getVisibility() == View.GONE) {
        ApiCompatibilityUtils.setPaddingRelative((View) mMenuButtonWrapper.getParent(), 0, 0,
                getResources().getDimensionPixelSize(R.dimen.tablet_toolbar_end_padding), 0);
    }

    mSaveOfflineButton = (TintedImageButton) findViewById(R.id.save_offline_button);

    // Initialize values needed for showing/hiding toolbar buttons when the activity size
    // changes.
    mShouldAnimateButtonVisibilityChange = false;
    mToolbarButtonsVisible = true;
    mToolbarButtons = new TintedImageButton[] {mBackButton, mForwardButton, mReloadButton};
}
 
Example #16
Source File: ToolbarTablet.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mLocationBar = (LocationBarTablet) findViewById(R.id.location_bar);

    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);
    mBackButton = (TintedImageButton) findViewById(R.id.back_button);
    mForwardButton = (TintedImageButton) findViewById(R.id.forward_button);
    mReloadButton = (TintedImageButton) findViewById(R.id.refresh_button);
    mShowTabStack = DeviceClassManager.isAccessibilityModeEnabled(getContext())
            || CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_TABLET_TAB_STACK);

    mTabSwitcherButtonDrawable =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), false);
    mTabSwitcherButtonDrawableLight =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), true);

    mAccessibilitySwitcherButton = (ImageButton) findViewById(R.id.tab_switcher_button);
    mAccessibilitySwitcherButton.setImageDrawable(mTabSwitcherButtonDrawable);
    updateSwitcherButtonVisibility(mShowTabStack);

    mBookmarkButton = (TintedImageButton) findViewById(R.id.bookmark_button);

    mMenuButton = (TintedImageButton) findViewById(R.id.menu_button);
    mMenuButtonWrapper.setVisibility(
            shouldShowMenuButton() ? View.VISIBLE : View.GONE);

    if (mAccessibilitySwitcherButton.getVisibility() == View.GONE
            && mMenuButtonWrapper.getVisibility() == View.GONE) {
        ApiCompatibilityUtils.setPaddingRelative((View) mMenuButtonWrapper.getParent(), 0, 0,
                getResources().getDimensionPixelSize(R.dimen.tablet_toolbar_end_padding), 0);
    }

    // Initialize values needed for showing/hiding toolbar buttons when the activity size
    // changes.
    mShouldAnimateButtonVisibilityChange = false;
    mToolbarButtonsVisible = true;
    mToolbarButtons = new TintedImageButton[] {mBackButton, mForwardButton, mReloadButton};
}
 
Example #17
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 #18
Source File: AppMenuAdapter.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private View createMenuItemRow(
        View convertView, ViewGroup parent, MenuItem item, int numItems) {
    RowItemViewHolder holder = null;
    if (convertView == null
            || !(convertView.getTag() instanceof RowItemViewHolder)
            || ((RowItemViewHolder) convertView.getTag()).buttons.length != numItems) {
        holder = new RowItemViewHolder(numItems);
        convertView = mInflater.inflate(R.layout.icon_row_menu_item, parent, false);
        convertView.setTag(R.id.menu_item_original_background, convertView.getBackground());

        // Save references to all the buttons.
        for (int i = 0; i < numItems; i++) {
            TintedImageButton view =
                    (TintedImageButton) convertView.findViewById(BUTTON_IDS[i]);
            holder.buttons[i] = view;
            holder.buttons[i].setTag(
                    R.id.menu_item_original_background, holder.buttons[i].getBackground());
        }

        // Remove unused menu items.
        for (int j = numItems; j < 5; j++) {
            ((ViewGroup) convertView).removeView(convertView.findViewById(BUTTON_IDS[j]));
        }

        convertView.setTag(holder);
        convertView.setTag(R.id.menu_item_enter_anim_id,
                buildIconItemEnterAnimator(holder.buttons));
    } else {
        holder = (RowItemViewHolder) convertView.getTag();
    }

    for (int i = 0; i < numItems; i++) {
        setupImageButton(holder.buttons[i], item.getSubMenu().getItem(i));
    }
    convertView.setFocusable(false);
    convertView.setEnabled(false);
    return convertView;
}
 
Example #19
Source File: ToolbarPhone.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mLocationBar = (LocationBarPhone) findViewById(R.id.location_bar);

    mToolbarButtonsContainer = (ViewGroup) findViewById(R.id.toolbar_buttons);

    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);

    mUrlBar = (TextView) findViewById(R.id.url_bar);

    mUrlActionContainer = findViewById(R.id.url_action_container);

    mBrowsingModeViews.add(mLocationBar);

    mToolbarBackground = new ColorDrawable(getToolbarColorForVisualState(VisualState.NORMAL));
    mTabSwitcherAnimationBgOverlay =
            new ColorDrawable(getToolbarColorForVisualState(VisualState.NORMAL));

    mLocationBarBackground =
            ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.textbox);
    mLocationBarBackground.getPadding(mLocationBarBackgroundPadding);
    mLocationBar.setPadding(
            mLocationBarBackgroundPadding.left, mLocationBarBackgroundPadding.top,
            mLocationBarBackgroundPadding.right, mLocationBarBackgroundPadding.bottom);

    setLayoutTransition(null);

    mMenuButtonWrapper.setVisibility(View.VISIBLE);
    inflateTabSwitchingResources();

    setWillNotDraw(false);
}
 
Example #20
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 #21
Source File: ToolbarTablet.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mLocationBar = (LocationBarTablet) findViewById(R.id.location_bar);

    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);
    mBackButton = (TintedImageButton) findViewById(R.id.back_button);
    mForwardButton = (TintedImageButton) findViewById(R.id.forward_button);
    mReloadButton = (TintedImageButton) findViewById(R.id.refresh_button);
    mShowTabStack = DeviceClassManager.isAccessibilityModeEnabled(getContext())
            || CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_TABLET_TAB_STACK);

    mTabSwitcherButtonDrawable =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), false);
    mTabSwitcherButtonDrawableLight =
            TabSwitcherDrawable.createTabSwitcherDrawable(getResources(), true);

    mAccessibilitySwitcherButton = (ImageButton) findViewById(R.id.tab_switcher_button);
    mAccessibilitySwitcherButton.setImageDrawable(mTabSwitcherButtonDrawable);
    updateSwitcherButtonVisibility(mShowTabStack);

    mBookmarkButton = (TintedImageButton) findViewById(R.id.bookmark_button);

    mMenuButton = (TintedImageButton) findViewById(R.id.menu_button);
    mMenuButtonWrapper.setVisibility(View.VISIBLE);

    if (mAccessibilitySwitcherButton.getVisibility() == View.GONE
            && mMenuButtonWrapper.getVisibility() == View.GONE) {
        ApiCompatibilityUtils.setPaddingRelative((View) mMenuButtonWrapper.getParent(), 0, 0,
                getResources().getDimensionPixelSize(R.dimen.tablet_toolbar_end_padding), 0);
    }

    mSaveOfflineButton = (TintedImageButton) findViewById(R.id.save_offline_button);

    // Initialize values needed for showing/hiding toolbar buttons when the activity size
    // changes.
    mShouldAnimateButtonVisibilityChange = false;
    mToolbarButtonsVisible = true;
    mToolbarButtons = new TintedImageButton[] {mBackButton, mForwardButton, mReloadButton};
}
 
Example #22
Source File: AppMenuAdapter.java    From 365browser with Apache License 2.0 4 votes vote down vote up
RowItemViewHolder(int numButtons) {
    buttons = new TintedImageButton[numButtons];
}
 
Example #23
Source File: ToolbarPhone.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mPhoneLocationBar = (LocationBarPhone) findViewById(R.id.location_bar);

    mToolbarButtonsContainer = (ViewGroup) findViewById(R.id.toolbar_buttons);

    mReturnButton = (TintedImageButton) findViewById(R.id.return_button);
    mHomeButton = (TintedImageButton) findViewById(R.id.home_button);

    mUrlBar = (TextView) findViewById(R.id.url_bar);

    mUrlActionsContainer = findViewById(R.id.url_action_container);

    mBrowsingModeViews.add(mPhoneLocationBar);

    mToolbarBackground = new ColorDrawable(getToolbarColorForVisualState(VisualState.NORMAL));
    mTabSwitcherAnimationBgOverlay =
            new ColorDrawable(getToolbarColorForVisualState(VisualState.NORMAL));

    mLocationBarBackground =
            ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.inset_textbox);
    mLocationBarBackground.getPadding(mUrlBackgroundPadding);
    mPhoneLocationBar.setPadding(
            mUrlBackgroundPadding.left, mUrlBackgroundPadding.top,
            mUrlBackgroundPadding.right, mUrlBackgroundPadding.bottom);

    setLayoutTransition(null);

    mMenuButtonWrapper.setVisibility(shouldShowMenuButton() ? View.VISIBLE : View.GONE);
    if (FeatureUtilities.isDocumentMode(getContext())) {
        ApiCompatibilityUtils.setMarginEnd(
                (MarginLayoutParams) mMenuButtonWrapper.getLayoutParams(),
                getResources().getDimensionPixelSize(R.dimen.document_toolbar_menu_offset));
    }

    if (FeatureUtilities.isTabSwitchingEnabled(getContext())) {
        inflateTabSwitchingResources();
    } else {
        hideTabSwitchingResources();
    }

    setWillNotDraw(false);
}
 
Example #24
Source File: AppMenuIconRowFooter.java    From 365browser with Apache License 2.0 4 votes vote down vote up
TintedImageButton getForwardButtonForTests() {
    return mForwardButton;
}
 
Example #25
Source File: AppMenuIconRowFooter.java    From 365browser with Apache License 2.0 4 votes vote down vote up
TintedImageButton getBookmarkButtonForTests() {
    return mBookmarkButton;
}
 
Example #26
Source File: AppMenuIconRowFooter.java    From 365browser with Apache License 2.0 4 votes vote down vote up
TintedImageButton getDownloadButtonForTests() {
    return mDownloadButton;
}
 
Example #27
Source File: AppMenuIconRowFooter.java    From 365browser with Apache License 2.0 4 votes vote down vote up
TintedImageButton getPageInfoButtonForTests() {
    return mPageInfoButton;
}
 
Example #28
Source File: AppMenuIconRowFooter.java    From 365browser with Apache License 2.0 4 votes vote down vote up
TintedImageButton getReloadButtonForTests() {
    return mReloadButton;
}
 
Example #29
Source File: ToolbarLayout.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    mProgressBar = (ToolbarProgressBar) findViewById(R.id.progress);
    if (mProgressBar != null) {
        removeView(mProgressBar);
        mProgressBar.prepareForAttach(getProgressBarTopMargin());

        if (isNativeLibraryReady()) mProgressBar.initializeAnimation();
    }

    mMenuButton = (TintedImageButton) findViewById(R.id.menu_button);
    mMenuBadge = (ImageView) findViewById(R.id.menu_badge);
    mMenuButtonWrapper = findViewById(R.id.menu_button_wrapper);

    // Initialize the provider to an empty version to avoid null checking everywhere.
    mToolbarDataProvider = new ToolbarDataProvider() {
        @Override
        public boolean isIncognito() {
            return false;
        }

        @Override
        public Tab getTab() {
            return null;
        }

        @Override
        public String getText() {
            return null;
        }

        @Override
        public NewTabPage getNewTabPageForCurrentTab() {
            return null;
        }

        @Override
        public int getPrimaryColor() {
            return 0;
        }

        @Override
        public boolean isUsingBrandColor() {
            return false;
        }
    };
}
 
Example #30
Source File: ToolbarLayout.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    mProgressBar = (ToolbarProgressBar) findViewById(R.id.progress);
    if (mProgressBar != null) {
        removeView(mProgressBar);
        mProgressBar.prepareForAttach(mToolbarHeightWithoutShadow);

        if (isNativeLibraryReady()) mProgressBar.initializeAnimation();
    }

    mMenuButton = (TintedImageButton) findViewById(R.id.menu_button);
    mMenuBadge = (ImageView) findViewById(R.id.menu_badge);
    mMenuButtonWrapper = findViewById(R.id.menu_button_wrapper);

    // Initialize the provider to an empty version to avoid null checking everywhere.
    mToolbarDataProvider = new ToolbarDataProvider() {
        @Override
        public boolean isIncognito() {
            return false;
        }

        @Override
        public Tab getTab() {
            return null;
        }

        @Override
        public String getText() {
            return null;
        }

        @Override
        public NewTabPage getNewTabPageForCurrentTab() {
            return null;
        }

        @Override
        public int getPrimaryColor() {
            return 0;
        }

        @Override
        public boolean isUsingBrandColor() {
            return false;
        }
    };
}