// Path: app/src/main/java/com/livingstoneapp/MainApplication.java
// public class MainApplication extends Application {
//     private Graph mGraph;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// 
//         mGraph = Graph.Initializer.init(this, false);
//     }
// 
//     public Graph getGraph() {
//         return mGraph;
//     }
// 
//     public void setMockMode(boolean provideMocks) {
//         mGraph = Graph.Initializer.init(this, provideMocks);
//     }
// 
//     public static MainApplication from(@NonNull Context context) {
//         return (MainApplication) context.getApplicationContext();
//     }
// }
// 
// Path: app/src/main/java/com/livingstoneapp/adapters/PackageDetailViewPagerAdapter.java
// public class PackageDetailViewPagerAdapter extends FragmentPagerAdapter {
//     private final List<Fragment> mFragmentList = new ArrayList<>();
//     private final List<String> mFragmentTitleList = new ArrayList<>();
// 
//     public PackageDetailViewPagerAdapter(FragmentManager manager) {
//         super(manager);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mFragmentList.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragmentList.size();
//     }
// 
//     public void addFragment(Fragment fragment, String title) {
//         mFragmentList.add(fragment);
//         mFragmentTitleList.add(title);
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
//         return mFragmentTitleList.get(position);
//     }
// }
// 
// Path: app/src/main/java/com/livingstoneapp/presenters/IPackageDetailFragmentPresenter.java
// public interface IPackageDetailFragmentPresenter {
//     void setView(IPackageDetailFragmentView view);
//     void clearView();
//     void init(String packageName);
// }
// 
// Path: app/src/main/java/com/livingstoneapp/views/IPackageDetailFragmentView.java
// public interface IPackageDetailFragmentView {
// 
//     void setTitle(String title);
//     void showWaitDialog();
//     void hideWaitDialog();
//     void showDetailContainer();
//     void hideDetailContainer();
//     void initViews(String appName, String packageName);
//     void showError(String message);
// }


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import javax.inject.Inject;
import butterknife.Bind;
import butterknife.ButterKnife;
import com.livingstoneapp.MainApplication;
import com.livingstoneapp.R;
import com.livingstoneapp.adapters.PackageDetailViewPagerAdapter;
import com.livingstoneapp.presenters.IPackageDetailFragmentPresenter;
import com.livingstoneapp.views.IPackageDetailFragmentView;
package com.livingstoneapp.fragments;




/**
 * Created by renier on 2/2/2016.
 */
public class PackageDetailFragment extends Fragment implements IPackageDetailFragmentView {

    public static String ARG_PACKAGE_NAME = "PackageName";
    public static String ARG_2_PANE = "2Pane";

    @Inject
    IPackageDetailFragmentPresenter mPresenter;

    @Bind(R.id.progress_bar)
    ProgressBar mProgressBar;

    @Bind(R.id.tabs)
    TabLayout mTabLayout;

    @Bind(R.id.viewpager)
    ViewPager mViewPager;

    private PackageDetailViewPagerAdapter mViewPagerAdapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_package_detail, container, false);



        String packageName = getArguments().getString(ARG_PACKAGE_NAME);

// Path: app/src/main/java/com/livingstoneapp/MainApplication.java
// public class MainApplication extends Application {
//     private Graph mGraph;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// 
//         mGraph = Graph.Initializer.init(this, false);
//     }
// 
//     public Graph getGraph() {
//         return mGraph;
//     }
// 
//     public void setMockMode(boolean provideMocks) {
//         mGraph = Graph.Initializer.init(this, provideMocks);
//     }
// 
//     public static MainApplication from(@NonNull Context context) {
//         return (MainApplication) context.getApplicationContext();
//     }
// }
// 
// Path: app/src/main/java/com/livingstoneapp/adapters/PackageDetailViewPagerAdapter.java
// public class PackageDetailViewPagerAdapter extends FragmentPagerAdapter {
//     private final List<Fragment> mFragmentList = new ArrayList<>();
//     private final List<String> mFragmentTitleList = new ArrayList<>();
// 
//     public PackageDetailViewPagerAdapter(FragmentManager manager) {
//         super(manager);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mFragmentList.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragmentList.size();
//     }
// 
//     public void addFragment(Fragment fragment, String title) {
//         mFragmentList.add(fragment);
//         mFragmentTitleList.add(title);
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
//         return mFragmentTitleList.get(position);
//     }
// }
// 
// Path: app/src/main/java/com/livingstoneapp/presenters/IPackageDetailFragmentPresenter.java
// public interface IPackageDetailFragmentPresenter {
//     void setView(IPackageDetailFragmentView view);
//     void clearView();
//     void init(String packageName);
// }
// 
// Path: app/src/main/java/com/livingstoneapp/views/IPackageDetailFragmentView.java
// public interface IPackageDetailFragmentView {
// 
//     void setTitle(String title);
//     void showWaitDialog();
//     void hideWaitDialog();
//     void showDetailContainer();
//     void hideDetailContainer();
//     void initViews(String appName, String packageName);
//     void showError(String message);
// }


// Path: app/src/main/java/com/livingstoneapp/fragments/PackageDetailFragment.java
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import javax.inject.Inject;
import butterknife.Bind;
import butterknife.ButterKnife;
import com.livingstoneapp.MainApplication;
import com.livingstoneapp.R;
import com.livingstoneapp.adapters.PackageDetailViewPagerAdapter;
import com.livingstoneapp.presenters.IPackageDetailFragmentPresenter;
import com.livingstoneapp.views.IPackageDetailFragmentView;

package com.livingstoneapp.fragments;




/**
 * Created by renier on 2/2/2016.
 */
public class PackageDetailFragment extends Fragment implements IPackageDetailFragmentView {

    public static String ARG_PACKAGE_NAME = "PackageName";
    public static String ARG_2_PANE = "2Pane";

    @Inject
    IPackageDetailFragmentPresenter mPresenter;

    @Bind(R.id.progress_bar)
    ProgressBar mProgressBar;

    @Bind(R.id.tabs)
    TabLayout mTabLayout;

    @Bind(R.id.viewpager)
    ViewPager mViewPager;

    private PackageDetailViewPagerAdapter mViewPagerAdapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_package_detail, container, false);



        String packageName = getArguments().getString(ARG_PACKAGE_NAME);

        MainApplication.from(getActivity()).getGraph().inject(this);