Пример #1
0
  private void bindProfileAboutView(ProfileAboutView profileaboutview) {

    if (null == mData) {
      return;
    }

    String s;
    String s1;
    String s5;
    boolean flag;
    String s6;
    boolean flag1;
    if (mHasCoverPhotoUpgrade)
      profileaboutview.setCoverPhotoUrl(
          mScrapbookCoverPhotoUrl, mScrapbookCoverPhotoOffset, mIsMyProfile);
    else if (mProfile.content.scrapbook != null
        && mProfile.content.scrapbook.albumId != null
        && mProfile.content.scrapbook.plusiEntry != null) {
      int l1 = mProfile.content.scrapbook.plusiEntry.size();
      String as[] = new String[l1];
      for (int i2 = 0; i2 < l1; i2++)
        as[i2] = ((ScrapBookEntry) mProfile.content.scrapbook.plusiEntry.get(i2)).url;

      profileaboutview.setScrapbookAlbumUrls(
          Long.valueOf(Long.parseLong(mProfile.content.scrapbook.albumId)), as, mIsMyProfile);
    } else {
      profileaboutview.setCoverPhotoToDefault(mIsMyProfile);
    }
    s = mProfile.content.photoUrl;
    if (!TextUtils.isEmpty(s)) profileaboutview.setAvatarUrl(s, mIsMyProfile);
    else profileaboutview.setAvatarToDefault(mIsMyProfile);
    profileaboutview.setName(mFullName, mGivenName, mFamilyName);
    if (mProfile.config != null
        && mProfile.config.incomingConnections != null
        && mProfile.config.incomingConnections.value != null)
      profileaboutview.setAddedByCount(mProfile.config.incomingConnections.value);
    else profileaboutview.setAddedByCount(null);
    if (mIsLocalPlusPage) {
      s1 = EsLocalPageData.getFullAddress(mProfile);
      profileaboutview.setLocation(s1, false);
    } else {
      User user = mProfile.user;
      s1 = null;
      if (user != null) {
        Employments employments = mProfile.user.employments;
        String s2 = null;
        if (employments != null) {
          List list5 = mProfile.user.employments.employment;
          s2 = null;
          if (list5 != null) {
            Employment employment1 = (Employment) mProfile.user.employments.employment.get(0);
            s2 = null;
            if (employment1 != null) s2 = employment1.employer;
          }
        }
        profileaboutview.setEmployer(s2);
        Locations locations = mProfile.user.locations;
        String s3 = null;
        if (locations != null) s3 = mProfile.user.locations.currentLocation;
        profileaboutview.setLocation(s3, true);
        Educations educations = mProfile.user.educations;
        String s4 = null;
        if (educations != null) {
          List list4 = mProfile.user.educations.education;
          s4 = null;
          if (list4 != null) {
            Education education1 = (Education) mProfile.user.educations.education.get(0);
            s4 = null;
            if (education1 != null) s4 = education1.school;
          }
        }
        profileaboutview.setEducation(s4);
        s1 = null;
      }
    }
    if (mIsPlusPage && mPlusOnes != -1) {
      int k1 = R.string.stream_plus_one_count_with_plus;
      Object aobj1[] = new Object[1];
      aobj1[0] = Integer.valueOf(Math.max(mPlusOnes, 1));
      profileaboutview.setPlusOneData(getString(k1, aobj1), mPlusOneByMe);
    } else {
      profileaboutview.setPlusOneData(null, false);
    }
    if (mProfile.content != null && mProfile.content.tagLine != null)
      s5 = mProfile.content.tagLine.value;
    else s5 = null;
    if (!TextUtils.isEmpty(s5)) profileaboutview.setTagLine(s5);
    else profileaboutview.setTagLine(null);
    flag = mHasProfile;
    s6 = null;
    if (!flag) {
      int j1 = R.string.profile_not_on_google_plus;
      Object aobj[] = new Object[1];
      aobj[0] = mFullName;
      s6 = getString(j1, aobj);
    }
    if (s6 == null && mProfile.content != null && mProfile.content.introduction != null)
      s6 = mProfile.content.introduction.value.trim();
    if (!TextUtils.isEmpty(s6)) profileaboutview.setIntroduction(s6);
    if (mProfile.content != null
        && mProfile.content.links != null
        && mProfile.content.links.link != null
        && !mProfile.content.links.link.isEmpty()) flag1 = true;
    else flag1 = false;
    if (mIsLocalPlusPage) {
      SimpleProfile simpleprofile;
      String s15;
      boolean flag19;
      SimpleProfile simpleprofile1;
      List list2;
      boolean flag20;
      boolean flag21;
      AuthorityPageProto authoritypageproto;
      PlacePageLink placepagelink;
      boolean flag22;
      boolean flag23;
      SimpleProfile simpleprofile4 = mProfile;
      String s16;
      ZagatAspectRatingsProto zagataspectratingsproto;
      String s17;
      String s18;
      boolean flag24;
      GoogleReviewProto googlereviewproto;
      Iterator iterator5;
      String s20;
      String s21;
      SimpleProfile simpleprofile3;
      Object obj;
      if (mIsUnclaimedLocalPlusPage) {
        if (simpleprofile4.content == null) obj = null;
        else obj = simpleprofile4.content.photoUrl;
        if (!TextUtils.isEmpty(((CharSequence) (obj))))
          profileaboutview.setAvatarUrl(((String) (obj)), false);
      }
      simpleprofile = mProfile;
      if (simpleprofile.page.localInfo.paper.phone == null) s15 = null;
      else if (simpleprofile.page.localInfo.paper.phone.phoneNumber.size() == 0) s15 = null;
      else
        s15 =
            ((PlacePagePhoneNumber) simpleprofile.page.localInfo.paper.phone.phoneNumber.get(0))
                .formattedPhone;
      s16 = EsLocalPageData.getCid(mProfile);
      profileaboutview.setLocalActions(mFullName, s15, s16, s1);
      zagataspectratingsproto = mProfile.page.localInfo.paper.zagatAspectRatings;
      if (zagataspectratingsproto != null) flag19 = true;
      else flag19 = false;
      profileaboutview.enableLocalEditorialReviewsSection(flag19);
      if (zagataspectratingsproto != null) {
        SimpleProfile simpleprofile2 = mProfile;
        String s19;
        int i1;
        if (simpleprofile2.page.localInfo.paper.zagatEditorialReview == null) s19 = null;
        else s19 = simpleprofile2.page.localInfo.paper.zagatEditorialReview.text;
        s20 = EsLocalPageData.getPriceLabel(mProfile);
        s21 = EsLocalPageData.getPriceValue(mProfile);
        simpleprofile3 = mProfile;
        if (simpleprofile3.page.localInfo.paper.reviewsHeadline != null
            && simpleprofile3.page.localInfo.paper.reviewsHeadline.aggregatedReviews != null)
          i1 =
              simpleprofile3.page.localInfo.paper.reviewsHeadline.aggregatedReviews.numReviews
                  .intValue();
        else i1 = 0;
        profileaboutview.setLocalEditorialReviews(zagataspectratingsproto, s19, s20, s21, i1);
      }
      simpleprofile1 = mProfile;
      if (simpleprofile1.page.localInfo.paper.knownForTerms == null
          || simpleprofile1.page.localInfo.paper.knownForTerms.term == null)
        list2 = Collections.emptyList();
      else list2 = simpleprofile1.page.localInfo.paper.knownForTerms.term;
      s17 = EsLocalPageData.getOpeningHoursSummary(mProfile);
      s18 = EsLocalPageData.getOpeningHoursFull(mProfile);
      if (!TextUtils.isEmpty(s17) || !TextUtils.isEmpty(s18)) flag20 = true;
      else flag20 = false;
      if (!TextUtils.isEmpty(s15) || list2.size() > 0 || flag20) flag21 = true;
      else flag21 = false;
      profileaboutview.enableLocalDetailsSection(flag21);
      if (flag21) profileaboutview.setLocalDetails(list2, s15, s17, s18);
      authoritypageproto = mProfile.page.localInfo.paper.authorityPage;
      if (authoritypageproto == null) placepagelink = null;
      else placepagelink = authoritypageproto.authorityLink;
      if (placepagelink != null && !TextUtils.isEmpty(placepagelink.url)) flag22 = true;
      else flag22 = false;
      if (flag22 && !flag1) flag23 = true;
      else flag23 = false;
      profileaboutview.enableHompageSection(flag23);
      if (flag23)
        profileaboutview.setHomepage(
            placepagelink.url,
            placepagelink.text,
            (new StringBuilder("https://www.google.com/s2/u/0/favicons?domain="))
                .append(Uri.parse(placepagelink.url).getHost())
                .toString());
      flag24 = EsLocalPageData.hasYourActivity(mProfile);
      profileaboutview.clearAllReviews();
      profileaboutview.enableLocalYourActivitySection(flag24);
      googlereviewproto = EsLocalPageData.getYourReview(mProfile);
      if (googlereviewproto != null) profileaboutview.addYourReview(googlereviewproto);
      profileaboutview.enableLocalYourCirclesActivitySection(
          EsLocalPageData.hasCircleActivity(mProfile));
      for (iterator5 = EsLocalPageData.getCircleReviews(mProfile).iterator();
          iterator5.hasNext();
          profileaboutview.addCircleReview((GoogleReviewProto) iterator5.next())) ;
      List list3 = EsLocalPageData.getReviews(mProfile);
      boolean flag25;
      if (!list3.isEmpty()) flag25 = true;
      else flag25 = false;
      profileaboutview.enableLocalReviewsSection(flag25);
      for (Iterator iterator6 = list3.iterator();
          iterator6.hasNext();
          profileaboutview.addLocalReview((GoogleReviewProto) iterator6.next())) ;
    }
    Contacts contacts;
    boolean flag2;
    boolean flag3;
    boolean flag4;
    boolean flag5;
    if (mProfile.content == null) contacts = null;
    else contacts = mProfile.content.contacts;
    flag2 = false;
    flag3 = false;
    flag4 = false;
    Iterator iterator4;
    TaggedEmail taggedemail;
    boolean flag18;
    String s14;
    if (contacts != null) {
      if (contacts.email != null && !contacts.email.isEmpty()) flag3 = true;
      else flag3 = false;
      if (contacts.phone != null && !contacts.phone.isEmpty()) flag4 = true;
      else flag4 = false;
      if (contacts.address != null && !contacts.address.isEmpty()) flag2 = true;
      else flag2 = false;
    }
    if (flag3 || flag4 || flag2) flag5 = true;
    else flag5 = false;
    profileaboutview.enableContactSection(flag5);
    profileaboutview.clearEmails();
    profileaboutview.clearPhoneNumbers();
    profileaboutview.clearAddresses();
    if (flag3)
      for (iterator4 = contacts.email.iterator();
          iterator4.hasNext();
          profileaboutview.addEmail(taggedemail.value, s14)) {
        taggedemail = (TaggedEmail) iterator4.next();
        flag18 = mIsPlusPage;
        s14 = null;
        if (!flag18) s14 = EsPeopleData.getStringForEmailType(mContext, taggedemail.tag);
        if (s14 == null) s14 = getString(R.string.profile_item_email);
      }

    if (flag4) {
      Iterator iterator3 = contacts.phone.iterator();
      while (iterator3.hasNext()) {
        TaggedPhone taggedphone = (TaggedPhone) iterator3.next();
        String s12;
        String s13;
        boolean flag17;
        if (mIsPlusPage)
          s12 = EsPeopleData.getStringForPlusPagePhoneType(mContext, taggedphone.tag);
        else s12 = EsPeopleData.getStringForPhoneType(mContext, taggedphone.tag);
        if (s12 == null) s12 = getString(R.string.profile_item_phone);
        s13 = taggedphone.value;
        flag17 = mIsSmsIntentRegistered;
        profileaboutview.addPhoneNumber(s13, s12, flag17);
      }
    }
    if (flag2) {
      TaggedAddress taggedaddress;
      String s11;
      for (Iterator iterator2 = contacts.address.iterator();
          iterator2.hasNext();
          profileaboutview.addAddress(taggedaddress.value, s11)) {
        taggedaddress = (TaggedAddress) iterator2.next();
        boolean flag16 = mIsPlusPage;
        s11 = null;
        if (!flag16) s11 = EsPeopleData.getStringForAddress(mContext, taggedaddress.tag);
        if (s11 == null) s11 = getString(R.string.profile_item_address);
      }
    }
    profileaboutview.updateContactSectionDividers();
    boolean flag6;
    String s10 = "";
    List list1;
    int k;
    int l;
    Employment employment;
    StringBuilder stringbuilder1;
    if (!mIsPlusPage) {
      boolean flag13;
      boolean flag14;
      boolean flag15;
      if (mGender != null && !"UNKNOWN".equals(mGender) && !"OTHER".equals(mGender)) flag13 = true;
      else flag13 = false;
      if (mProfile.user != null
          && mProfile.user.birthday != null
          && !TextUtils.isEmpty(mProfile.user.birthday.value)) flag14 = true;
      else flag14 = false;
      if (flag13 || flag14) flag15 = true;
      else flag15 = false;
      profileaboutview.enablePersonalSection(flag15);
      if (flag13) {
        if ("MALE".equals(mGender)) s10 = getString(R.string.profile_item_gender_male);
        else if ("FEMALE".equals(mGender)) s10 = getString(R.string.profile_item_gender_female);
        profileaboutview.setGender(s10);
      } else {
        profileaboutview.setGender(null);
      }
      if (flag14) profileaboutview.setBirthday(mProfile.user.birthday.value);
      else profileaboutview.setBirthday(null);
      profileaboutview.updatePersonalSectionDividers();
    }
    if (mProfile.user != null
        && mProfile.user.employments != null
        && mProfile.user.employments.employment != null
        && mProfile.user.employments.employment.size() > 0) flag6 = true;
    else flag6 = false;
    profileaboutview.clearEmploymentLocations();
    if (flag6) {
      list1 = mProfile.user.employments.employment;
      k = list1.size();
      for (l = 0; l < k; l++) {
        employment = (Employment) list1.get(l);
        stringbuilder1 = new StringBuilder();
        if (!TextUtils.isEmpty(employment.title)) stringbuilder1.append(employment.title);
        addDateInfo(employment.dateInfo, stringbuilder1);
        profileaboutview.addEmploymentLocation(employment.employer, stringbuilder1.toString());
      }

    } else if (mIsMyProfile) profileaboutview.setNoEmploymentLocations();
    boolean flag7;
    boolean flag8;
    if (flag6 || mIsEditEnabled) flag7 = true;
    else flag7 = false;
    profileaboutview.enableWorkSection(flag7);
    if (mProfile.user != null
        && mProfile.user.educations != null
        && mProfile.user.educations.education != null
        && mProfile.user.educations.education.size() > 0) flag8 = true;
    else flag8 = false;
    profileaboutview.clearEducationLocations();
    if (flag8) {
      List list = mProfile.user.educations.education;
      int i = list.size();
      for (int j = 0; j < i; j++) {
        Education education = (Education) list.get(j);
        StringBuilder stringbuilder = new StringBuilder();
        if (!TextUtils.isEmpty(education.majorConcentration)) {
          stringbuilder.append(education.majorConcentration);
          addDateInfo(education.dateInfo, stringbuilder);
        }
        profileaboutview.addEducationLocation(education.school, stringbuilder.toString());
      }

    } else if (mIsMyProfile) profileaboutview.setNoEducationLocations();
    boolean flag9;
    boolean flag10;
    if (flag8 || mIsEditEnabled) flag9 = true;
    else flag9 = false;
    profileaboutview.enableEducationSection(flag9);
    if (mProfile.user != null
        && mProfile.user.locations != null
        && (!TextUtils.isEmpty(mProfile.user.locations.currentLocation)
            || mProfile.user.locations.otherLocation != null
                && !mProfile.user.locations.otherLocation.isEmpty())) flag10 = true;
    else flag10 = false;
    if (flag10) {
      profileaboutview.setLocationUrl(mProfile.user.locations.locationMapUrl);
      profileaboutview.clearLocations();
      if (mProfile.user.locations.currentLocation != null) {
        String s9 = mProfile.user.locations.currentLocation.trim();
        if (s9.length() != 0) profileaboutview.addLocation(s9, true);
      }
      if (mProfile.user.locations.otherLocation != null) {
        Iterator iterator1 = mProfile.user.locations.otherLocation.iterator();
        do {
          if (!iterator1.hasNext()) break;
          String s8 = ((String) iterator1.next()).trim();
          if (s8.length() != 0) profileaboutview.addLocation(s8, false);
        } while (true);
      }
    } else if (mIsMyProfile) {
      profileaboutview.setLocationUrl(null);
      profileaboutview.setNoLocations();
    }
    boolean flag11;
    if (flag10 || mIsEditEnabled) flag11 = true;
    else flag11 = false;
    profileaboutview.enableLocationsSection(flag11);
    profileaboutview.updateLocationsSectionDividers();
    profileaboutview.enableLinksSection(flag1);
    profileaboutview.clearLinks();
    if (flag1) {
      Iterator iterator = mProfile.content.links.link.iterator();
      do {
        if (!iterator.hasNext()) break;
        ProfilesLink profileslink = (ProfilesLink) iterator.next();
        if (profileslink.url != null) {
          boolean flag12 = mIsPlusPage;
          String s7 = null;
          if (flag12) s7 = getString(R.string.profile_item_website);
          profileaboutview.addLink(
              profileslink.url, profileslink.label, profileslink.faviconImgUrl, s7);
        }
      } while (true);
    }
    profileaboutview.updateLinksSectionDividers();
    if (mShowCircles) profileaboutview.setCircles(mCircleNames);
    else if (mShowAddToCircles) profileaboutview.showAddToCircles(mIsPlusPage);
    else if (mShowBlocked) profileaboutview.showBlocked();
    else if (mShowProgress) profileaboutview.showProgress();
    else profileaboutview.showNone();
  }
 protected final void handleResponse(Response response) throws IOException {
   GetCelebritySuggestionsResponse getcelebritysuggestionsresponse =
       (GetCelebritySuggestionsResponse) response;
   EsPeopleData.insertCelebritySuggestions(
       mContext, getAccount(), getcelebritysuggestionsresponse.category);
 }