use of com.facebook.share.widget.LikeView in project facebook-android-sdk by facebook.
the class ShareFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mCallbackManager = CallbackManager.Factory.create();
View view = inflater.inflate(R.layout.share_it_view, container, false);
LoginButton loginButton = (LoginButton) view.findViewById(R.id.login_button);
loginButton.setFragment(this);
loginButton.setReadPermissions("public_profile");
setupViewPage(view);
LikeView pageLike = (LikeView) view.findViewById(R.id.like_page);
pageLike.setFragment(this);
return view;
}
use of com.facebook.share.widget.LikeView in project facebook-android-sdk by facebook.
the class ShareFragment method setupViewPage.
private void setupViewPage(View view) {
mViewPage = (ViewPager) view.findViewById(R.id.pager);
PagerAdapter adapter = new ScreenSlidePagerAdapter(getFragmentManager());
mViewPage.setAdapter(adapter);
final PageSelector pageSelector = (PageSelector) view.findViewById(R.id.page_selector);
pageSelector.setImageCount(IMAGE_IDS.size());
final LikeView photoLike = (LikeView) view.findViewById(R.id.like_photo);
photoLike.setFragment(this);
mViewPage.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
pageSelector.setPosition(position);
String shareContent = IMAGE_IDS.get(position).second;
photoLike.setObjectIdAndType(shareContent, LikeView.ObjectType.OPEN_GRAPH);
mShareContentChangedListener.onShareContentChanged(shareContent);
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
Aggregations