private void updateView() {
    ImApp app = ImApp.getApplication((Activity) mContext);
    BrandingResources brandingRes = app.getBrandingResource(mProviderId);
    int status = PresenceUtils.convertStatus(mPresence.getStatus());
    mStatusDialogButton.setImageDrawable(
        brandingRes.getDrawable(PresenceUtils.getStatusIconId(status)));

    String statusText = mPresence.getStatusText();
    if (TextUtils.isEmpty(statusText)) {
      statusText = brandingRes.getString(PresenceUtils.getStatusStringRes(status));
    }
    mLastStatusText = statusText;

    if (mStatusBar == null) {
      mStatusBar = initStatusBar(mProviderId, false);
    }
    mStatusBar.setText(statusText);

    // Disable the user to edit the custom status text because
    // the AIM and MSN server don't support it now.
    ProviderDef provider = app.getProvider(mProviderId);
    String providerName = provider == null ? null : provider.mName;
    if (Imps.ProviderNames.AIM.equals(providerName)
        || Imps.ProviderNames.MSN.equals(providerName)) {
      mStatusBar.setFocusable(false);
    }
  }
Exemple #2
0
  private String findMatchingProvider(String provider) {
    if (TextUtils.isEmpty(provider)) {
      return null;
    }

    if (Imps.ProviderNames.AIM.equalsIgnoreCase(provider)) {
      return Imps.ProviderNames.AIM;
    }

    if (Imps.ProviderNames.MSN.equalsIgnoreCase(provider)) {
      return Imps.ProviderNames.MSN;
    }

    if (Imps.ProviderNames.YAHOO.equalsIgnoreCase(provider)) {
      return Imps.ProviderNames.YAHOO;
    }

    return null;
  }