Search in sources :

Example 31 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class AccountChooserDialog method imageFetchComplete.

@CalledByNative
private void imageFetchComplete(int index, Bitmap avatarBitmap) {
    if (mIsDestroyed)
        return;
    assert index >= 0 && index < mCredentials.length;
    assert mCredentials[index] != null;
    avatarBitmap = AccountManagementFragment.makeRoundUserPicture(avatarBitmap);
    mCredentials[index].setBitmap(avatarBitmap);
    ListView view = mDialog.getListView();
    if (index >= view.getFirstVisiblePosition() && index <= view.getLastVisiblePosition()) {
        // Profile image is in the visible range.
        View credentialView = view.getChildAt(index - view.getFirstVisiblePosition());
        if (credentialView == null)
            return;
        ImageView avatar = (ImageView) credentialView.findViewById(R.id.profile_image);
        avatar.setImageBitmap(avatarBitmap);
    }
}
Also used : ListView(android.widget.ListView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 32 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class ConnectionInfoPopup method showDialog.

/** Displays the ConnectionInfoPopup. */
@CalledByNative
private void showDialog() {
    ScrollView scrollView = new ScrollView(mContext);
    scrollView.addView(mContainer);
    mDialog.addContentView(scrollView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
    mDialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
    mDialog.show();
}
Also used : ScrollView(android.widget.ScrollView) LinearLayout(android.widget.LinearLayout) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 33 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class ConnectionInfoPopup method addMoreInfoLink.

@CalledByNative
private void addMoreInfoLink(String linkText) {
    mMoreInfoLink = new TextView(mContext);
    mLinkUrl = HELP_URL;
    mMoreInfoLink.setText(linkText);
    mMoreInfoLink.setTextColor(ApiCompatibilityUtils.getColor(mContext.getResources(), R.color.website_settings_popup_text_link));
    mMoreInfoLink.setTextSize(DESCRIPTION_TEXT_SIZE_SP);
    mMoreInfoLink.setPadding(0, mPaddingThin, 0, 0);
    mMoreInfoLink.setOnClickListener(this);
    mDescriptionLayout.addView(mMoreInfoLink);
}
Also used : TextView(android.widget.TextView) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 34 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class ConnectionInfoPopup method addDescriptionSection.

/**
     * Adds Description section, which contains an icon, a headline, and a
     * description. Most likely headline for description is empty
     */
@CalledByNative
private void addDescriptionSection(int enumeratedIconId, String headline, String description) {
    View section = addSection(enumeratedIconId, headline, description);
    assert mDescriptionLayout == null;
    mDescriptionLayout = (ViewGroup) section.findViewById(R.id.connection_info_text_layout);
}
Also used : ImageView(android.widget.ImageView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 35 with CalledByNative

use of org.chromium.base.annotations.CalledByNative in project AndroidChromium by JackyAndroid.

the class Profile method onNativeDestroyed.

@CalledByNative
private void onNativeDestroyed() {
    mNativeProfileAndroid = 0;
    if (mIsOffTheRecord) {
        Context context = ContextUtils.getApplicationContext();
        CookiesFetcher.deleteCookiesIfNecessary(context);
    }
}
Also used : Context(android.content.Context) CalledByNative(org.chromium.base.annotations.CalledByNative)

Aggregations

CalledByNative (org.chromium.base.annotations.CalledByNative)74 Activity (android.app.Activity)11 Context (android.content.Context)11 Intent (android.content.Intent)10 CastMediaRouteProvider (org.chromium.chrome.browser.media.router.cast.CastMediaRouteProvider)8 DownloadNotifier (org.chromium.chrome.browser.download.DownloadNotifier)6 View (android.view.View)5 TextView (android.widget.TextView)5 DownloadInfo (org.chromium.chrome.browser.download.DownloadInfo)5 SuppressLint (android.annotation.SuppressLint)4 PackageManager (android.content.pm.PackageManager)4 Bitmap (android.graphics.Bitmap)4 Paint (android.graphics.Paint)4 ScrollView (android.widget.ScrollView)4 ActivityManager (android.app.ActivityManager)3 ImageView (android.widget.ImageView)3 LinearLayout (android.widget.LinearLayout)3 VisibleForTesting (org.chromium.base.VisibleForTesting)3 Account (android.accounts.Account)2 ActivityNotFoundException (android.content.ActivityNotFoundException)2