Exemple #1
0
  private void doGetBannerUsers() {
    lastArea = SalonTools.getArea(mActivity);
    mActivity.showWaitDialog();
    accountService.getBannerUsers(
        SalonTools.getArea(mActivity),
        new AsyncResponseCompletedHandler<String>() {

          @Override
          public String doCompleted(ResponseBean<?> response, ChCareWepApiServiceType servieType) {

            salons.clear();
            barbers.clear();

            if (response.getState() >= 0 && response.getData() != null) {
              ArrayList<SalonUser> users = (ArrayList<SalonUser>) response.getData();
              for (SalonUser user : users) {
                if (user.getRole() == Role.SALON) {
                  salons.add(user);
                } else if (user.getRole() == Role.BARBER) {
                  barbers.add(user);
                }
              }
            }

            initSalons();
            initBarbers();
            doGetBanners();
            return null;
          }
        });
  }
Exemple #2
0
  private void checkUpdate() {
    if (CacheManager.INSTANCE.getCurrentUser() != null
        && CacheManager.INSTANCE.getCurrentUser().getRole() != Role.UNDIFINED
        && mActivity
            .getCHApplication()
            .getPreferenceConfig()
            .getBoolean(MyProperties.getMyProperties().getRemindUpdateKey(), true)) {

      VerInfo ver = (VerInfo) banners.get(2);
      UpdateManager um = new UpdateManager(mContext);
      um.showUpdateDialog(ver, true);
    }
  }
Exemple #3
0
  private void doGetBanners() {
    mActivity.showWaitDialog();
    accountService.getBanners(
        new AsyncResponseCompletedHandler<String>() {

          @Override
          public String doCompleted(ResponseBean<?> response, ChCareWepApiServiceType servieType) {

            if (response.getState() >= 0 && response.getData() != null) {
              banners = (ArrayList<BannerPic>) response.getData();
            }
            mActivity.hideAllDialog();
            initAdViewPager();
            initMallViewPager();
            checkUpdate();
            return null;
          }
        });
  }