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);
}
}
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();
}
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);
}
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);
}
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);
}
}
Aggregations