Ejemplo n.º 1
0
 @Override
 public void onFilterDialogItemClick(AdapterView<?> parent, View view, int position, long id) {
   ModuleMgr.getCfgMgr().setFloat("filterGender", position); // 存储该筛选配置
   infoMgr.reset();
   gender = position;
   ModuleMgr.getDiscoverMgr().reqSecAdjacent(gender, null, 1, this);
   LoadingDialog.show(this, "加载中");
 }
Ejemplo n.º 2
0
  private void initEvent() {
    height_view.setOnClickListener(this);
    home_view.setOnClickListener(this);
    area_view.setOnClickListener(this);

    UserInfo userInfo = ModuleMgr.getCenterMgr().getMyInfo();

    complete_view.setVisibility(
        ModuleMgr.getCenterMgr().getMustCompleteClazz().isEmpty() ? View.GONE : View.VISIBLE);
    height_view.setVisibility(userInfo.getHeight() == 0 ? View.VISIBLE : View.GONE);
    home_view.setVisibility("".equals(userInfo.getHomeprovince()) ? View.VISIBLE : View.GONE);
    area_view.setVisibility("".equals(userInfo.getWorkarea()) ? View.VISIBLE : View.GONE);

    divider_height.setVisibility(userInfo.getHeight() == 0 ? View.VISIBLE : View.GONE);
    divider_home.setVisibility("".equals(userInfo.getHomeprovince()) ? View.VISIBLE : View.GONE);
    divider_area.setVisibility("".equals(userInfo.getWorkarea()) ? View.VISIBLE : View.GONE);
  }
Ejemplo n.º 3
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder vh = null;

    if (convertView == null) {
      vh = new ViewHolder();
      convertView = inflate(R.layout.common_chat_gift_smile_grid_item);

      vh.gift = (ImageView) convertView.findViewById(R.id.chat_gift);
      vh.name = (TextView) convertView.findViewById(R.id.chat_gift_name);
      vh.price = (TextView) convertView.findViewById(R.id.chat_gift_price);
      vh.info = (TextView) convertView.findViewById(R.id.chat_gift_info);
      vh.mask = convertView.findViewById(R.id.mask_view);

      vh.mask.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {}
          });

      convertView.setTag(vh);
    } else {
      vh = (ViewHolder) convertView.getTag();
    }

    GiftItem item = getItem(position);

    ModuleMgr.getSmileMgr().reqImage(vh.gift, item.getImg());
    vh.name.setText(item.getName());
    vh.price.setText("" + item.getPrice() + "钻石");
    vh.info.setText(item.getInfo());

    if (ModuleMgr.getSmileMgr().getGiftLevel(chatAdapter.getLWhisperId()) < item.getLevel()) {
      vh.mask.setVisibility(View.VISIBLE);
    } else {
      vh.mask.setVisibility(View.GONE);
    }

    return convertView;
  }
Ejemplo n.º 4
0
  private void initView() {
    gender =
        (int)
            ModuleMgr.getCfgMgr()
                .getFloat(
                    "filterGender",
                    ModuleMgr.getCenterMgr().getMyInfo().getSex() == 1
                        ? 2
                        : 1); // 从配置读取,如果没有该配置,就为异性

    statusListView = (CustomStatusListView) findViewById(R.id.status_listview);
    exListView = statusListView.getExListView();
    exListView.setOnItemClickListener(this);
    exListView.setDivider(new ColorDrawable(getResources().getColor(R.color.fengexian_gray)));
    exListView.setDividerHeight(1);

    adapter = new NearbyUserAdapter(this, null);
    exListView.setAdapter(adapter);

    exListView.setPullLoadEnable(false);
    exListView.setXListViewListener(this);
    statusListView.showLoading();
  }
Ejemplo n.º 5
0
  public void refreshView() {
    UserInfo userInfo = ModuleMgr.getCenterMgr().getMyInfo();

    height.setText(userInfo.getHeight() == 0 ? "需要完善" : userInfo.getHeight() + "cm");
    home.setText(
        "".equals(userInfo.getHomeprovince())
            ? "需要完善"
            : userInfo.getHomeprovince() + " " + userInfo.getHomecity());
    area.setText("".equals(userInfo.getWorkarea()) ? "需要完善" : userInfo.getWorkarea());

    height.setTextColor(userInfo.getHeight() == 0 ? emptyColor : fillColor);
    home.setTextColor("".equals(userInfo.getHomeprovince()) ? emptyColor : fillColor);
    area.setTextColor("".equals(userInfo.getWorkarea()) ? emptyColor : fillColor);
  }
Ejemplo n.º 6
0
  private void writeCfg() {
    if (pointD == null) {
      return;
    }

    try {
      ModuleMgr.getCfgMgr().setString("LM_longitude", String.valueOf(pointD.longitude));
      ModuleMgr.getCfgMgr().setString("LM_latitude", String.valueOf(pointD.latitude));

      ModuleMgr.getCfgMgr().setString("LM_province", pointD.province);
      ModuleMgr.getCfgMgr().setString("LM_city", pointD.city);
      ModuleMgr.getCfgMgr().setString("LM_district", pointD.district);

      ModuleMgr.getCfgMgr().setString("LM_addr", pointD.addr);

      ModuleMgr.getCfgMgr().setBoolean("LM_Fix_use", useFixPlace);
      ModuleMgr.getCfgMgr().setString("LM_Fix_latitude", String.valueOf(fixPlace.latitude));
      ModuleMgr.getCfgMgr().setString("LM_Fix_longitude", String.valueOf(fixPlace.longitude));
    } catch (Exception e) {
      MMLog.printThrowable(e);
    }
  }
Ejemplo n.º 7
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.plaza_nearby_activity);
    setBackView(R.id.back_view, "附近的人");
    setTitleRight(
        "筛选",
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            showFilter();
          }
        });

    initView();
    ModuleMgr.getDiscoverMgr().reqSecAdjacent(gender, null, 1, NearbyActivity.this);
  }
Ejemplo n.º 8
0
  private void readCfg() {
    if (pointD == null) {
      pointD = new PointD();
    }

    try {
      pointD.longitude = Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_longitude", "1000"));
      pointD.latitude = Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_latitude", "1000"));

      pointD.province = ModuleMgr.getCfgMgr().getString("LM_province", "");
      pointD.city = ModuleMgr.getCfgMgr().getString("LM_city", "");
      pointD.district = ModuleMgr.getCfgMgr().getString("LM_district", "");

      pointD.addr = ModuleMgr.getCfgMgr().getString("LM_addr", "");

      useFixPlace = ModuleMgr.getCfgMgr().getBoolean("LM_Fix_use", false);
      fixPlace.longitude =
          Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_Fix_latitude", "1000"));
      fixPlace.latitude =
          Double.valueOf(ModuleMgr.getCfgMgr().getString("LM_Fix_longitude", "1000"));
    } catch (Exception e) {
      MMLog.printThrowable(e);
    }
  }
Ejemplo n.º 9
0
 @Override
 public void onLoadMore() {
   ModuleMgr.getDiscoverMgr().reqSecAdjacent(gender, null, infoMgr.getNextPage(), this);
 }
Ejemplo n.º 10
0
 @Override
 public void onRefresh() {
   ModuleMgr.getDiscoverMgr().reqSecAdjacent(gender, null, 1, this);
 }