Convert string concatination to template

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2022-09-06 17:39:23 +02:00
parent a543bdc7a7
commit 7c8722bfe4
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -329,7 +329,7 @@ class ChatController(args: Bundle) :
val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1)) val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1))
val startNanoTime = System.nanoTime() val startNanoTime = System.nanoTime()
Log.d(TAG, "getRoomInfo - getRoom - calling: " + startNanoTime) Log.d(TAG, "getRoomInfo - getRoom - calling: $startNanoTime")
ncApi.getRoom(credentials, ApiUtils.getUrlForRoom(apiVersion, conversationUser.baseUrl, roomToken)) ncApi.getRoom(credentials, ApiUtils.getUrlForRoom(apiVersion, conversationUser.baseUrl, roomToken))
?.subscribeOn(Schedulers.io()) ?.subscribeOn(Schedulers.io())
?.observeOn(AndroidSchedulers.mainThread()) ?.observeOn(AndroidSchedulers.mainThread())
@ -340,7 +340,7 @@ class ChatController(args: Bundle) :
@Suppress("Detekt.TooGenericExceptionCaught") @Suppress("Detekt.TooGenericExceptionCaught")
override fun onNext(roomOverall: RoomOverall) { override fun onNext(roomOverall: RoomOverall) {
Log.d(TAG, "getRoomInfo - getRoom - got response: " + startNanoTime) Log.d(TAG, "getRoomInfo - getRoom - got response: $startNanoTime")
currentConversation = roomOverall.ocs!!.data currentConversation = roomOverall.ocs!!.data
Log.d( Log.d(
TAG, TAG,
@ -377,7 +377,7 @@ class ChatController(args: Bundle) :
} }
override fun onComplete() { override fun onComplete() {
Log.d(TAG, "getRoomInfo - getRoom - onComplete: " + startNanoTime) Log.d(TAG, "getRoomInfo - getRoom - onComplete: $startNanoTime")
if (shouldRepeat) { if (shouldRepeat) {
if (lobbyTimerHandler == null) { if (lobbyTimerHandler == null) {
lobbyTimerHandler = Handler() lobbyTimerHandler = Handler()
@ -588,7 +588,7 @@ class ChatController(args: Bundle) :
currentConversation?.actorType + "/" + currentConversation?.actorId currentConversation?.actorType + "/" + currentConversation?.actorId
} }
Log.d(TAG, "Initialize TalkMessagesListAdapter with senderId: " + senderId) Log.d(TAG, "Initialize TalkMessagesListAdapter with senderId: $senderId")
adapter = TalkMessagesListAdapter( adapter = TalkMessagesListAdapter(
senderId, senderId,
@ -801,7 +801,7 @@ class ChatController(args: Bundle) :
voiceRecordEndTime = System.currentTimeMillis() voiceRecordEndTime = System.currentTimeMillis()
val voiceRecordDuration = voiceRecordEndTime - voiceRecordStartTime val voiceRecordDuration = voiceRecordEndTime - voiceRecordStartTime
if (voiceRecordDuration < MINIMUM_VOICE_RECORD_DURATION) { if (voiceRecordDuration < MINIMUM_VOICE_RECORD_DURATION) {
Log.d(TAG, "voiceRecordDuration: " + voiceRecordDuration) Log.d(TAG, "voiceRecordDuration: $voiceRecordDuration")
Toast.makeText( Toast.makeText(
context, context,
context.getString(R.string.nc_voice_message_hold_to_record_info), context.getString(R.string.nc_voice_message_hold_to_record_info),
@ -1053,7 +1053,7 @@ class ChatController(args: Bundle) :
try { try {
for (workInfo in workers.get()) { for (workInfo in workers.get()) {
if (workInfo.state == WorkInfo.State.RUNNING || workInfo.state == WorkInfo.State.ENQUEUED) { if (workInfo.state == WorkInfo.State.RUNNING || workInfo.state == WorkInfo.State.ENQUEUED) {
Log.d(TAG, "Download worker for " + fileId + " is already running or scheduled") Log.d(TAG, "Download worker for $fileId is already running or scheduled")
return return
} }
} }
@ -1775,7 +1775,7 @@ class ChatController(args: Bundle) :
cancelNotificationsForCurrentConversation() cancelNotificationsForCurrentConversation()
Log.d(TAG, "onAttach inConversation: " + inConversation.toString()) Log.d(TAG, "onAttach inConversation: $inConversation")
if (inConversation) { if (inConversation) {
Log.d(TAG, "execute joinRoomWithPassword in onAttach") Log.d(TAG, "execute joinRoomWithPassword in onAttach")
joinRoomWithPassword() joinRoomWithPassword()
@ -1883,7 +1883,7 @@ class ChatController(args: Bundle) :
} }
val startNanoTime = System.nanoTime() val startNanoTime = System.nanoTime()
Log.d(TAG, "joinRoomWithPassword - joinRoom - calling: " + startNanoTime) Log.d(TAG, "joinRoomWithPassword - joinRoom - calling: $startNanoTime")
ncApi.joinRoom( ncApi.joinRoom(
credentials, credentials,
ApiUtils.getUrlForParticipantsActive(apiVersion, conversationUser?.baseUrl, roomToken), ApiUtils.getUrlForParticipantsActive(apiVersion, conversationUser?.baseUrl, roomToken),
@ -1899,7 +1899,7 @@ class ChatController(args: Bundle) :
@Suppress("Detekt.TooGenericExceptionCaught") @Suppress("Detekt.TooGenericExceptionCaught")
override fun onNext(roomOverall: RoomOverall) { override fun onNext(roomOverall: RoomOverall) {
Log.d(TAG, "joinRoomWithPassword - joinRoom - got response: " + startNanoTime) Log.d(TAG, "joinRoomWithPassword - joinRoom - got response: $startNanoTime")
inConversation = true inConversation = true
currentConversation?.sessionId = roomOverall.ocs!!.data!!.sessionId currentConversation?.sessionId = roomOverall.ocs!!.data!!.sessionId
Log.d(TAG, "joinRoomWithPassword - sessionId: " + currentConversation?.sessionId) Log.d(TAG, "joinRoomWithPassword - sessionId: " + currentConversation?.sessionId)
@ -1969,7 +1969,7 @@ class ChatController(args: Bundle) :
} }
val startNanoTime = System.nanoTime() val startNanoTime = System.nanoTime()
Log.d(TAG, "leaveRoom - leaveRoom - calling: " + startNanoTime) Log.d(TAG, "leaveRoom - leaveRoom - calling: $startNanoTime")
ncApi.leaveRoom( ncApi.leaveRoom(
credentials, credentials,
ApiUtils.getUrlForParticipantsActive( ApiUtils.getUrlForParticipantsActive(
@ -1986,7 +1986,7 @@ class ChatController(args: Bundle) :
} }
override fun onNext(genericOverall: GenericOverall) { override fun onNext(genericOverall: GenericOverall) {
Log.d(TAG, "leaveRoom - leaveRoom - got response: " + startNanoTime) Log.d(TAG, "leaveRoom - leaveRoom - got response: $startNanoTime")
checkingLobbyStatus = false checkingLobbyStatus = false
if (lobbyTimerHandler != null) { if (lobbyTimerHandler != null) {
@ -2010,7 +2010,7 @@ class ChatController(args: Bundle) :
} }
override fun onComplete() { override fun onComplete() {
Log.d(TAG, "leaveRoom - leaveRoom - completed: " + startNanoTime) Log.d(TAG, "leaveRoom - leaveRoom - completed: $startNanoTime")
disposables.dispose() disposables.dispose()
} }
}) })