// Path: app/src/main/java/io/github/droidkaigi/confsched2017/view/fragment/ContributorsFragment.java
// public class ContributorsFragment extends BaseFragment implements ContributorsViewModel.Callback {
// 
//     public static final String TAG = ContributorsFragment.class.getSimpleName();
// 
//     @Inject
//     ContributorsViewModel viewModel;
// 
//     private FragmentContributorsBinding binding;
// 
//     private Adapter adapter;
// 
//     public static ContributorsFragment newInstance() {
//         return new ContributorsFragment();
//     }
// 
//     public ContributorsFragment() {
//     }
// 
//     @Override
//     public void onAttach(Context context) {
//         super.onAttach(context);
//         getComponent().inject(this);
//     }
// 
//     @Override
//     public void onDetach() {
//         viewModel.destroy();
//         super.onDetach();
//     }
// 
//     @Override
//     public void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         viewModel.setCallback(this);
//         viewModel.start();
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         setHasOptionsMenu(true);
//         binding = FragmentContributorsBinding.inflate(inflater, container, false);
//         binding.setViewModel(viewModel);
// 
//         initView();
//         return binding.getRoot();
//     }
// 
//     @Override
//     public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
//         menuInflater.inflate(R.menu.menu_contributors, menu);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case R.id.item_repository:
//                 viewModel.onClickRepositoryMenu();
//                 return true;
//             default:
//                 return super.onOptionsItemSelected(item);
//         }
//     }
// 
// 
//     private void initView() {
//         adapter = new Adapter(getContext(), viewModel.getContributorViewModels());
//         binding.recyclerView.setAdapter(adapter);
//         binding.recyclerView.setLayoutManager(new GridLayoutManager(getContext(), getColumnCount()));
//     }
// 
//     @Override
//     public void onConfigurationChanged(Configuration newConfig) {
//         super.onConfigurationChanged(newConfig);
//         ((GridLayoutManager) binding.recyclerView.getLayoutManager()).setSpanCount(getColumnCount());
//     }
// 
//     @Override
//     public void showError(@StringRes int resId) {
//         Snackbar.make(binding.getRoot(), resId, Snackbar.LENGTH_INDEFINITE)
//                 .setAction(R.string.retry, v -> viewModel.retry())
//                 .setActionTextColor(ContextCompat.getColor(getActivity(), R.color.white))
//                 .show();
//     }
// 
//     private int getColumnCount() {
//         return getResources().getInteger(R.integer.contributors_columns);
//     }
// 
//     private static class Adapter
//             extends ArrayRecyclerAdapter<ContributorViewModel, BindingHolder<ViewContributorCellBinding>> {
// 
//         public Adapter(@NonNull Context context, @NonNull ObservableList<ContributorViewModel> list) {
//             super(context, list);
// 
//             list.addOnListChangedCallback(new ObservableList.OnListChangedCallback<ObservableList<ContributorViewModel>>() {
//                 @Override
//                 public void onChanged(ObservableList<ContributorViewModel> contributorViewModels) {
//                     notifyDataSetChanged();
//                 }
// 
//                 @Override
//                 public void onItemRangeChanged(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1) {
//                     notifyItemRangeChanged(i, i1);
//                 }
// 
//                 @Override
//                 public void onItemRangeInserted(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1) {
//                     notifyItemRangeInserted(i, i1);
//                 }
// 
//                 @Override
//                 public void onItemRangeMoved(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1,
//                         int i2) {
//                     notifyItemMoved(i, i1);
//                 }
// 
//                 @Override
//                 public void onItemRangeRemoved(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1) {
//                     notifyItemRangeRemoved(i, i1);
//                 }
//             });
//         }
// 
//         @Override
//         public BindingHolder<ViewContributorCellBinding> onCreateViewHolder(ViewGroup parent, int viewType) {
//             return new BindingHolder<>(getContext(), parent, R.layout.view_contributor_cell);
//         }
// 
//         @Override
//         public void onBindViewHolder(BindingHolder<ViewContributorCellBinding> holder, int position) {
//             ContributorViewModel viewModel = getItem(position);
//             ViewContributorCellBinding itemBinding = holder.binding;
//             itemBinding.setViewModel(viewModel);
//             itemBinding.executePendingBindings();
//         }
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import javax.inject.Inject;
import io.github.droidkaigi.confsched2017.R;
import io.github.droidkaigi.confsched2017.databinding.ActivityContributorsBinding;
import io.github.droidkaigi.confsched2017.view.fragment.ContributorsFragment;
import io.github.droidkaigi.confsched2017.viewmodel.ToolbarViewModel;
package io.github.droidkaigi.confsched2017.view.activity;




public class ContributorsActivity extends BaseActivity {

    private ActivityContributorsBinding binding;

    @Inject
    ToolbarViewModel viewModel;

    public static Intent createIntent(Context context) {
        return new Intent(context, ContributorsActivity.class);
    }

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

        binding = DataBindingUtil.setContentView(this, R.layout.activity_contributors);
        binding.setViewModel(viewModel);

