Example usage for twitter4j User getProfileImageURLHttps

List of usage examples for twitter4j User getProfileImageURLHttps

Introduction

In this page you can find the example usage for twitter4j User getProfileImageURLHttps.

Prototype

String getProfileImageURLHttps();

Source Link

Usage

From source file:com.freshdigitable.udonroad.MainActivity.java

License:Apache License

private void setupNavigationDrawer(@Nullable User user) {
    if (user == null) {
        return;//from  ww w  .j a  va 2 s  . c  o  m
    }

    final CombinedScreenNameTextView account = (CombinedScreenNameTextView) binding.navDrawer
            .findViewById(R.id.nav_header_account);
    if (account != null) {
        account.setNames(user);
    }
    final ImageView icon = (ImageView) binding.navDrawer.findViewById(R.id.nav_header_icon);
    if (icon != null) {
        Picasso.with(binding.navDrawer.getContext()).load(user.getProfileImageURLHttps()).fit().into(icon);
    }
    attachToolbar(binding.mainToolbar);
}

From source file:com.freshdigitable.udonroad.module.realm.UserRealm.java

License:Apache License

UserRealm(final User user) {
    this.id = user.getId();
    this.profileImageURLHttps = user.getProfileImageURLHttps();
    this.miniProfileImageURLHttps = user.getMiniProfileImageURLHttps();
    this.name = user.getName();
    this.screenName = user.getScreenName();
    this.description = user.getDescription();
    this.profileBannerMobileURL = user.getProfileBannerMobileURL();
    this.statusesCount = user.getStatusesCount();
    this.followersCount = user.getFollowersCount();
    this.friendsCount = user.getFriendsCount();
    this.favoritesCount = user.getFavouritesCount();
    this.profileLinkColor = user.getProfileLinkColor();
    this.descriptionURLEntities = URLEntityRealm.createList(user.getDescriptionURLEntities());
    this.url = user.getURL();
    if (user.getURLEntity() != null) {
        this.urlEntity = new URLEntityRealm(user.getURLEntity());
    }// w  w w .ja v a 2 s .  com
    this.location = user.getLocation();
    this.verified = user.isVerified();
    this.isProtected = user.isProtected();
}

From source file:com.freshdigitable.udonroad.module.realm.UserRealm.java

License:Apache License

void merge(@NonNull User u, @NonNull Realm realm) {
    if (u.getDescription() != null) { // description is nullable
        this.description = u.getDescription();
        final URLEntity[] descriptionURLEntities = u.getDescriptionURLEntities();
        if (descriptionURLEntities != null && descriptionURLEntities.length > 0) {
            this.descriptionURLEntities.clear();
            for (URLEntity url : descriptionURLEntities) {
                this.descriptionURLEntities.add(URLEntityRealm.findOrCreateFromRealm(url, realm));
            }//from  w  w  w  . j a va2  s .  c  o m
        }
    }
    this.favoritesCount = u.getFavouritesCount();
    this.followersCount = u.getFollowersCount();
    this.friendsCount = u.getFriendsCount();
    this.miniProfileImageURLHttps = u.getMiniProfileImageURLHttps();
    this.name = u.getName();
    this.profileBannerMobileURL = u.getProfileBannerMobileURL();
    this.profileImageURLHttps = u.getProfileImageURLHttps();
    this.profileLinkColor = u.getProfileLinkColor();
    this.screenName = u.getScreenName();
    this.statusesCount = u.getStatusesCount();
    this.url = u.getURL();
    final URLEntity urlEntity = u.getURLEntity();
    if (urlEntity != null && isNewUrlEntity(urlEntity)) {
        this.urlEntity = URLEntityRealm.findOrCreateFromRealm(urlEntity, realm);
    }
    this.location = u.getLocation();
    this.verified = u.isVerified();
    this.isProtected = u.isProtected();
}

