本文整理汇总了Java中com.facebook.share.widget.ShareButton.setShareContent方法的典型用法代码示例。如果您正苦于以下问题:Java ShareButton.setShareContent方法的具体用法?Java ShareButton.setShareContent怎么用?Java ShareButton.setShareContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.share.widget.ShareButton
的用法示例。
在下文中一共展示了ShareButton.setShareContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.facebook.share.widget.ShareButton; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_routine_completed, container);
fbShare = (ShareButton) view.findViewById(R.id.fb_share);
tvMessage = (DCTextView) view.findViewById(R.id.tv_message);
tvCompleted = (DCTextView) view.findViewById(R.id.tv_completed);
ivTooth = (ImageView) view.findViewById(R.id.iv_tooth);
if (getArguments() != null) {
final Routine.Type routineType = (Routine.Type)getArguments().getSerializable(KEY_ROUTINE_TYPE);
if (routineType != null) {
AudibleMessage audibleMessage;
String shareLinkMessage;
switch (routineType) {
case MORNING:
shareLinkMessage = getString(R.string.fb_share_morning_routine_completed);
audibleMessage = AudibleMessage.MORNING_ROUTINE_END;
break;
default:
shareLinkMessage = getString(R.string.fb_share_evening_routine_completed);
audibleMessage = AudibleMessage.EVENING_ROUTINE_END;
break;
}
tvMessage.setText(audibleMessage.getMessage(getActivity()));
ShareLinkContent shareLinkContent = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(DCConstants.DENTACARE_GOOGLE_PLAY))
.setShareHashtag(new ShareHashtag.Builder()
.setHashtag("#dentacoin")
.build())
.setQuote(shareLinkMessage)
.build();
fbShare.setShareContent(shareLinkContent);
if (audibleMessage.getVoices() != null && audibleMessage.getVoices().length > 0) {
DCSoundManager.getInstance().playVoice(getActivity(), audibleMessage.getVoices()[0]);
}
}
}
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
alphaAnimation.setDuration(1000);
ivTooth.startAnimation(alphaAnimation);
AlphaAnimation dayAlphaAnimation = new AlphaAnimation(0f, 1f);
dayAlphaAnimation.setDuration(2000);
tvCompleted.startAnimation(dayAlphaAnimation);
AlphaAnimation alphaAnimationMessage = new AlphaAnimation(0f, 1f);
alphaAnimationMessage.setDuration(1000);
tvMessage.startAnimation(alphaAnimationMessage);
return view;
}