Hi, I’m using tweetviews to display embedded tweets in our news articles. But the tweets which have images appear truncated.
Example screenshot:
Web url for this news : https://www.filmipop.com/news/movies/just-married-akshay-kumar-weds-bhumi-pednekar-in-toilet-ek-prem-katha/articleshow/57272600
I’m using tweetview to display this image. Code is as follows:
Xml for layout to display tweet.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_tweet_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
Adding tweet dynamically:
public static View getTweetViewForTweet(final Context context, final String element) {
long id = Long.parseLong(getAtrribute(element, "id"));
final ViewGroup mTweetView = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.layout_tweet_view, null);
TweetUtils.loadTweet(id, new Callback<Tweet>() {
@Override
public void success(Result<Tweet> result) {
final TweetView tweetView = new TweetView(context, result.data,
R.style.tw__TweetLightWithActionsStyle);
mTweetView.addView(tweetView);
}
@Override
public void failure(com.twitter.sdk.android.core.TwitterException e) {
}
});
return mTweetView;
}
I’d appreciate some help. Thanks.