From source file:com.freshdigitable.udonroad.StatusViewImageHelper.java

License:Apache License

private static void loadUserIcon(User user, final long tagId, final FullStatusView itemView) {
    getRequest(itemView.getContext(), user.getProfileImageURLHttps(), tagId)
            .resizeDimen(R.dimen.tweet_user_icon, R.dimen.tweet_user_icon)
            .placeholder(R.drawable.ic_person_outline_black).into(itemView.getIcon());
}

From source file:com.freshdigitable.udonroad.UserInfoFragment.java

License:Apache License

private void showUserInfo(User user) {
    Picasso.with(getContext()).load(user.getProfileImageURLHttps())
            .into(binding.userInfoUserInfoView.getIcon());
    Picasso.with(getContext()).load(user.getProfileBannerMobileURL()).fit()
            .into(binding.userInfoUserInfoView.getBanner());
    binding.userInfoUserInfoView.bindData(user);
}

From source file:com.github.jcustenborder.kafka.connect.twitter.StatusConverter.java

License:Apache License

public static void convert(User user, Struct struct) {
    struct.put("Id", user.getId()).put("Name", user.getName()).put("ScreenName", user.getScreenName())
            .put("Location", user.getLocation()).put("Description", user.getDescription())
            .put("ContributorsEnabled", user.isContributorsEnabled())
            .put("ProfileImageURL", user.getProfileImageURL())
            .put("BiggerProfileImageURL", user.getBiggerProfileImageURL())
            .put("MiniProfileImageURL", user.getMiniProfileImageURL())
            .put("OriginalProfileImageURL", user.getOriginalProfileImageURL())
            .put("ProfileImageURLHttps", user.getProfileImageURLHttps())
            .put("BiggerProfileImageURLHttps", user.getBiggerProfileImageURLHttps())
            .put("MiniProfileImageURLHttps", user.getMiniProfileImageURLHttps())
            .put("OriginalProfileImageURLHttps", user.getOriginalProfileImageURLHttps())
            .put("DefaultProfileImage", user.isDefaultProfileImage()).put("URL", user.getURL())
            .put("Protected", user.isProtected()).put("FollowersCount", user.getFollowersCount())
            .put("ProfileBackgroundColor", user.getProfileBackgroundColor())
            .put("ProfileTextColor", user.getProfileTextColor())
            .put("ProfileLinkColor", user.getProfileLinkColor())
            .put("ProfileSidebarFillColor", user.getProfileSidebarFillColor())
            .put("ProfileSidebarBorderColor", user.getProfileSidebarBorderColor())
            .put("ProfileUseBackgroundImage", user.isProfileUseBackgroundImage())
            .put("DefaultProfile", user.isDefaultProfile())
            .put("ShowAllInlineMedia", user.isShowAllInlineMedia()).put("FriendsCount", user.getFriendsCount())
            .put("CreatedAt", user.getCreatedAt()).put("FavouritesCount", user.getFavouritesCount())
            .put("UtcOffset", user.getUtcOffset()).put("TimeZone", user.getTimeZone())
            .put("ProfileBackgroundImageURL", user.getProfileBackgroundImageURL())
            .put("ProfileBackgroundImageUrlHttps", user.getProfileBackgroundImageUrlHttps())
            .put("ProfileBannerURL", user.getProfileBannerURL())
            .put("ProfileBannerRetinaURL", user.getProfileBannerRetinaURL())
            .put("ProfileBannerIPadURL", user.getProfileBannerIPadURL())
            .put("ProfileBannerIPadRetinaURL", user.getProfileBannerIPadRetinaURL())
            .put("ProfileBannerMobileURL", user.getProfileBannerMobileURL())
            .put("ProfileBannerMobileRetinaURL", user.getProfileBannerMobileRetinaURL())
            .put("ProfileBackgroundTiled", user.isProfileBackgroundTiled()).put("Lang", user.getLang())
            .put("StatusesCount", user.getStatusesCount()).put("GeoEnabled", user.isGeoEnabled())
            .put("Verified", user.isVerified()).put("Translator", user.isTranslator())
            .put("ListedCount", user.getListedCount()).put("FollowRequestSent", user.isFollowRequestSent());

    List<String> withheldInCountries = new ArrayList<>();
    if (null != user.getWithheldInCountries()) {
        for (String s : user.getWithheldInCountries()) {
            withheldInCountries.add(s);//w  w  w.j a  va 2 s . com
        }
    }
    struct.put("WithheldInCountries", withheldInCountries);

}

