Ejemplo n.º 1
0
  /** {@inheritDoc} from Fragment */
  @Override
  public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mAllContactsListViewHolder = new AllContactsListViewHolder(getActivity(), this);
    mFrequentContactsListViewHolder = new FrequentContactsListViewHolder(getActivity(), this);

    if (ContactUtil.hasReadContactsPermission()) {
      mBinding.bind(DataModel.get().createContactPickerData(getActivity(), this));
      mBinding.getData().init(getLoaderManager(), mBinding);
    }
  }
Ejemplo n.º 2
0
  @Override
  public void onDestroy() {
    super.onDestroy();
    // We could not have bound to the data if the permission was denied.
    if (mBinding.isBound()) {
      mBinding.unbind();
    }

    if (mMonitor != null) {
      mMonitor.unregister();
    }
    mMonitor = null;
  }
Ejemplo n.º 3
0
 @Override // From ContactPickerDataListener
 public void onFrequentContactsCursorUpdated(final Cursor data) {
   mBinding.ensureBound();
   mFrequentContactsListViewHolder.onContactsCursorUpdated(data);
   if (data != null && data.getCount() == 0) {
     // Show the all contacts list when there's no frequents.
     mCustomHeaderViewPager.setCurrentItem(1);
   }
 }
Ejemplo n.º 4
0
 @Override
 public void onContactCustomColorLoaded(final ContactPickerData data) {
   mBinding.ensureBound(data);
   invalidateContactLists();
 }
Ejemplo n.º 5
0
 @Override // From ContactPickerDataListener
 public void onAllContactsCursorUpdated(final Cursor data) {
   mBinding.ensureBound();
   mAllContactsListViewHolder.onContactsCursorUpdated(data);
 }