private void initEmptyView(int loaded) {
   if (loaded == 0) {
     emptyViewStub.setVisibility(View.VISIBLE);
   } else {
     emptyViewStub.setVisibility(View.GONE);
   }
 }
  public void showImageGridView() {
    // 显示转发的布局
    mForwardLayout.setVisibility(View.VISIBLE);
    if (mImageGvViewStub.getVisibility() == View.GONE) {
      mImageGvViewStub.setVisibility(View.VISIBLE);
      // gridview布局umeng_comm_images_gc.xml
      int imageGvResId = ResFinder.getId("umeng_comm_msg_gridview");
      mImageGv = (WrapperGridView) this.findViewById(imageGvResId);
      mImageGv.hasScrollBar = true;
    }

    mImageGv.setBackgroundColor(Color.TRANSPARENT);
    mImageGv.setVisibility(View.VISIBLE);
    // adapter
    FeedImageAdapter gridviewAdapter = new FeedImageAdapter(mContext);
    gridviewAdapter.addDatasOnly(mFeedItem.getImages());
    // 设置图片
    mImageGv.setAdapter(gridviewAdapter);
    // 计算列数
    mImageGv.updateColumns(3);

    // 图片GridView
    mImageGv.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int pos, long id) {
            mPresenter.jumpToImageBrowser(mFeedItem.getImages(), pos);
          }
        });
  }
예제 #3
0
  @Override
  public void setSecondary(
      boolean show,
      String name,
      boolean nameIsNumber,
      String label,
      Drawable photo,
      boolean isConference,
      boolean isGeneric) {

    if (show) {
      if (isConference) {
        name = getConferenceString(isGeneric);
        photo = getConferencePhoto(isGeneric);
        nameIsNumber = false;
      }

      showAndInitializeSecondaryCallInfo();
      mSecondaryCallName.setText(name);

      int nameDirection = View.TEXT_DIRECTION_INHERIT;
      if (nameIsNumber) {
        nameDirection = View.TEXT_DIRECTION_LTR;
      }
      mSecondaryCallName.setTextDirection(nameDirection);

      setDrawableToImageView(mSecondaryPhoto, photo);
    } else {
      mSecondaryCallInfo.setVisibility(View.GONE);
    }
  }
예제 #4
0
 public void onEventMainThread(SubscriptionAddActivity.FollowFlagEvent event) {
   if (event.flag) {
     if (mSetting != null) mSetting.setVisibility(View.GONE);
     if (listLayout == null) {
       listLayout = mListViewStub.inflate();
       initListView(listLayout);
     } else {
       listLayout.setVisibility(View.VISIBLE);
       data.clear();
       adapter.notifyDataSetChanged();
       mEmptyView.show(true);
       mEmptyView.onLoading();
       request(Urls.SERVER_PATH + "/user/feeds", 0);
     }
   } else {
     stopRefreshNews();
     if (mListViewStub != null) mListViewStub.setVisibility(View.GONE);
     if (settingLayout == null) {
       settingLayout = mSetting.inflate();
       initSettingView(settingLayout);
     } else settingLayout.setVisibility(View.VISIBLE);
   }
 }
 private void showBanner() {
   if (m_bannerViewStub == null) {
     m_bannerViewStub = (ViewStub) findViewById(R.id.viewstub_banner);
     View v = m_bannerViewStub.inflate();
     m_closeButton = (ImageButton) v.findViewById(R.id.imagebutton_close);
     m_closeButton.setOnClickListener(
         new View.OnClickListener() {
           @Override
           public void onClick(View arg0) {
             m_bannerViewStub.setVisibility(View.GONE);
           }
         });
   }
   m_bannerViewStub.setVisibility(View.VISIBLE);
 }
예제 #6
0
  protected View createGraphObjectView(T graphObject) {
    View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null);

    ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub);
    if (checkboxStub != null) {
      if (!getShowCheckbox()) {
        checkboxStub.setVisibility(View.GONE);
      } else {
        CheckBox checkBox = (CheckBox) checkboxStub.inflate();
        updateCheckboxState(checkBox, false);
      }
    }

    ViewStub profilePicStub =
        (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub);
    if (!getShowPicture()) {
      profilePicStub.setVisibility(View.GONE);
    } else {
      ImageView imageView = (ImageView) profilePicStub.inflate();
      imageView.setVisibility(View.VISIBLE);
    }

    return result;
  }