From source file:com.mastfrog.acteur.twitter.TwitterSign.java

RemoteUserInfo getUserInfo(String oauth_nonce, TwitterOAuthPlugin.TwitterToken credential,
        AuthorizationResponse auth)/* w w  w.j  a  va2s. c  o m*/
        throws UnsupportedEncodingException, GeneralSecurityException, InterruptedException, IOException {
    //        System.setProperty("twitter4j.loggerFactory", "twitter4j.internal.logging.StdOutLogger");
    System.setProperty("twitter4j.debug", "true");
    System.setProperty("twitter4j.http.useSSL", "false");

    Twitter twitter = TwitterFactory.getSingleton();
    try {
        // Idiotic 
        twitter.setOAuthConsumer(twitter_consumer_key, twitter_consumer_secret);
    } catch (Exception e) {
        e.printStackTrace();
    }
    twitter.setOAuthAccessToken(new AccessToken(auth.accessToken, auth.accessTokenSecret));
    try {
        User user = twitter.verifyCredentials();

        RUI rui = new RUI();
        rui.put("displayName", user.getName());
        rui.put("name", user.getScreenName() + "@api.twitter.com");
        rui.put("screen_name", user.getScreenName());

        rui.put("picture", user.getProfileImageURLHttps());
        rui.put("pictureLarge", user.getBiggerProfileImageURLHttps());
        rui.put("id", user.getId());
        return rui;
    } catch (TwitterException ex) {
        throw new IOException(ex);
    } finally {
        twitter.shutdown();
    }
}

From source file:de.vanita5.twittnuker.model.ParcelableDirectMessage.java

License:Open Source License

public ParcelableDirectMessage(final DirectMessage message, final long account_id, final boolean is_outgoing) {
    this.account_id = account_id;
    this.is_outgoing = is_outgoing;
    final User sender = message.getSender(), recipient = message.getRecipient();
    final String sender_profile_image_url_string = sender != null
            ? ParseUtils.parseString(sender.getProfileImageUrlHttps())
            : null;//w w  w .j a  va2s. com
    final String recipient_profile_image_url_string = recipient != null
            ? ParseUtils.parseString(recipient.getProfileImageUrlHttps())
            : null;
    id = message.getId();
    timestamp = getTime(message.getCreatedAt());
    sender_id = sender != null ? sender.getId() : -1;
    recipient_id = recipient != null ? recipient.getId() : -1;
    text_html = formatDirectMessageText(message);
    text_plain = message.getText();
    sender_name = sender != null ? sender.getName() : null;
    recipient_name = recipient != null ? recipient.getName() : null;
    sender_screen_name = sender != null ? sender.getScreenName() : null;
    recipient_screen_name = recipient != null ? recipient.getScreenName() : null;
    sender_profile_image_url = sender_profile_image_url_string;
    recipient_profile_image_url = recipient_profile_image_url_string;
    text_unescaped = toPlainText(text_html);
    medias = ParcelableMedia.fromEntities(message);
    first_media = medias != null && medias.length > 0 ? medias[0].url : null;
}

From source file:de.vanita5.twittnuker.model.ParcelableStatus.java

License:Open Source License

