Search in sources :

Example 1 with InfoBarArrayAdapter

use of org.chromium.chrome.browser.infobar.InfoBarControlLayout.InfoBarArrayAdapter in project AndroidChromium by JackyAndroid.

the class UpdatePasswordInfoBar method createContent.

@Override
public void createContent(InfoBarLayout layout) {
    super.createContent(layout);
    if (mTitleLinkRangeStart != 0 && mTitleLinkRangeEnd != 0) {
        SpannableString title = new SpannableString(mTitle);
        title.setSpan(new ClickableSpan() {

            @Override
            public void onClick(View view) {
                onLinkClicked();
            }
        }, mTitleLinkRangeStart, mTitleLinkRangeEnd, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        layout.setMessage(title);
    }
    InfoBarControlLayout controlLayout = layout.addControlLayout();
    if (mUsernames.length > 1) {
        InfoBarArrayAdapter<String> usernamesAdapter = new InfoBarArrayAdapter<String>(getContext(), mUsernames);
        mUsernamesSpinner = controlLayout.addSpinner(R.id.password_infobar_accounts_spinner, usernamesAdapter);
    } else {
        controlLayout.addDescription(mUsernames[0]);
    }
}
Also used : SpannableString(android.text.SpannableString) InfoBarArrayAdapter(org.chromium.chrome.browser.infobar.InfoBarControlLayout.InfoBarArrayAdapter) SpannableString(android.text.SpannableString) ClickableSpan(android.text.style.ClickableSpan) View(android.view.View)

Aggregations

SpannableString (android.text.SpannableString)1 ClickableSpan (android.text.style.ClickableSpan)1 View (android.view.View)1 InfoBarArrayAdapter (org.chromium.chrome.browser.infobar.InfoBarControlLayout.InfoBarArrayAdapter)1