0

我正在尝试创建一个具有 facebook 共享(使用 facebook SDK)和 twitter 的推文按钮(使用 Fabric)的应用程序。我知道我可以通过意图来做到这一点,但我需要为此创建按钮。

Facebook SDK 提供了一个视图来使用

<com.facebook.widget.LikeView 
............/>

但我找不到类似的视图来创建 facebook 分享按钮。推特也是如此。有嵌入推文的视图,但没有用于创建简单推文按钮的视图。是否有一个原因?另外要创建自己的推文和分享按钮,我似乎没有在按钮中找到要使用的官方“f”和“twitter-bird”徽标。他们提供这个吗?

4

1 回答 1

1

About Twitter Fabric, if you want send twitter button, you must implement it on your own. It's not hard, Just use your TwitterApiClient method update():

apiClient.getStatusesService().update(composeTweet.getText().toString(), 
                    null, null, null, null, null, null, null, callback);

Where's "composeTweet.getText()" is your EditText field, and "callback" is Callback<Tweet> callback. You can read more about it parameters from "dev.twitter.com/rest/reference/post/statuses/update".

If you want set Twitter-Style to your button, just add to button xml: style="@style/tw__Button"

Also, the documentation have an example, how to add entire TweetCompose activity. It may cause some troubles to implement, but you can use another example from here.

If you have more questions, you can find more help and useful info at "twittercommunity.com/c/fabric", because Twitter staff are answering there.

于 2015-03-16T18:11:35.490 回答