// Path: reactivefb/src/main/java/com/beltaief/reactivefb/ReactiveFB.java
// public class ReactiveFB {
// 
//     private static ReactiveFB mInstance = null;
//     private static SimpleFacebookConfiguration mConfiguration =
//             new SimpleFacebookConfiguration.Builder().build();
//     private static SessionManager mSessionManager = null;
// 
//     public static void sdkInitialize(Context context) {
//         if (mInstance == null) {
//             Class clazz = ReactiveFB.class;
//             synchronized (clazz) {
//                 mInstance = new ReactiveFB();
//             }
//             FacebookSdk.sdkInitialize(context);
//             mSessionManager = new SessionManager(mConfiguration);
//         }
//     }
// 
//     public static void checkInit() {
//         if (!FacebookSdk.isInitialized()) {
//             throw new RuntimeException("ReactiveFB not initialized. Are you missing " +
//                     "ReactiveFB.sdkInitialize(context) ?");
//         }
//     }
// 
//     public static SessionManager getSessionManager() {
//         return mSessionManager;
//     }
// 
//     public static SimpleFacebookConfiguration getConfiguration() {
//         return mConfiguration;
//     }
// 
//     public static void setConfiguration(SimpleFacebookConfiguration configuration) {
//         mConfiguration = configuration;
//     }
// 
//     public static boolean checkPermission(PermissionHelper permission) {
//         return AccessToken.getCurrentAccessToken().getPermissions().contains(permission.getValue());
//     }
// }
// 
// Path: app/src/main/java/com/beltaief/reactivefbexample/util/Example.java
// public class Example {
// 
//     private final String mTitle;
//     private final Class<? extends Activity> aActivity;
//     private final boolean mRequiresLogin;
// 
//     public Example(String title, Class<? extends Activity> clazz, boolean requiresLogin) {
//         mTitle = title;
//         aActivity = clazz;
//         mRequiresLogin = requiresLogin;
//     }
// 
//     public String getTitle() {
//         return mTitle;
//     }
// 
//     public Class<? extends Activity> getActivity() {
//         return aActivity;
//     }
// 
//     public boolean isRequireLogin() {
//         return mRequiresLogin;
//     }
// 
// }
// 
// Path: app/src/main/java/com/beltaief/reactivefbexample/util/ExampleAdapter.java
// public class ExampleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
// 
//     private RecyclerViewClickListener mListener;
//     private List<Example> mCollection;
// 
//     public ExampleAdapter(List<Example> collection, RecyclerViewClickListener listener) {
//         this.mCollection = collection;
//         this.mListener = listener;
//     }
// 
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         View v = LayoutInflater
//                 .from(parent.getContext())
//                 .inflate(R.layout.item_example, parent, false);
// 
//         ExampleHolder viewHolder = new ExampleHolder(v);
//         return viewHolder;
//     }
// 
//     @Override
//     public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
//         ExampleHolder mHolder = (ExampleHolder) holder;
//         mHolder.button.setText(mCollection.get(position).getTitle());
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mCollection.size();
//     }
// 
//     public void setData(List<Example> data) {
//         mCollection = data;
//     }
// 
// 
//     class ExampleHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
// 
//         Button button;
// 
//         public ExampleHolder(View itemView) {
//             super(itemView);
//             button = (Button) itemView.findViewById(R.id.button);
//             button.setOnClickListener(this);
//         }
// 
//         @Override
//         public void onClick(View view) {
//             mListener.recyclerViewListClicked(view, getLayoutPosition(), view.getId());
//         }
//     }
// }
// 
// Path: app/src/main/java/com/beltaief/reactivefbexample/util/RecyclerViewClickListener.java
// public interface RecyclerViewClickListener {
//     void recyclerViewListClicked(View v, int position, int id);
// }


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Toast;
import com.beltaief.reactivefb.ReactiveFB;
import com.beltaief.reactivefbexample.R;
import com.beltaief.reactivefbexample.util.Example;
import com.beltaief.reactivefbexample.util.ExampleAdapter;
import com.beltaief.reactivefbexample.util.RecyclerViewClickListener;
import java.util.ArrayList;
package com.beltaief.reactivefbexample.views;




public class MainActivity extends AppCompatActivity implements RecyclerViewClickListener {

    private ArrayList<Example> mExamples;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
        setTitle("reactivefb examples");

        mExamples = new ArrayList<>();
        mExamples.add(new Example("Login ", LoginActivity.class, false));
        mExamples.add(new Example("Login with button", LoginButtonActivity.class, false));
        mExamples.add(new Example("Current Profile", ProfileActivity.class, true));
        mExamples.add(new Example("Albums Profile", AlbumsActivity.class, true));
        mExamples.add(new Example("My Pictures", MyPhotosActivity.class, true));
        mExamples.add(new Example("Friends", FriendsActivity.class, true));

