Show retweet counts using TweetViewAdapter using Twitter Fabric kit


I want to show the retweet counts also below each tweets. How can I achieve my objective ? Do I have to add separate rows after each entry in ListView to show retweet counts or is there any other way by which I can extend the CompactTweetView to include retweet counts. Another way is that I use an empty LinearLayout and add a row for retweet count view after each CompactTweetView.

If anything is not clear please ask for more information. For example in the image below I want to display retweet count also, but it seems there is no inbuilt way to do that using Fabric.


Addition to this, tweetview in fabric doesn’t give option to look into images while clicking ; like the way twitter displays - complete image and default it shows cropped image.

There is no option so far in tweetview in fabric to attach any action button, we have attached in our list view and customized tweet box as well. Check below mentioned image for reference.

Now issue is fabric is showing tweets but not enabling option to image in full view mode.
As twitter media content is not fixed, it can be Gif, png or jpeg (right now) .
Request to fabric development team to enable option to see image while clicking on image or provide option to segregate media type.


Can you please explain how did you attach action button in your list view. I also want to achieve the same functionality. Did you write a custom adapter for that y extending the inbuilt TweeterAdapter. I think this is the way to achieve my objective. What do you think ?


Ok I have figured out a way to add retweet and favorite button after the Tweet View.
Now I want to override the default onCLick behaviour of Tweet view. Because in default behaviour it is firing an View intent. Did you face the same problem ?


I’m also trying to add a retweet button. Could you share how you accomplished this?


In the getView method of the adapter make a new layout and add all the required views for example retweet button, favorite button etc. as child of it along with the Main compactTweetView. Add return the new linearlayout as the view from getView method. Following code snippet shows it. Here iv1, and iv2 are child views. This can be retweet buttons or any other functionality that you want. Don’t forget to add the CompactTweetView in it.

        LinearLayout lv2 = new LinearLayout(this.context, null);

        lv2.addView((View) iv1, 0);
        lv2.addView((View) iv2, 1);


But what about clicking on those button ? Means are ther any api to retweet that has to be code in those clickListners?


Yes Use statusesService = twitterApiClient.getStatusesService();
In statusesService you will find many functions for task like retweet etc.
Use statusesService.retweet function for retweet.

closed #9