This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.cometchat.chatapp; | |
| import android.app.ProgressDialog; | |
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.TextView; | |
| import android.widget.Toast; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| logoutButon.addEventListener("click", function () { | |
| const isLeaved = confirm("Do you want to log out?"); | |
| if (isLeaved) { | |
| // logout from cometchat and then clear storage. | |
| CometChat.logout().then((response) => { | |
| // User successfully logged out. | |
| // Perform any clean up if required. | |
| localStorage.removeItem("auth"); | |
| // redirect to login page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("DOMContentLoaded", function () { | |
| ... | |
| const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
| if (authenticatedUser) { | |
| ... | |
| // call | |
| const callingDialog = document.getElementById("calling"); | |
| const acceptCallBtn = document.getElementById("accept-call"); | |
| const rejectCallBtn = document.getElementById("reject-call"); | |
| const audioCallBtn = document.getElementById("audio-call"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("DOMContentLoaded", function () { | |
| ... | |
| // set header information | |
| const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
| if (authenticatedUser) { | |
| ... | |
| // chatbox | |
| const chatBox = document.getElementById("chatbox"); | |
| const chatBoxUserAvatar = document.getElementById("chatbox__user-avatar"); | |
| const chatBoxUserName = document.getElementById("chatbox__user-name"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("DOMContentLoaded", function () { | |
| ... | |
| const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
| if (authenticatedUser) { | |
| ... | |
| // main left messages | |
| const mainLeftMessagesContainer = document.getElementById("main__left-messages"); | |
| const mainLeftEmpty = document.getElementById("main__left-empty"); | |
| ... | |
| const renderFriends = (userList) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("DOMContentLoaded", function () { | |
| ... | |
| if (authenticatedUser) { | |
| // main card item. | |
| const mainCardEmptyMessage = document.getElementById("main__card-empty"); | |
| const mainCardItemContainer = document.getElementById("main__card-item-container"); | |
| let notificationListenerID = authenticatedUser.uid; | |
| ... | |
| const addFriend = (matchRequestFrom, matchRequestTo, matchRequestReceiver) => { | |
| if (matchRequestFrom && matchRequestTo) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("DOMContentLoaded", function () { | |
| ... | |
| if (authenticatedUser) { | |
| ... | |
| // main card item. | |
| const mainCardEmptyMessage = document.getElementById("main__card-empty"); | |
| const mainCardItemContainer = document.getElementById("main__card-item-container"); | |
| // main card actions. | |
| const mainCardActions = document.getElementById("main__card-actions") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("DOMContentLoaded", function () { | |
| ... | |
| // set header information | |
| const authenticatedUser = JSON.parse(localStorage.getItem("auth")); | |
| if (authenticatedUser) { | |
| ... | |
| // show authenticated user on the header. | |
| const headerRight = document.getElementById("header__right"); | |
| const userImage = document.getElementById("user__image"); | |
| const userName = document.getElementById("user__name"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const registerNewAccount = ({ avatar, email, password, fullname, age, gender }) => { | |
| showLoading(); | |
| const userUuid = uuid.v4(); | |
| const form = new FormData(); | |
| form.append("avatar", avatar); | |
| form.append("email", email); | |
| form.append("password", password); | |
| form.append("age", age); | |
| form.append("gender", gender); | |
| form.append("ccUid", userUuid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const loading = document.getElementById('loading'); | |
| function hideLoading() { | |
| loading.classList.add('loading--hide'); | |
| } | |
| function showLoading() { | |
| loading.classList.remove('loading--hide'); | |
| loading.classList.add('loading--active'); | |
| } |
NewerOlder