        RecyclerView mRecyclerView = (RecyclerView) findViewById(R.id.recycler);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

// Path: reactivefb/src/main/java/com/beltaief/reactivefb/ReactiveFB.java
// public class ReactiveFB {
// 
//     private static ReactiveFB mInstance = null;
//     private static SimpleFacebookConfiguration mConfiguration =
//             new SimpleFacebookConfiguration.Builder().build();
//     private static SessionManager mSessionManager = null;
// 
//     public static void sdkInitialize(Context context) {
//         if (mInstance == null) {
//             Class clazz = ReactiveFB.class;
//             synchronized (clazz) {
//                 mInstance = new ReactiveFB();
//             }
//             FacebookSdk.sdkInitialize(context);
//             mSessionManager = new SessionManager(mConfiguration);
//         }
//     }
// 
//     public static void checkInit() {
//         if (!FacebookSdk.isInitialized()) {
//             throw new RuntimeException("ReactiveFB not initialized. Are you missing " +
//                     "ReactiveFB.sdkInitialize(context) ?");
//         }
//     }
// 
//     public static SessionManager getSessionManager() {
//         return mSessionManager;
//     }
// 
//     public static SimpleFacebookConfiguration getConfiguration() {
//         return mConfiguration;
//     }
// 
//     public static void setConfiguration(SimpleFacebookConfiguration configuration) {
//         mConfiguration = configuration;
//     }
// 
//     public static boolean checkPermission(PermissionHelper permission) {
//         return AccessToken.getCurrentAccessToken().getPermissions().contains(permission.getValue());
//     }
// }
// 
// Path: app/src/main/java/com/beltaief/reactivefbexample/util/Example.java
// public class Example {
// 
//     private final String mTitle;
//     private final Class<? extends Activity> aActivity;
//     private final boolean mRequiresLogin;
// 
//     public Example(String title, Class<? extends Activity> clazz, boolean requiresLogin) {
//         mTitle = title;
//         aActivity = clazz;
//         mRequiresLogin = requiresLogin;
//     }
// 
//     public String getTitle() {
//         return mTitle;
//     }
// 
//     public Class<? extends Activity> getActivity() {
//         return aActivity;
//     }
// 
//     public boolean isRequireLogin() {
//         return mRequiresLogin;
//     }
// 
// }
// 
// Path: app/src/main/java/com/beltaief/reactivefbexample/util/ExampleAdapter.java
// public class ExampleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
// 
//     private RecyclerViewClickListener mListener;
//     private List<Example> mCollection;
// 
//     public ExampleAdapter(List<Example> collection, RecyclerViewClickListener listener) {
//         this.mCollection = collection;
//         this.mListener = listener;
//     }
// 
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         View v = LayoutInflater
//                 .from(parent.getContext())
//                 .inflate(R.layout.item_example, parent, false);
// 
//         ExampleHolder viewHolder = new ExampleHolder(v);
//         return viewHolder;
//     }
// 
//     @Override
//     public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
//         ExampleHolder mHolder = (ExampleHolder) holder;
//         mHolder.button.setText(mCollection.get(position).getTitle());
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mCollection.size();
//     }
// 
//     public void setData(List<Example> data) {
//         mCollection = data;
//     }
// 
// 
//     class ExampleHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
// 
//         Button button;
// 
//         public ExampleHolder(View itemView) {
//             super(itemView);
//             button = (Button) itemView.findViewById(R.id.button);
//             button.setOnClickListener(this);
//         }
// 
//         @Override
//         public void onClick(View view) {
//             mListener.recyclerViewListClicked(view, getLayoutPosition(), view.getId());
//         }
//     }
// }
// 
// Path: app/src/main/java/com/beltaief/reactivefbexample/util/RecyclerViewClickListener.java
// public interface RecyclerViewClickListener {
//     void recyclerViewListClicked(View v, int position, int id);
// }


// Path: app/src/main/java/com/beltaief/reactivefbexample/views/MainActivity.java
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Toast;
import com.beltaief.reactivefb.ReactiveFB;
import com.beltaief.reactivefbexample.R;
import com.beltaief.reactivefbexample.util.Example;
import com.beltaief.reactivefbexample.util.ExampleAdapter;
import com.beltaief.reactivefbexample.util.RecyclerViewClickListener;
import java.util.ArrayList;

package com.beltaief.reactivefbexample.views;




public class MainActivity extends AppCompatActivity implements RecyclerViewClickListener {

    private ArrayList<Example> mExamples;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
        setTitle("reactivefb examples");

        mExamples = new ArrayList<>();
        mExamples.add(new Example("Login ", LoginActivity.class, false));
        mExamples.add(new Example("Login with button", LoginButtonActivity.class, false));
        mExamples.add(new Example("Current Profile", ProfileActivity.class, true));
        mExamples.add(new Example("Albums Profile", AlbumsActivity.class, true));
        mExamples.add(new Example("My Pictures", MyPhotosActivity.class, true));
        mExamples.add(new Example("Friends", FriendsActivity.class, true));

        RecyclerView mRecyclerView = (RecyclerView) findViewById(R.id.recycler);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

        ExampleAdapter mExamplesAdapter = new ExampleAdapter(mExamples, this);