Example #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    txt_title = (TextView) this.findViewById(R.id.cht_alert_txt_title);
    txt_body = (TextView) this.findViewById(R.id.cht_alert_txt_body);
    btn_yes = (Button) this.findViewById(R.id.cht_alert_btn_yes);
    btn_no = (Button) this.findViewById(R.id.cht_alert_btn_no);
    try {
      chatSession = ((ChatSession) getSession());
      moduleManager = chatSession.getModuleManager();
      chatManager = moduleManager.getChatManager();
      errorManager = getSession().getErrorManager();

    } catch (Exception e) {
      if (errorManager != null)
        errorManager.reportUnexpectedSubAppException(
            SubApps.CHT_CHAT,
            UnexpectedSubAppExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_FRAGMENT,
            e);
    }
    txt_title.setText(title);
    txt_body.setText(body);

    setUpListeners();
  }
Example #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    container_john_doe = (FrameLayout) findViewById(R.id.container_john_doe);
    container_jane_doe = (FrameLayout) findViewById(R.id.container_jane_doe);
    container_john_doe.setOnClickListener(this);
    container_jane_doe.setOnClickListener(this);
  }
Example #3
0
  @Override
  public void onClick(View v) {

    int i = v.getId();

    if (i == R.id.positive_button) {
      try {
        // image null
        if (intraUserInformation != null && identity != null) {

          getSession()
              .getModuleManager()
              .disconnectIntraUSer(identity.getPublicKey(), intraUserInformation.getPublicKey());

          SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
          prefs.edit().putBoolean("Connected", true).apply();
          Intent broadcast = new Intent(Constants.LOCAL_BROADCAST_CHANNEL);
          broadcast.putExtra(Constants.BROADCAST_DISCONNECTED_UPDATE, true);
          sendLocalBroadcast(broadcast);

          Toast.makeText(getContext(), "Disconnected", Toast.LENGTH_SHORT).show();

        } else {
          super.toastDefaultError();
        }
        dismiss();

      } catch (final IntraUserDisconnectingFailedException e) {

        super.getErrorManager()
            .reportUnexpectedUIException(UISource.VIEW, UnexpectedUIExceptionSeverity.UNSTABLE, e);
        super.toastDefaultError();
      }

      dismiss();
    } else if (i == R.id.negative_button) {
      dismiss();
    }
  }
 @SuppressLint("SetTextI18n")
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   FermatTextView positiveButtonView = (FermatTextView) findViewById(R.id.positive_button);
   FermatTextView negativeButtonView = (FermatTextView) findViewById(R.id.negative_button);
   mDescription = (FermatTextView) findViewById(R.id.description);
   positiveButtonView.setOnClickListener(rightClick);
   negativeButtonView.setOnClickListener(leftClick);
   mDescription.setText(description != null ? description : "");
   positiveButtonView.setText(leftButton != null ? leftButton : "");
   negativeButtonView.setText(rightButton != null ? rightButton : "");
   positiveButtonView.setOnClickListener(leftClick);
   negativeButtonView.setOnClickListener(rightClick);
 }
Example #5
0
  @SuppressLint("SetTextI18n")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mDescription = (FermatTextView) findViewById(R.id.description);
    mUsername = (FermatTextView) findViewById(R.id.user_name);
    mTitle = (FermatTextView) findViewById(R.id.title);
    positiveBtn = (FermatButton) findViewById(R.id.positive_button);
    negativeBtn = (FermatButton) findViewById(R.id.negative_button);

    positiveBtn.setOnClickListener(this);
    negativeBtn.setOnClickListener(this);
    mDescription.setText(description != null ? description : "");
    mUsername.setText(username != null ? username : "");
    mTitle.setText(title != null ? title : "");
  }