示例#1
0
  void changeLocalDP(int id, Drawable img) {
    int pos = arrayAdapter.getPositionById(id);
    if (pos < 0) return;

    userinfo_element element = ((userinfo_element) arrayAdapter.getItem(pos));
    /** **********Not Working*********** */
    element.setBitmapDp(img);
    ImageView iv = (element).getImageView_dp();
    if (iv != null) iv.setImageDrawable(img);
  }
示例#2
0
  public void setAllDetails() {
    arrayAdapter.clear();
    List<Integer> ids = AppToServer.getAllUserId();
    List<String> unames = AppToServer.getAllUserUname();
    List<String> nnames = AppToServer.getAllUserNname();
    boolean flag = false;
    for (int i = 0; i < ids.size(); i++) {
      // ids.get(i) + " > " + unames.get(i) + " (" + nnames.get(i) + ")\n";
      arrayAdapter.add(
          new userinfo_element(
              unames.get(i), nnames.get(i), ids.get(i), (flag = !flag), null, "", -1, true));
    }

    arrayAdapter.notifyDataSetChanged();
  }
示例#3
0
 public void onSearchResult(int id) {
   int position = arrayAdapter.getPositionById(id);
   int index = AppToServer.getAllUserId().indexOf(id);
   if (index < 0) return;
   String o_nname = AppToServer.getAllUserNname().get(index);
   String o_uname = (String) AppToServer.getAllUserUname().get(index);
   startChat(this, id, o_uname, o_nname, position);
 }
示例#4
0
  void refreshAdapterOnline() {
    List<Integer> OnlineID = AppToServer.getOnlineIDS();
    if (OnlineID == null) return;

    for (int i = 0; i < arrayAdapter.getCount(); i++) {
      userinfo_element item = arrayAdapter.getItem(i);
      item.setIsOnline(false);
    }
    for (int i = 0; i < OnlineID.size(); i++) {
      int pos = arrayAdapter.getPositionById((int) OnlineID.get(i));

      if (pos >= 0) {
        userinfo_element item = arrayAdapter.getItem(pos);
        item.setIsOnline(true);
      }
    }
    arrayAdapter.notifyDataSetChanged();
  }
示例#5
0
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    int o_id = (int) arrayAdapter.getItemId(position);
    int index = AppToServer.getAllUserId().indexOf(o_id);
    if (index < 0) return;
    String o_nname = AppToServer.getAllUserNname().get(index);
    String o_uname = (String) AppToServer.getAllUserUname().get(index);
    startChat(this, o_id, o_uname, o_nname, position);
  }
示例#6
0
 void startLoadingDP() {
   List<Integer> orderOfIDS = new ArrayList<Integer>();
   for (int i = 0; i < arrayAdapter.getCount(); i++)
     orderOfIDS.add(arrayAdapter.getItem(i).getId());
   loadNextThumbDpRec(orderOfIDS, 0, 0);
 }