Ejemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isExiting()) {
      return;
    }
    try {
      addChatEventListener(mChatService);
      ChatServiceConfiguration configuration = mChatService.getConfiguration();
      /* Set max label length */
      int maxMsgLength = configuration.getGroupChatMessageMaxLength();
      if (maxMsgLength > 0) {
        // Set the message composer max length
        InputFilter[] filterArray = new InputFilter[1];
        filterArray[0] = new InputFilter.LengthFilter(maxMsgLength);
        mComposeText.setFilters(filterArray);
      }
      mComposingManager =
          new IsComposingManager(configuration.getIsComposingTimeout(), getNotifyComposing());

    } catch (RcsServiceException e) {
      showExceptionThenExit(e);
    }
    if (LogUtils.isActive) {
      Log.d(LOGTAG, "onCreate");
    }
  }
Ejemplo n.º 2
0
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
   super.onCreateContextMenu(menu, v, menuInfo);
   /* Get the list item position. */
   AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
   Cursor cursor = (Cursor) mAdapter.getItem(info.position);
   menu.add(0, GROUPCHAT_MENU_ITEM_DELETE, 0, R.string.menu_delete_message);
   Direction direction =
       Direction.valueOf(cursor.getInt(cursor.getColumnIndexOrThrow(Message.DIRECTION)));
   if (Direction.OUTGOING == direction) {
     menu.add(0, GROUPCHAT_MENU_ITEM_VIEW_GC_INFO, 1, R.string.menu_view_groupdelivery);
     // TODO depending on mime-type and provider ID, allow user to view file image
   }
 }
Ejemplo n.º 3
0
 @Override
 public void onDestroy() {
   if (LogUtils.isActive) {
     Log.d(LOGTAG, "onDestroy");
   }
   if (mGroupChat != null) {
     try {
       mGroupChat.setComposingStatus(false);
     } catch (RcsServiceException e) {
       Log.w(LOGTAG, ExceptionUtil.getFullStackTrace(e));
     }
   }
   super.onDestroy();
 }
Ejemplo n.º 4
0
 @Override
 protected void onPause() {
   super.onPause();
   sChatIdOnForeground = null;
 }
Ejemplo n.º 5
0
 @Override
 protected void onResume() {
   super.onResume();
   sChatIdOnForeground = mChatId;
 }