public ParcelableStatus(final Status orig, final long account_id, final boolean is_gap) {
    this.is_gap = is_gap;
    this.account_id = account_id;
    id = orig.getId();/* www . j a  va2 s  .  c o  m*/
    timestamp = getTime(orig.getCreatedAt());
    is_retweet = orig.isRetweet();
    final Status retweeted = orig.getRetweetedStatus();
    final User retweet_user = retweeted != null ? orig.getUser() : null;
    retweet_id = retweeted != null ? retweeted.getId() : -1;
    //NOTE getTime(orig.getCreatedAt())
    retweet_timestamp = retweeted != null ? getTime(retweeted.getCreatedAt()) : -1;
    retweeted_by_id = retweet_user != null ? retweet_user.getId() : -1;
    retweeted_by_name = retweet_user != null ? retweet_user.getName() : null;
    retweeted_by_screen_name = retweet_user != null ? retweet_user.getScreenName() : null;
    retweeted_by_profile_image = retweet_user != null
            ? ParseUtils.parseString(retweet_user.getProfileImageUrlHttps())
            : null;
    final Status status = retweeted != null ? retweeted : orig;
    final User user = status.getUser();
    user_id = user.getId();
    user_name = user.getName();
    user_screen_name = user.getScreenName();
    user_profile_image_url = ParseUtils.parseString(user.getProfileImageUrlHttps());
    user_is_protected = user.isProtected();
    user_is_verified = user.isVerified();
    user_is_following = user.isFollowing();
    text_html = formatStatusText(status);
    media = ParcelableMedia.fromEntities(status);
    text_plain = status.getText();
    retweet_count = status.getRetweetCount();
    favorite_count = status.getFavoriteCount();
    reply_count = status.getReplyCount();
    descendent_reply_count = status.getDescendentReplyCount();
    in_reply_to_name = getInReplyToName(status);
    in_reply_to_screen_name = status.getInReplyToScreenName();
    in_reply_to_status_id = status.getInReplyToStatusId();
    in_reply_to_user_id = status.getInReplyToUserId();
    source = status.getSource();
    location = new ParcelableLocation(status.getGeoLocation());
    is_favorite = status.isFavorited();
    text_unescaped = toPlainText(text_html);
    my_retweet_id = retweeted_by_id == account_id ? id : -1;
    is_possibly_sensitive = status.isPossiblySensitive();
    mentions = ParcelableUserMention.fromUserMentionEntities(status.getUserMentionEntities());
    first_media = media != null && media.length > 0 ? media[0].url : null;
}

From source file:de.vanita5.twittnuker.model.ParcelableUser.java

License:Open Source License

public ParcelableUser(final User user, final long account_id, final long position) {
    this.position = position;
    this.account_id = account_id;
    final URLEntity[] urls_url_entities = user.getURLEntities();
    id = user.getId();/*from   w ww. ja  v  a  2s . co m*/
    created_at = getTime(user.getCreatedAt());
    is_protected = user.isProtected();
    is_verified = user.isVerified();
    name = user.getName();
    screen_name = user.getScreenName();
    description_plain = user.getDescription();
    description_html = formatUserDescription(user);
    description_expanded = formatExpandedUserDescription(user);
    location = user.getLocation();
    profile_image_url = ParseUtils.parseString(user.getProfileImageUrlHttps());
    profile_banner_url = user.getProfileBannerImageUrl();
    url = ParseUtils.parseString(user.getURL());
    url_expanded = url != null && urls_url_entities != null && urls_url_entities.length > 0
            ? ParseUtils.parseString(urls_url_entities[0].getExpandedURL())
            : null;
    is_follow_request_sent = user.isFollowRequestSent();
    followers_count = user.getFollowersCount();
    friends_count = user.getFriendsCount();
    statuses_count = user.getStatusesCount();
    favorites_count = user.getFavouritesCount();
    listed_count = user.getListedCount();
    is_cache = false;
    is_following = user.isFollowing();
    description_unescaped = toPlainText(description_html);
}