        initBackToolbar(binding.toolbar);
        viewModel.setToolbarTitle(getString(R.string.contributors));
// Path: app/src/main/java/io/github/droidkaigi/confsched2017/view/fragment/ContributorsFragment.java
// public class ContributorsFragment extends BaseFragment implements ContributorsViewModel.Callback {
// 
//     public static final String TAG = ContributorsFragment.class.getSimpleName();
// 
//     @Inject
//     ContributorsViewModel viewModel;
// 
//     private FragmentContributorsBinding binding;
// 
//     private Adapter adapter;
// 
//     public static ContributorsFragment newInstance() {
//         return new ContributorsFragment();
//     }
// 
//     public ContributorsFragment() {
//     }
// 
//     @Override
//     public void onAttach(Context context) {
//         super.onAttach(context);
//         getComponent().inject(this);
//     }
// 
//     @Override
//     public void onDetach() {
//         viewModel.destroy();
//         super.onDetach();
//     }
// 
//     @Override
//     public void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         viewModel.setCallback(this);
//         viewModel.start();
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         setHasOptionsMenu(true);
//         binding = FragmentContributorsBinding.inflate(inflater, container, false);
//         binding.setViewModel(viewModel);
// 
//         initView();
//         return binding.getRoot();
//     }
// 
//     @Override
//     public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
//         menuInflater.inflate(R.menu.menu_contributors, menu);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case R.id.item_repository:
//                 viewModel.onClickRepositoryMenu();
//                 return true;
//             default:
//                 return super.onOptionsItemSelected(item);
//         }
//     }
// 
// 
//     private void initView() {
//         adapter = new Adapter(getContext(), viewModel.getContributorViewModels());
//         binding.recyclerView.setAdapter(adapter);
//         binding.recyclerView.setLayoutManager(new GridLayoutManager(getContext(), getColumnCount()));
//     }
// 
//     @Override
//     public void onConfigurationChanged(Configuration newConfig) {
//         super.onConfigurationChanged(newConfig);
//         ((GridLayoutManager) binding.recyclerView.getLayoutManager()).setSpanCount(getColumnCount());
//     }
// 
//     @Override
//     public void showError(@StringRes int resId) {
//         Snackbar.make(binding.getRoot(), resId, Snackbar.LENGTH_INDEFINITE)
//                 .setAction(R.string.retry, v -> viewModel.retry())
//                 .setActionTextColor(ContextCompat.getColor(getActivity(), R.color.white))
//                 .show();
//     }
// 
//     private int getColumnCount() {
//         return getResources().getInteger(R.integer.contributors_columns);
//     }
// 
//     private static class Adapter
//             extends ArrayRecyclerAdapter<ContributorViewModel, BindingHolder<ViewContributorCellBinding>> {
// 
//         public Adapter(@NonNull Context context, @NonNull ObservableList<ContributorViewModel> list) {
//             super(context, list);
// 
//             list.addOnListChangedCallback(new ObservableList.OnListChangedCallback<ObservableList<ContributorViewModel>>() {
//                 @Override
//                 public void onChanged(ObservableList<ContributorViewModel> contributorViewModels) {
//                     notifyDataSetChanged();
//                 }
// 
//                 @Override
//                 public void onItemRangeChanged(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1) {
//                     notifyItemRangeChanged(i, i1);
//                 }
// 
//                 @Override
//                 public void onItemRangeInserted(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1) {
//                     notifyItemRangeInserted(i, i1);
//                 }
// 
//                 @Override
//                 public void onItemRangeMoved(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1,
//                         int i2) {
//                     notifyItemMoved(i, i1);
//                 }
// 
//                 @Override
//                 public void onItemRangeRemoved(ObservableList<ContributorViewModel> contributorViewModels, int i, int i1) {
//                     notifyItemRangeRemoved(i, i1);
//                 }
//             });
//         }
// 
//         @Override
//         public BindingHolder<ViewContributorCellBinding> onCreateViewHolder(ViewGroup parent, int viewType) {
//             return new BindingHolder<>(getContext(), parent, R.layout.view_contributor_cell);
//         }
// 
//         @Override
//         public void onBindViewHolder(BindingHolder<ViewContributorCellBinding> holder, int position) {
//             ContributorViewModel viewModel = getItem(position);
//             ViewContributorCellBinding itemBinding = holder.binding;
//             itemBinding.setViewModel(viewModel);
//             itemBinding.executePendingBindings();
//         }
//     }
// }


// Path: app/src/main/java/io/github/droidkaigi/confsched2017/view/activity/ContributorsActivity.java
import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import javax.inject.Inject;
import io.github.droidkaigi.confsched2017.R;
import io.github.droidkaigi.confsched2017.databinding.ActivityContributorsBinding;
import io.github.droidkaigi.confsched2017.view.fragment.ContributorsFragment;
import io.github.droidkaigi.confsched2017.viewmodel.ToolbarViewModel;

package io.github.droidkaigi.confsched2017.view.activity;




public class ContributorsActivity extends BaseActivity {

    private ActivityContributorsBinding binding;

    @Inject
    ToolbarViewModel viewModel;

    public static Intent createIntent(Context context) {
        return new Intent(context, ContributorsActivity.class);
    }

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

        binding = DataBindingUtil.setContentView(this, R.layout.activity_contributors);
        binding.setViewModel(viewModel);

        initBackToolbar(binding.toolbar);
        viewModel.setToolbarTitle(getString(R.string.contributors));
        replaceFragment(ContributorsFragment.newInstance(), R.id.content_view);