示例#1
0
 public void setApplicationList(ArrayList<PackageInfoCustom> appList) {
   if (appList != null) {
     applicationList = new ArrayList<>(appList);
     if (adapterTabs != null && adapterTabs.getFragments().fragInvite != null) {
       adapterTabs.getFragments().fragInvite.setApplicationList(applicationList);
     }
     if ((view != null) && (charsooContactsList != null)) {
       view.findViewById(R.id.progressBar).setVisibility(View.GONE);
     }
   }
 }
示例#2
0
  public void doOnContactsFriendsReady() {
    if (view != null) {
      if (charsooContactsList.isEmpty() && !isBusinessPromotion) {
        mViewPager.setCurrentItem(1, true);
      }

      adapterTabs.getFragments().fragAdd.setCharsooContacts(charsooContactsList);
      adapterTabs.getFragments().fragSMS.setNoneCharsooContacts(noneCharsooPhoneNumberContactsList);
      adapterTabs.getFragments().fragInvite.setNoneCharsooContacts(noneCharsooEmailContactsList);
      if (applicationList != null) view.findViewById(R.id.progressBar).setVisibility(View.GONE);
    }
  }
示例#3
0
 public boolean ifHideEmailList() {
   if (adapterTabs != null && adapterTabs.getFragments().fragInvite != null) {
     return adapterTabs.getFragments().fragInvite.ifHideEmailList();
   } else return false;
 }
示例#4
0
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    charsooActivityContext.hideWaitDialog();
    // BEGIN_INCLUDE (setup_viewpager)
    // Get the ViewPager and set it's PagerAdapter so that it can display items
    mViewPager = (CustomViewPager) view.findViewById(R.id.viewpager);
    if (isBusinessPromotion) {
      adapterTabs =
          new AdapterRegisterUserTabs(
              getChildFragmentManager(),
              context,
              firstChildTitle,
              secondChildTitle,
              thirdChildTitle,
              2);
      mViewPager.setOffscreenPageLimit(2);
      mViewPager.setScrollDurationFactor(0.5);
      //            new
      // GetRemainingBusinessSMSCount(getActivity(),userIntId,FragmentInvite.this,GET_REMAINING_SMS_COUNT_INT_CODE).execute();
    } else {
      adapterTabs =
          new AdapterRegisterUserTabs(
              getChildFragmentManager(),
              context,
              firstChildTitle,
              secondChildTitle,
              thirdChildTitle,
              3);
      mViewPager.setOffscreenPageLimit(3);
      mViewPager.setScrollDurationFactor(0.5);
      //            new
      // GetRemainingFriendshipSMSCount(getActivity(),userIntId,FragmentInvite.this,GET_REMAINING_SMS_COUNT_INT_CODE).execute();
    }
    mViewPager.setAdapter(adapterTabs);
    // END_INCLUDE (setup_viewpager)

    // BEGIN_INCLUDE (setup_slidingtablayout)
    // Give the SlidingTabLayout the ViewPager, this must be done AFTER the ViewPager has had
    // it's PagerAdapter set.
    tabs = (PagerSlidingTabStrip) view.findViewById(R.id.sliding_tabs);
    tabs.setViewPager(mViewPager);
    tabs.setBackgroundColor(getActivity().getResources().getColor(R.color.primaryColor));
    // TODO UNCOMMENT THIS
    //        userIntId = LoginInfo.getUserId(context);

    // END_INCLUDE (setup_slidingtablayout)
    if (applicationList != null) {
      adapterTabs.getFragments().fragInvite.setApplicationList(applicationList);
    } else {
      //                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
      //                    new GetInstalledApps(getActivity(),
      // FragmentInvite.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      //                else
      if (!GetInstalledApps.isRunning)
        new GetInstalledApps(getActivity(), FragmentInvite.this).execute();
      else GetInstalledApps.addDelegate(FragmentInvite.this);

      view.findViewById(R.id.progressBar).setVisibility(View.VISIBLE);
    }
    if ((emailContactsTable == null) || (numberContactsTable == null)) {
      //                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
      //                    new GetContactData(getActivity(),
      // FragmentInvite.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      //                else
      if (!GetContactData.isRunning)
        new GetContactData(getActivity(), FragmentInvite.this).execute();
      else GetContactData.addDelegate(FragmentInvite.this);
    } else if ((charsooContactsList == null) && (!isGettingContacts)) {
      doOnPhoneContactsReady(getActivity(), isBusinessPromotion);
    } else if (!isGettingContacts) doOnContactsFriendsReady();

    if ((applicationList != null) && (charsooContactsList != null))
      view.findViewById(R.id.progressBar).setVisibility(View.GONE);
  }