TweetTimelineListAdapter style


#1

Everything is working great, refresh working and tweets show perfectly. My only problem is how to change the visual and style of the adapter. My app is dark and the tweet page is all too bright. I would like to change the text, divider color and background color.

Thank you !


#2

Hi @Pampaziya,

Currently we support Light and Dark themes for Tweets. One could override the TweetTimelineListAdapter#getView() method or create their own TweetTimelineListAdapter. The divider drawable can be set using ListView#setDivider().

Example showing creation of Tweets using dark theme:

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View rowView = convertView;
    final Tweet tweet = getItem(position);
    if (rowView == null) {
        rowView = new CompactTweetView(context, tweet, R.style.tw__TweetDarkStyle);
    } else {
        ((BaseTweetView) rowView).setTweet(tweet);
    }
    return rowView;
}

See TweetTimelineListAdapter.java for reference.


#3

Thank you ! It’s a bit toooo dark :/… Is there a way to customize the tweet’s look? (Using something other than TweetTimeLineListAdapter)


#4

You could try creating your own style. Below is the current dark style.

<style name="tw__TweetDarkStyle">
    <item name="tw__container_bg_color">@color/tw__tweet_dark_container_bg_color</item>
    <item name="tw__primary_text_color">@color/tw__tweet_dark_primary_text_color</item>
    <item name="tw__action_color">@color/tw__tweet_action_color</item>
</style>

See: styles.xml


#5

You, my friend, just made my app look absolutely gorgeous. Kudos ! Thank you very much XD Worked beautifully


#6