This repository has been archived by the owner on Aug 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/white" | ||
android:gravity="center_horizontal" | ||
android:orientation="vertical" | ||
android:weightSum="1" > | ||
|
||
<TextView | ||
android:id="@+id/info" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="10dp" | ||
android:gravity="center_horizontal" | ||
android:text="***" | ||
tools:ignore="HardcodedText" /> | ||
|
||
<com.facebook.widget.LikeView | ||
android:id="@+id/like_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" > | ||
</com.facebook.widget.LikeView> | ||
|
||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="0dip" | ||
android:layout_margin="10dp" | ||
android:layout_weight="1" | ||
android:background="@drawable/result_frame" > | ||
|
||
<TextView | ||
android:id="@+id/result" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:padding="5dp" | ||
android:textSize="10sp" | ||
tools:ignore="SmallSp" /> | ||
</ScrollView> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...Facebook Sample/src/com/sromku/simple/fb/example/fragments/PublishLikeButtonFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.sromku.simple.fb.example.fragments; | ||
|
||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import com.facebook.widget.LikeView; | ||
import com.facebook.widget.LikeView.OnErrorListener; | ||
import com.sromku.simple.fb.example.R; | ||
|
||
public class PublishLikeButtonFragment extends BaseFragment { | ||
|
||
private final static String EXAMPLE = "Like button"; | ||
|
||
private TextView mResult; | ||
private LikeView mLikeView; | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
getActivity().setTitle(EXAMPLE); | ||
} | ||
|
||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
View view = inflater.inflate(R.layout.fragment_like_view, container, false); | ||
mResult = (TextView) view.findViewById(R.id.result); | ||
mLikeView = (LikeView) view.findViewById(R.id.like_view); | ||
mLikeView.setObjectId("1501124800143936"); | ||
mLikeView.setOnErrorListener(new OnErrorListener() { | ||
@Override | ||
public void onError(Bundle errorBundle) { | ||
mResult.setText("Some error happened"); | ||
} | ||
}); | ||
return view; | ||
} | ||
|
||
} |