예제 #7
0
  private void bindData() {
    TippyTipperApplication appState = ((TippyTipperApplication) this.getApplication());

    TextView lbl_split_amount = (TextView) findViewById(R.id.lbl_split_amount);
    TextView lbl_split_tip = (TextView) findViewById(R.id.lbl_split_tip);
    TextView lbl_split_adjustment = (TextView) findViewById(R.id.lbl_split_adjustment);
    TextView lbl_split_total = (TextView) findViewById(R.id.lbl_split_total);
    TextView lbl_NumberOfPeople = (TextView) findViewById(R.id.lbl_NumberOfPeople);

    View inflated_splitTax = findViewById(R.id.inflated_splitTax);

    float excludeTaxRate = Settings.getExcludeTaxRate(getBaseContext());
    if (excludeTaxRate != 0) {
      ViewStub stub_splitTax = (ViewStub) findViewById(R.id.stub_splitTax);
      if (stub_splitTax != null) stub_splitTax.setVisibility(View.VISIBLE);
      else if (inflated_splitTax != null) inflated_splitTax.setVisibility(View.VISIBLE);
      TextView lbl_split_tax = (TextView) findViewById(R.id.lbl_split_tax);
      lbl_split_tax.setText(appState.service.getSplitTaxAmount());
    } else {
      if (inflated_splitTax != null) inflated_splitTax.setVisibility(View.GONE);
    }

    lbl_split_amount.setText(appState.service.getSplitBillAmount());
    lbl_split_tip.setText(appState.service.getSplitTipAmount());
    lbl_split_adjustment.setText(appState.service.getSplitAdjustment());
    lbl_split_total.setText(appState.service.getSplitTotalAmount());
    lbl_NumberOfPeople.setText(Integer.toString(appState.service.getNumberOfPeople()));

    Map<String, String> params = new HashMap<String, String>();
    params.put("Number of People", String.valueOf(appState.service.getNumberOfPeople()));
    params.put("Split Bill Amount", appState.service.getSplitBillAmount());
    params.put("Split Tax Amount", appState.service.getSplitTaxAmount());
    params.put("Split Tip Amount", appState.service.getSplitTipAmount());
    params.put("Split Adjustment Amount", appState.service.getSplitAdjustment());
    params.put("Split Total Amount", appState.service.getSplitTotalAmount());
    FlurryAgent.onEvent("Split Bill Bind Data", params);
  }
예제 #8
0
  private void showAndInitializeSecondaryCallInfo() {
    mSecondaryCallInfo.setVisibility(View.VISIBLE);

    // mSecondaryCallName is initialized here (vs. onViewCreated) because it is inaccesible
    // until mSecondaryCallInfo is inflated in the call above.
    if (mSecondaryCallName == null) {
      mSecondaryCallName = (TextView) getView().findViewById(R.id.secondaryCallName);
    }
    if (mSecondaryPhoto == null) {
      mSecondaryPhoto = (ImageView) getView().findViewById(R.id.secondaryCallPhoto);
    }

    if (mSecondaryPhotoOverlay == null) {
      mSecondaryPhotoOverlay = getView().findViewById(R.id.dim_effect_for_secondary_photo);
      mSecondaryPhotoOverlay.setOnClickListener(
          new OnClickListener() {
            @Override
            public void onClick(View v) {
              getPresenter().secondaryPhotoClicked();
            }
          });
      mSecondaryPhotoOverlay.setOnTouchListener(new SmallerHitTargetTouchListener());
    }
  }
 private void hideBanner() {
   if (m_bannerViewStub != null) m_bannerViewStub.setVisibility(View.GONE);
 }
 private void updateEmptyContentContainerVisibility(RecyclerView.Adapter adapter) {
   if (emptyViewId == 0) {
     return;
   }
   emptyContentContainer.setVisibility(adapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
 }